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
This commit is contained in:
Marshall Greenblatt 2010-11-18 14:47:38 +00:00
parent 227b9df643
commit f1e4219271
4 changed files with 15 additions and 10 deletions

View File

@ -192,5 +192,9 @@ FilePath BrowserDatabaseSystem::GetFullFilePathForVfsFile(
// This method is getting called when an empty localStorage database is // This method is getting called when an empty localStorage database is
// deleted. In that case, just return the path. // deleted. In that case, just return the path.
#if defined(OS_WIN)
return FilePath(vfs_file_name); return FilePath(vfs_file_name);
#else
return FilePath(UTF16ToUTF8(vfs_file_name));
#endif
} }

View File

@ -29,8 +29,14 @@ bool CefInitialize(bool multi_threaded_message_loop,
// Create the new global context object // Create the new global context object
_Context = new CefContext(); _Context = new CefContext();
// Initialize the global context // 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() void CefShutdown()
@ -182,7 +188,7 @@ CefContext::~CefContext()
} }
bool CefContext::Initialize(bool multi_threaded_message_loop, bool CefContext::Initialize(bool multi_threaded_message_loop,
const std::wstring& cache_path) const FilePath& cache_path)
{ {
cache_path_ = cache_path; cache_path_ = cache_path;

View File

@ -31,7 +31,7 @@ public:
// These methods will be called on the main application thread. // These methods will be called on the main application thread.
bool Initialize(bool multi_threaded_message_loop, bool Initialize(bool multi_threaded_message_loop,
const std::wstring& cache_path); const FilePath& cache_path);
void Shutdown(); void Shutdown();
scoped_refptr<CefProcess> process() { return process_; } scoped_refptr<CefProcess> process() { return process_; }
@ -43,7 +43,7 @@ public:
// Retrieve the path at which cache data will be stored on disk. If empty, // Retrieve the path at which cache data will be stored on disk. If empty,
// cache data will be stored in-memory. // 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() WebPreferences* web_preferences()
{ {
@ -70,7 +70,7 @@ private:
// asserts and possible memory leaks. // asserts and possible memory leaks.
base::AtExitManager at_exit_manager_; base::AtExitManager at_exit_manager_;
std::wstring cache_path_; FilePath cache_path_;
WebPreferences* webprefs_; WebPreferences* webprefs_;
scoped_refptr<BrowserRequestContext> request_context_; scoped_refptr<BrowserRequestContext> request_context_;
scoped_ptr<DOMStorageContext> storage_context_; scoped_ptr<DOMStorageContext> storage_context_;

View File

@ -36,12 +36,7 @@ void CefProcessIOThread::Init() {
CoInitialize(NULL); CoInitialize(NULL);
#endif #endif
#if defined(OS_WIN)
FilePath cache_path(_Context->cache_path()); FilePath cache_path(_Context->cache_path());
#else
FilePath cache_path(WideToUTF8(_Context->cache_path()));
#endif
request_context_ = new BrowserRequestContext(cache_path, request_context_ = new BrowserRequestContext(cache_path,
net::HttpCache::NORMAL, false); net::HttpCache::NORMAL, false);
_Context->set_request_context(request_context_); _Context->set_request_context(request_context_);