Index: webkit/fileapi/file_system_context.cc |
diff --git a/webkit/fileapi/file_system_context.cc b/webkit/fileapi/file_system_context.cc |
index 2b8c7fa9a53ac484fc8c00076001f3f16e7be418..f79a09f16d23a5bf56f4b6064b8bd1d87a25e6de 100644 |
--- a/webkit/fileapi/file_system_context.cc |
+++ b/webkit/fileapi/file_system_context.cc |
@@ -36,10 +36,11 @@ QuotaClient* CreateQuotaClient( |
return new FileSystemQuotaClient(context, is_incognito); |
} |
-void DidOpenFileSystem(FileSystemContext::OpenFileSystemCallback callback, |
- const GURL& filesystem_root, |
- const std::string& filesystem_name, |
- base::PlatformFileError error) { |
+void DidOpenFileSystem( |
+ const FileSystemContext::OpenFileSystemCallback& callback, |
+ const GURL& filesystem_root, |
+ const std::string& filesystem_name, |
+ base::PlatformFileError error) { |
callback.Run(error, filesystem_name, filesystem_root); |
} |
@@ -84,16 +85,18 @@ bool FileSystemContext::DeleteDataForOriginOnFileThread( |
this, quota_manager_proxy(), origin_url, kFileSystemTypePersistent); |
} |
-bool FileSystemContext::DeleteDataForOriginAndTypeOnFileThread( |
+base::PlatformFileError |
+FileSystemContext::DeleteDataForOriginAndTypeOnFileThread( |
kinuko
2012/07/31 20:10:30
Since you changed the return code here I think you
nhiroki (google)
2012/08/01 00:15:48
Done.
|
const GURL& origin_url, FileSystemType type) { |
DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); |
if (type == fileapi::kFileSystemTypeTemporary || |
type == fileapi::kFileSystemTypePersistent) { |
DCHECK(sandbox_provider()); |
- return sandbox_provider()->DeleteOriginDataOnFileThread( |
- this, quota_manager_proxy(), origin_url, type); |
+ if (sandbox_provider()->DeleteOriginDataOnFileThread( |
+ this, quota_manager_proxy(), origin_url, type)) |
+ return base::PLATFORM_FILE_OK; |
} |
- return false; |
+ return base::PLATFORM_FILE_ERROR_FAILED; |
} |
FileSystemQuotaUtil* |
@@ -149,7 +152,7 @@ void FileSystemContext::OpenFileSystem( |
const GURL& origin_url, |
FileSystemType type, |
bool create, |
- OpenFileSystemCallback callback) { |
+ const OpenFileSystemCallback& callback) { |
DCHECK(!callback.is_null()); |
FileSystemMountPointProvider* mount_point_provider = |
@@ -167,6 +170,20 @@ void FileSystemContext::OpenFileSystem( |
base::Bind(&DidOpenFileSystem, callback, root_url, name)); |
} |
+void FileSystemContext::DeleteFileSystem( |
+ const GURL& origin_url, |
+ FileSystemType type, |
+ const DeleteFileSystemCallback& callback) { |
+ FileSystemMountPointProvider* mount_point_provider = |
+ GetMountPointProvider(type); |
+ if (!mount_point_provider) { |
+ callback.Run(base::PLATFORM_FILE_ERROR_SECURITY); |
+ return; |
+ } |
+ |
+ mount_point_provider->DeleteFileSystem(origin_url, type, this, callback); |
+} |
+ |
FileSystemOperationInterface* FileSystemContext::CreateFileSystemOperation( |
const FileSystemURL& url) { |
if (!url.is_valid()) |