From f1e4219271477ec1433286d404c7c1092153604c Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 18 Nov 2010 14:47:38 +0000 Subject: [PATCH] Change CefContext::cache_path_ type from std::wstring to FilePath. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@143 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/browser_database_system.cc | 4 ++++ libcef/cef_context.cc | 10 ++++++++-- libcef/cef_context.h | 6 +++--- libcef/cef_process_io_thread.cc | 5 ----- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/libcef/browser_database_system.cc b/libcef/browser_database_system.cc index ae60cd62a..a60db4c9d 100644 --- a/libcef/browser_database_system.cc +++ b/libcef/browser_database_system.cc @@ -192,5 +192,9 @@ FilePath BrowserDatabaseSystem::GetFullFilePathForVfsFile( // This method is getting called when an empty localStorage database is // deleted. In that case, just return the path. +#if defined(OS_WIN) return FilePath(vfs_file_name); +#else + return FilePath(UTF16ToUTF8(vfs_file_name)); +#endif } diff --git a/libcef/cef_context.cc b/libcef/cef_context.cc index a19a425e1..76193e008 100644 --- a/libcef/cef_context.cc +++ b/libcef/cef_context.cc @@ -29,8 +29,14 @@ bool CefInitialize(bool multi_threaded_message_loop, // Create the new global context object _Context = new CefContext(); + // Initialize the global context - return _Context->Initialize(multi_threaded_message_loop, cache_path); +#if defined(OS_WIN) + FilePath cachePath(cache_path); +#else + FilePath cachePath(WideToUTF8(_Context->cache_path())); +#endif + return _Context->Initialize(multi_threaded_message_loop, cachePath); } void CefShutdown() @@ -182,7 +188,7 @@ CefContext::~CefContext() } bool CefContext::Initialize(bool multi_threaded_message_loop, - const std::wstring& cache_path) + const FilePath& cache_path) { cache_path_ = cache_path; diff --git a/libcef/cef_context.h b/libcef/cef_context.h index 8fa683ba4..09427a4b3 100644 --- a/libcef/cef_context.h +++ b/libcef/cef_context.h @@ -31,7 +31,7 @@ public: // These methods will be called on the main application thread. bool Initialize(bool multi_threaded_message_loop, - const std::wstring& cache_path); + const FilePath& cache_path); void Shutdown(); scoped_refptr process() { return process_; } @@ -43,7 +43,7 @@ public: // Retrieve the path at which cache data will be stored on disk. If empty, // cache data will be stored in-memory. - const std::wstring& cache_path() { return cache_path_; } + const FilePath& cache_path() { return cache_path_; } WebPreferences* web_preferences() { @@ -70,7 +70,7 @@ private: // asserts and possible memory leaks. base::AtExitManager at_exit_manager_; - std::wstring cache_path_; + FilePath cache_path_; WebPreferences* webprefs_; scoped_refptr request_context_; scoped_ptr storage_context_; diff --git a/libcef/cef_process_io_thread.cc b/libcef/cef_process_io_thread.cc index 5dc0c7550..7301c66dd 100644 --- a/libcef/cef_process_io_thread.cc +++ b/libcef/cef_process_io_thread.cc @@ -36,12 +36,7 @@ void CefProcessIOThread::Init() { CoInitialize(NULL); #endif -#if defined(OS_WIN) FilePath cache_path(_Context->cache_path()); -#else - FilePath cache_path(WideToUTF8(_Context->cache_path())); -#endif - request_context_ = new BrowserRequestContext(cache_path, net::HttpCache::NORMAL, false); _Context->set_request_context(request_context_);