| Index: webkit/fileapi/file_system_context.cc
|
| diff --git a/webkit/fileapi/file_system_context.cc b/webkit/fileapi/file_system_context.cc
|
| index 7d51eeab671dc74b7bded944f523749c0f998530..b3d7d7e0658b3577809574b14d8ed6d7d0910c9c 100644
|
| --- a/webkit/fileapi/file_system_context.cc
|
| +++ b/webkit/fileapi/file_system_context.cc
|
| @@ -4,10 +4,12 @@
|
|
|
| #include "webkit/fileapi/file_system_context.h"
|
|
|
| +#include "base/bind.h"
|
| #include "base/file_util.h"
|
| #include "base/message_loop_proxy.h"
|
| #include "googleurl/src/gurl.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSystem.h"
|
| +#include "webkit/fileapi/file_system_callback_dispatcher.h"
|
| #include "webkit/fileapi/file_system_file_util.h"
|
| #include "webkit/fileapi/file_system_options.h"
|
| #include "webkit/fileapi/file_system_quota_client.h"
|
| @@ -33,6 +35,17 @@ QuotaClient* CreateQuotaClient(
|
| return new FileSystemQuotaClient(file_message_loop, context, is_incognito);
|
| }
|
|
|
| +void DidOpenFileSystem(FileSystemCallbackDispatcher* dispatcher,
|
| + const GURL& filesystem_root,
|
| + const std::string& filesystem_name,
|
| + base::PlatformFileError error) {
|
| + if (error == base::PLATFORM_FILE_OK) {
|
| + dispatcher->DidOpenFileSystem(filesystem_name, filesystem_root);
|
| + } else {
|
| + dispatcher->DidFail(error);
|
| + }
|
| +}
|
| +
|
| } // anonymous namespace
|
|
|
| FileSystemContext::FileSystemContext(
|
| @@ -140,6 +153,25 @@ void FileSystemContext::DeleteOnCorrectThread() const {
|
| delete this;
|
| }
|
|
|
| +void FileSystemContext::OpenFileSystem(
|
| + const GURL& origin_url,
|
| + FileSystemType type,
|
| + bool create,
|
| + FileSystemCallbackDispatcher* dispatcher) {
|
| + DCHECK(dispatcher);
|
| +
|
| + GURL root_url = GetFileSystemRootURI(origin_url, type);
|
| + std::string name = GetFileSystemName(origin_url, type);
|
| +
|
| + FileSystemMountPointProvider* mount_point_provider =
|
| + GetMountPointProvider(type);
|
| + DCHECK(mount_point_provider);
|
| + mount_point_provider->ValidateFileSystemRoot(
|
| + origin_url, type, create,
|
| + base::Bind(&DidOpenFileSystem,
|
| + base::Owned(dispatcher), root_url, name));
|
| +}
|
| +
|
| } // namespace fileapi
|
|
|
| COMPILE_ASSERT(int(WebKit::WebFileSystem::TypeTemporary) == \
|
|
|