summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authornhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-17 01:10:36 +0000
committernhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-17 01:10:36 +0000
commite7b9c97314e8ecd309482d2bad217b6ed1727969 (patch)
tree84d7c2a9b05a0d9765059f843571af875d9b9e9b /webkit
parent2d7fbd7b325ced8993d68da26ccf7d135ced3c23 (diff)
downloadchromium_src-e7b9c97314e8ecd309482d2bad217b6ed1727969.zip
chromium_src-e7b9c97314e8ecd309482d2bad217b6ed1727969.tar.gz
chromium_src-e7b9c97314e8ecd309482d2bad217b6ed1727969.tar.bz2
FileAPI: Change FileSystemBackend::OpenFileSystem signature
This change renames FileSystemBackend::OpenFileSystem to InitializeFileSystem and makes it accept FileSystemContext object as one of its arguments. This is a preliminary change for adding SyncFileSystemBackend in the following change sets. Please see the issue for details. BUG=242422 TEST=should pass all existing tests NOTRY=true Review URL: https://chromiumcodereview.appspot.com/19092002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211888 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc3
-rw-r--r--webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc6
-rw-r--r--webkit/browser/fileapi/file_system_backend.h9
-rw-r--r--webkit/browser/fileapi/file_system_context.cc4
-rw-r--r--webkit/browser/fileapi/isolated_file_system_backend.cc5
-rw-r--r--webkit/browser/fileapi/isolated_file_system_backend.h5
-rw-r--r--webkit/browser/fileapi/sandbox_file_system_backend.cc5
-rw-r--r--webkit/browser/fileapi/sandbox_file_system_backend.h5
-rw-r--r--webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc4
-rw-r--r--webkit/browser/fileapi/test_file_system_backend.cc5
-rw-r--r--webkit/browser/fileapi/test_file_system_backend.h5
11 files changed, 33 insertions, 23 deletions
diff --git a/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc b/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc
index b271b77..037c2e83 100644
--- a/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc
+++ b/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc
@@ -63,9 +63,10 @@ class CopyOrMoveFileValidatorTestHelper {
// Sets up source.
FileSystemBackend* src_file_system_backend =
file_system_context_->GetFileSystemBackend(src_type_);
- src_file_system_backend->OpenFileSystem(
+ src_file_system_backend->InitializeFileSystem(
origin_, src_type_,
OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
+ NULL /* context */,
base::Bind(&ExpectOk));
base::MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(base::PLATFORM_FILE_OK, CreateDirectory(SourceURL("")));
diff --git a/webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc b/webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc
index 3eab093..9345fb0 100644
--- a/webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc
+++ b/webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc
@@ -72,15 +72,17 @@ class CopyOrMoveOperationTestHelper {
// Prepare the origin's root directory.
FileSystemBackend* mount_point_provider =
file_system_context_->GetFileSystemBackend(src_type_);
- mount_point_provider->OpenFileSystem(
+ mount_point_provider->InitializeFileSystem(
origin_, src_type_,
OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
+ NULL /* context */,
base::Bind(&ExpectOk));
mount_point_provider =
file_system_context_->GetFileSystemBackend(dest_type_);
- mount_point_provider->OpenFileSystem(
+ mount_point_provider->InitializeFileSystem(
origin_, dest_type_,
OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
+ NULL /* context */,
base::Bind(&ExpectOk));
base::MessageLoop::current()->RunUntilIdle();
diff --git a/webkit/browser/fileapi/file_system_backend.h b/webkit/browser/fileapi/file_system_backend.h
index dc9c0c5..37cb6b0 100644
--- a/webkit/browser/fileapi/file_system_backend.h
+++ b/webkit/browser/fileapi/file_system_backend.h
@@ -42,11 +42,11 @@ class RemoteFileSystemProxyInterface;
//
class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemBackend {
public:
- // Callback for OpenFileSystem.
+ // Callback for InitializeFileSystem.
typedef base::Callback<void(const GURL& root_url,
const std::string& name,
base::PlatformFileError error)>
- OpenFileSystemCallback;
+ InitializeFileSystemCallback;
virtual ~FileSystemBackend() {}
// Returns true if this mount point provider can handle |type|.
@@ -59,11 +59,12 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemBackend {
// If |mode| is CREATE_IF_NONEXISTENT calling this may also create
// the root directory (and/or related database entries etc) for
// the filesystem if it doesn't exist.
- virtual void OpenFileSystem(
+ virtual void InitializeFileSystem(
const GURL& origin_url,
FileSystemType type,
OpenFileSystemMode mode,
- const OpenFileSystemCallback& callback) = 0;
+ FileSystemContext* context,
+ const InitializeFileSystemCallback& callback) = 0;
// Returns the specialized FileSystemFileUtil for this mount point.
// It is ok to return NULL if the filesystem doesn't support synchronous
diff --git a/webkit/browser/fileapi/file_system_context.cc b/webkit/browser/fileapi/file_system_context.cc
index 471341c..24c505b 100644
--- a/webkit/browser/fileapi/file_system_context.cc
+++ b/webkit/browser/fileapi/file_system_context.cc
@@ -269,8 +269,8 @@ void FileSystemContext::OpenFileSystem(
return;
}
- backend->OpenFileSystem(origin_url, type, mode,
- base::Bind(&DidOpenFileSystem, callback));
+ backend->InitializeFileSystem(origin_url, type, mode, this,
+ base::Bind(&DidOpenFileSystem, callback));
}
void FileSystemContext::DeleteFileSystem(
diff --git a/webkit/browser/fileapi/isolated_file_system_backend.cc b/webkit/browser/fileapi/isolated_file_system_backend.cc
index 37de6eb..97c1962 100644
--- a/webkit/browser/fileapi/isolated_file_system_backend.cc
+++ b/webkit/browser/fileapi/isolated_file_system_backend.cc
@@ -56,11 +56,12 @@ bool IsolatedFileSystemBackend::CanHandleType(FileSystemType type) const {
}
}
-void IsolatedFileSystemBackend::OpenFileSystem(
+void IsolatedFileSystemBackend::InitializeFileSystem(
const GURL& origin_url,
FileSystemType type,
OpenFileSystemMode mode,
- const OpenFileSystemCallback& callback) {
+ FileSystemContext* context,
+ const InitializeFileSystemCallback& callback) {
// We never allow opening a new isolated FileSystem via usual OpenFileSystem.
base::MessageLoopProxy::current()->PostTask(
FROM_HERE,
diff --git a/webkit/browser/fileapi/isolated_file_system_backend.h b/webkit/browser/fileapi/isolated_file_system_backend.h
index 6d869cf..63cf4de 100644
--- a/webkit/browser/fileapi/isolated_file_system_backend.h
+++ b/webkit/browser/fileapi/isolated_file_system_backend.h
@@ -19,11 +19,12 @@ class IsolatedFileSystemBackend : public FileSystemBackend {
// FileSystemBackend implementation.
virtual bool CanHandleType(FileSystemType type) const OVERRIDE;
- virtual void OpenFileSystem(
+ virtual void InitializeFileSystem(
const GURL& origin_url,
FileSystemType type,
OpenFileSystemMode mode,
- const OpenFileSystemCallback& callback) OVERRIDE;
+ FileSystemContext* context,
+ const InitializeFileSystemCallback& callback) OVERRIDE;
virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE;
virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE;
virtual CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory(
diff --git a/webkit/browser/fileapi/sandbox_file_system_backend.cc b/webkit/browser/fileapi/sandbox_file_system_backend.cc
index eb319f4..1c034c9 100644
--- a/webkit/browser/fileapi/sandbox_file_system_backend.cc
+++ b/webkit/browser/fileapi/sandbox_file_system_backend.cc
@@ -173,11 +173,12 @@ bool SandboxFileSystemBackend::CanHandleType(FileSystemType type) const {
type == kFileSystemTypeSyncableForInternalSync;
}
-void SandboxFileSystemBackend::OpenFileSystem(
+void SandboxFileSystemBackend::InitializeFileSystem(
const GURL& origin_url,
fileapi::FileSystemType type,
OpenFileSystemMode mode,
- const OpenFileSystemCallback& callback) {
+ FileSystemContext* context,
+ const InitializeFileSystemCallback& callback) {
if (file_system_options_.is_incognito() &&
!(type == kFileSystemTypeTemporary &&
enable_temporary_file_system_in_incognito_)) {
diff --git a/webkit/browser/fileapi/sandbox_file_system_backend.h b/webkit/browser/fileapi/sandbox_file_system_backend.h
index 8711f0b0..5ac590f 100644
--- a/webkit/browser/fileapi/sandbox_file_system_backend.h
+++ b/webkit/browser/fileapi/sandbox_file_system_backend.h
@@ -73,11 +73,12 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackend
// FileSystemBackend overrides.
virtual bool CanHandleType(FileSystemType type) const OVERRIDE;
- virtual void OpenFileSystem(
+ virtual void InitializeFileSystem(
const GURL& origin_url,
FileSystemType type,
OpenFileSystemMode mode,
- const OpenFileSystemCallback& callback) OVERRIDE;
+ FileSystemContext* context,
+ const InitializeFileSystemCallback& callback) OVERRIDE;
virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE;
virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE;
virtual CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory(
diff --git a/webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc b/webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc
index 373e684..449e9fe 100644
--- a/webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc
+++ b/webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc
@@ -113,8 +113,8 @@ class SandboxFileSystemBackendTest : public testing::Test {
OpenFileSystemMode mode,
base::FilePath* root_path) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- backend_->OpenFileSystem(
- origin_url, type, mode,
+ backend_->InitializeFileSystem(
+ origin_url, type, mode, NULL /* context */,
base::Bind(&DidOpenFileSystem, &error));
base::MessageLoop::current()->RunUntilIdle();
if (error != base::PLATFORM_FILE_OK)
diff --git a/webkit/browser/fileapi/test_file_system_backend.cc b/webkit/browser/fileapi/test_file_system_backend.cc
index 700cc0d..b20ce34 100644
--- a/webkit/browser/fileapi/test_file_system_backend.cc
+++ b/webkit/browser/fileapi/test_file_system_backend.cc
@@ -148,11 +148,12 @@ bool TestFileSystemBackend::CanHandleType(FileSystemType type) const {
return (type == kFileSystemTypeTest);
}
-void TestFileSystemBackend::OpenFileSystem(
+void TestFileSystemBackend::InitializeFileSystem(
const GURL& origin_url,
FileSystemType type,
OpenFileSystemMode mode,
- const OpenFileSystemCallback& callback) {
+ FileSystemContext* context,
+ const InitializeFileSystemCallback& callback) {
callback.Run(GetFileSystemRootURI(origin_url, type),
GetFileSystemName(origin_url, type),
base::PLATFORM_FILE_OK);
diff --git a/webkit/browser/fileapi/test_file_system_backend.h b/webkit/browser/fileapi/test_file_system_backend.h
index 72642f3..21b4e43 100644
--- a/webkit/browser/fileapi/test_file_system_backend.h
+++ b/webkit/browser/fileapi/test_file_system_backend.h
@@ -35,11 +35,12 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE TestFileSystemBackend
// FileSystemBackend implementation.
virtual bool CanHandleType(FileSystemType type) const OVERRIDE;
- virtual void OpenFileSystem(
+ virtual void InitializeFileSystem(
const GURL& origin_url,
FileSystemType type,
OpenFileSystemMode mode,
- const OpenFileSystemCallback& callback) OVERRIDE;
+ FileSystemContext* context,
+ const InitializeFileSystemCallback& callback) OVERRIDE;
virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE;
virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE;
virtual CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory(