| Index: webkit/browser/fileapi/sandbox_file_system_backend.cc
|
| diff --git a/webkit/browser/fileapi/sandbox_file_system_backend.cc b/webkit/browser/fileapi/sandbox_file_system_backend.cc
|
| index bcaa6a99a6e27e8217a9d08b604fcc1aa577150c..9ef58a6e4771266e02179e97d6ee8c7c24657926 100644
|
| --- a/webkit/browser/fileapi/sandbox_file_system_backend.cc
|
| +++ b/webkit/browser/fileapi/sandbox_file_system_backend.cc
|
| @@ -27,6 +27,7 @@
|
| #include "webkit/browser/fileapi/sandbox_file_stream_writer.h"
|
| #include "webkit/browser/fileapi/sandbox_quota_observer.h"
|
| #include "webkit/browser/fileapi/syncable/syncable_file_system_operation.h"
|
| +#include "webkit/browser/fileapi/syncable/syncable_file_system_util.h"
|
| #include "webkit/browser/quota/quota_manager.h"
|
| #include "webkit/common/fileapi/file_system_types.h"
|
| #include "webkit/common/fileapi/file_system_util.h"
|
| @@ -96,7 +97,7 @@ class ObfuscatedOriginEnumerator
|
|
|
| void DidOpenFileSystem(
|
| base::WeakPtr<SandboxFileSystemBackend> mount_point_provider,
|
| - const FileSystemBackend::OpenFileSystemCallback& callback,
|
| + const base::Callback<void(base::PlatformFileError error)>& callback,
|
| base::PlatformFileError* error) {
|
| if (mount_point_provider.get())
|
| mount_point_provider.get()->CollectOpenFileSystemMetrics(*error);
|
| @@ -207,14 +208,15 @@ bool SandboxFileSystemBackend::CanHandleType(FileSystemType type) const {
|
| }
|
|
|
| void SandboxFileSystemBackend::OpenFileSystem(
|
| - const GURL& origin_url, fileapi::FileSystemType type,
|
| + const GURL& origin_url,
|
| + fileapi::FileSystemType type,
|
| OpenFileSystemMode mode,
|
| const OpenFileSystemCallback& callback) {
|
| if (file_system_options_.is_incognito() &&
|
| !(type == kFileSystemTypeTemporary &&
|
| enable_temporary_file_system_in_incognito_)) {
|
| // TODO(kinuko): return an isolated temporary directory.
|
| - callback.Run(base::PLATFORM_FILE_ERROR_SECURITY);
|
| + callback.Run(GURL(), std::string(), base::PLATFORM_FILE_ERROR_SECURITY);
|
| UMA_HISTOGRAM_ENUMERATION(kOpenFileSystemLabel,
|
| kIncognito,
|
| kFileSystemErrorMax);
|
| @@ -222,13 +224,20 @@ void SandboxFileSystemBackend::OpenFileSystem(
|
| }
|
|
|
| if (!IsAllowedScheme(origin_url)) {
|
| - callback.Run(base::PLATFORM_FILE_ERROR_SECURITY);
|
| + callback.Run(GURL(), std::string(), base::PLATFORM_FILE_ERROR_SECURITY);
|
| UMA_HISTOGRAM_ENUMERATION(kOpenFileSystemLabel,
|
| kInvalidSchemeError,
|
| kFileSystemErrorMax);
|
| return;
|
| }
|
|
|
| + // TODO(nhiroki): Factor out SyncFS related code to SyncFileSystemBackend we
|
| + // plan to introduce. (http://crbug.com/242422/)
|
| + GURL root_url = (type == kFileSystemTypeSyncable)
|
| + ? sync_file_system::GetSyncableFileSystemRootURI(origin_url)
|
| + : GetFileSystemRootURI(origin_url, type);
|
| + std::string name = GetFileSystemName(origin_url, type);
|
| +
|
| base::PlatformFileError* error_ptr = new base::PlatformFileError;
|
| file_task_runner_->PostTaskAndReply(
|
| FROM_HERE,
|
| @@ -238,7 +247,8 @@ void SandboxFileSystemBackend::OpenFileSystem(
|
| base::Unretained(error_ptr)),
|
| base::Bind(&DidOpenFileSystem,
|
| weak_factory_.GetWeakPtr(),
|
| - callback, base::Owned(error_ptr)));
|
| + base::Bind(callback, root_url, name),
|
| + base::Owned(error_ptr)));
|
|
|
| if (enable_usage_tracking_)
|
| return;
|
|
|