mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Eliminate use of scoped directories (issue #670).
- Create a temporary cache_path directory if none is specified (issue #735). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@827 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
|
||||
#include "libcef/browser_file_system.h"
|
||||
#include "libcef/browser_file_writer.h"
|
||||
#include "libcef/cef_context.h"
|
||||
#include "libcef/cef_thread.h"
|
||||
|
||||
#include "base/bind.h"
|
||||
@ -80,25 +81,20 @@ BrowserFileSystem::BrowserFileSystem() {
|
||||
void BrowserFileSystem::CreateContext() {
|
||||
if (file_system_context_.get())
|
||||
return;
|
||||
if (file_system_dir_.CreateUniqueTempDir()) {
|
||||
std::vector<std::string> additional_allowed_schemes;
|
||||
additional_allowed_schemes.push_back("file");
|
||||
std::vector<std::string> additional_allowed_schemes;
|
||||
additional_allowed_schemes.push_back("file");
|
||||
|
||||
file_system_context_ = new FileSystemContext(
|
||||
make_scoped_ptr(new FileSystemTaskRunners(
|
||||
CefThread::GetMessageLoopProxyForThread(CefThread::IO),
|
||||
CefThread::GetMessageLoopProxyForThread(CefThread::FILE),
|
||||
CefThread::GetMessageLoopProxyForThread(CefThread::FILE))),
|
||||
NULL /* special storage policy */,
|
||||
NULL /* quota manager */,
|
||||
file_system_dir_.path(),
|
||||
fileapi::FileSystemOptions(
|
||||
fileapi::FileSystemOptions::PROFILE_MODE_NORMAL,
|
||||
additional_allowed_schemes));
|
||||
} else {
|
||||
LOG(WARNING) << "Failed to create a temp dir for the filesystem."
|
||||
"FileSystem feature will be disabled.";
|
||||
}
|
||||
file_system_context_ = new FileSystemContext(
|
||||
make_scoped_ptr(new FileSystemTaskRunners(
|
||||
CefThread::GetMessageLoopProxyForThread(CefThread::IO),
|
||||
CefThread::GetMessageLoopProxyForThread(CefThread::FILE),
|
||||
CefThread::GetMessageLoopProxyForThread(CefThread::FILE))),
|
||||
NULL /* special storage policy */,
|
||||
NULL /* quota manager */,
|
||||
_Context->cache_path(),
|
||||
fileapi::FileSystemOptions(
|
||||
fileapi::FileSystemOptions::PROFILE_MODE_NORMAL,
|
||||
additional_allowed_schemes));
|
||||
}
|
||||
|
||||
BrowserFileSystem::~BrowserFileSystem() {
|
||||
|
Reference in New Issue
Block a user