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_);