diff options
Diffstat (limited to 'webkit/browser/fileapi')
34 files changed, 332 insertions, 344 deletions
diff --git a/webkit/browser/fileapi/async_file_test_helper.cc b/webkit/browser/fileapi/async_file_test_helper.cc index 476fdcd..8a01fd2 100644 --- a/webkit/browser/fileapi/async_file_test_helper.cc +++ b/webkit/browser/fileapi/async_file_test_helper.cc @@ -6,8 +6,8 @@ #include "base/run_loop.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/fileapi/async_file_test_helper.h" +#include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/browser/fileapi/file_system_mount_point_provider.h" #include "webkit/browser/fileapi/file_system_operation_runner.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/quota/quota_manager.h" diff --git a/webkit/browser/fileapi/async_file_util.h b/webkit/browser/fileapi/async_file_util.h index fd399a5..9d51024 100644 --- a/webkit/browser/fileapi/async_file_util.h +++ b/webkit/browser/fileapi/async_file_util.h @@ -33,7 +33,7 @@ class FileSystemURL; // must implement this interface or a synchronous version of interface: // FileSystemFileUtil. // -// As far as an instance of this class is owned by a MountPointProvider +// As far as an instance of this class is owned by a FileSystemBackend // (which is owned by FileSystemContext), it's guaranteed that this instance's // alive while FileSystemOperationContext given to each operation is kept // alive. (Note that this instance might be freed on different thread 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 b971fd5..51dbe77 100644 --- a/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc +++ b/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc @@ -11,12 +11,12 @@ #include "webkit/browser/fileapi/async_file_test_helper.h" #include "webkit/browser/fileapi/copy_or_move_file_validator.h" #include "webkit/browser/fileapi/external_mount_points.h" +#include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/browser/fileapi/file_system_mount_point_provider.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/isolated_context.h" #include "webkit/browser/fileapi/mock_file_system_context.h" -#include "webkit/browser/fileapi/test_mount_point_provider.h" +#include "webkit/browser/fileapi/test_file_system_backend.h" #include "webkit/browser/quota/mock_special_storage_policy.h" #include "webkit/common/fileapi/file_system_util.h" @@ -52,16 +52,16 @@ class CopyOrMoveFileValidatorTestHelper { file_system_context_ = CreateFileSystemContextForTesting(NULL, base_dir); - // Set up TestMountPointProvider to require CopyOrMoveFileValidator. - FileSystemMountPointProvider* test_mount_point_provider = - file_system_context_->GetMountPointProvider(kWithValidatorType); - static_cast<TestMountPointProvider*>(test_mount_point_provider)-> + // Set up TestFileSystemBackend to require CopyOrMoveFileValidator. + FileSystemBackend* test_file_system_backend = + file_system_context_->GetFileSystemBackend(kWithValidatorType); + static_cast<TestFileSystemBackend*>(test_file_system_backend)-> set_require_copy_or_move_validator(true); // Sets up source. - FileSystemMountPointProvider* src_mount_point_provider = - file_system_context_->GetMountPointProvider(src_type_); - src_mount_point_provider->OpenFileSystem( + FileSystemBackend* src_file_system_backend = + file_system_context_->GetFileSystemBackend(src_type_); + src_file_system_backend->OpenFileSystem( origin_, src_type_, OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, base::Bind(&ExpectOk)); @@ -88,9 +88,9 @@ class CopyOrMoveFileValidatorTestHelper { void SetMediaCopyOrMoveFileValidatorFactory( scoped_ptr<CopyOrMoveFileValidatorFactory> factory) { - TestMountPointProvider* provider = static_cast<TestMountPointProvider*>( - file_system_context_->GetMountPointProvider(kWithValidatorType)); - provider->InitializeCopyOrMoveFileValidatorFactory(factory.Pass()); + TestFileSystemBackend* backend = static_cast<TestFileSystemBackend*>( + file_system_context_->GetFileSystemBackend(kWithValidatorType)); + backend->InitializeCopyOrMoveFileValidatorFactory(factory.Pass()); } void CopyTest(base::PlatformFileError expected) { 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 fd02874..bda8ce0 100644 --- a/webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc +++ b/webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc @@ -13,8 +13,8 @@ #include "base/stl_util.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/fileapi/async_file_test_helper.h" +#include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/browser/fileapi/file_system_mount_point_provider.h" #include "webkit/browser/fileapi/file_system_operation.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/mock_file_system_context.h" @@ -68,14 +68,14 @@ class CopyOrMoveOperationTestHelper { CreateFileSystemContextForTesting(quota_manager_proxy_.get(), base_dir); // Prepare the origin's root directory. - FileSystemMountPointProvider* mount_point_provider = - file_system_context_->GetMountPointProvider(src_type_); + FileSystemBackend* mount_point_provider = + file_system_context_->GetFileSystemBackend(src_type_); mount_point_provider->OpenFileSystem( origin_, src_type_, OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, base::Bind(&ExpectOk)); mount_point_provider = - file_system_context_->GetMountPointProvider(dest_type_); + file_system_context_->GetFileSystemBackend(dest_type_); mount_point_provider->OpenFileSystem( origin_, dest_type_, OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, diff --git a/webkit/browser/fileapi/dump_file_system.cc b/webkit/browser/fileapi/dump_file_system.cc index 42fb86a..1c165d7 100644 --- a/webkit/browser/fileapi/dump_file_system.cc +++ b/webkit/browser/fileapi/dump_file_system.cc @@ -40,7 +40,7 @@ #include "base/strings/stringprintf.h" #include "webkit/browser/fileapi/obfuscated_file_util.h" #include "webkit/browser/fileapi/sandbox_directory_database.h" -#include "webkit/browser/fileapi/sandbox_mount_point_provider.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include "webkit/browser/fileapi/sandbox_origin_database.h" #include "webkit/common/fileapi/file_system_types.h" #include "webkit/common/fileapi/file_system_util.h" diff --git a/webkit/browser/fileapi/file_system_mount_point_provider.h b/webkit/browser/fileapi/file_system_backend.h index 3de8793..03f2766 100644 --- a/webkit/browser/fileapi/file_system_mount_point_provider.h +++ b/webkit/browser/fileapi/file_system_backend.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ -#define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ +#ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ +#define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ #include <string> #include <vector> @@ -35,18 +35,17 @@ class FileSystemOperation; class FileSystemQuotaUtil; class RemoteFileSystemProxyInterface; -// An interface to provide mount-point-specific path-related utilities -// and specialized FileSystemFileUtil instance. +// An interface for defining a file system backend. // -// NOTE: when you implement a new MountPointProvider for your own +// NOTE: when you implement a new FileSystemBackend for your own // FileSystem module, please contact to kinuko@chromium.org. // -class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemMountPointProvider { +class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemBackend { public: // Callback for OpenFileSystem. typedef base::Callback<void(base::PlatformFileError error)> OpenFileSystemCallback; - virtual ~FileSystemMountPointProvider() {} + virtual ~FileSystemBackend() {} // Returns true if this mount point provider can handle |type|. // One mount point provider may be able to handle multiple filesystem types. @@ -118,8 +117,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemMountPointProvider { }; // An interface to control external file system access permissions. -class ExternalFileSystemMountPointProvider - : public FileSystemMountPointProvider { +// TODO(satorux): Move this out of 'webkit/browser/fileapi'. crbug.com/257279 +class ExternalFileSystemBackend : public FileSystemBackend { public: // Returns true if |url| is allowed to be accessed. // This is supposed to perform ExternalFileSystem-specific security @@ -147,4 +146,4 @@ class ExternalFileSystemMountPointProvider } // namespace fileapi -#endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ +#endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ diff --git a/webkit/browser/fileapi/file_system_context.cc b/webkit/browser/fileapi/file_system_context.cc index b552522..49f6388 100644 --- a/webkit/browser/fileapi/file_system_context.cc +++ b/webkit/browser/fileapi/file_system_context.cc @@ -22,13 +22,13 @@ #include "webkit/browser/fileapi/file_system_task_runners.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/isolated_context.h" -#include "webkit/browser/fileapi/isolated_mount_point_provider.h" +#include "webkit/browser/fileapi/isolated_file_system_backend.h" #include "webkit/browser/fileapi/mount_points.h" -#include "webkit/browser/fileapi/sandbox_mount_point_provider.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include "webkit/browser/fileapi/syncable/local_file_change_tracker.h" #include "webkit/browser/fileapi/syncable/local_file_sync_context.h" #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h" -#include "webkit/browser/fileapi/test_mount_point_provider.h" +#include "webkit/browser/fileapi/test_file_system_backend.h" #include "webkit/browser/quota/quota_manager.h" #include "webkit/browser/quota/special_storage_policy.h" #include "webkit/common/fileapi/file_system_util.h" @@ -105,20 +105,20 @@ FileSystemContext::FileSystemContext( ExternalMountPoints* external_mount_points, quota::SpecialStoragePolicy* special_storage_policy, quota::QuotaManagerProxy* quota_manager_proxy, - ScopedVector<FileSystemMountPointProvider> additional_providers, + ScopedVector<FileSystemBackend> additional_backends, const base::FilePath& partition_path, const FileSystemOptions& options) : task_runners_(task_runners.Pass()), quota_manager_proxy_(quota_manager_proxy), - sandbox_provider_( - new SandboxMountPointProvider( + sandbox_backend_( + new SandboxFileSystemBackend( quota_manager_proxy, task_runners_->file_task_runner(), partition_path, options, special_storage_policy)), - isolated_provider_(new IsolatedMountPointProvider()), - additional_providers_(additional_providers.Pass()), + isolated_backend_(new IsolatedFileSystemBackend()), + additional_backends_(additional_backends.Pass()), external_mount_points_(external_mount_points), partition_path_(partition_path), operation_runner_(new FileSystemOperationRunner(this)) { @@ -129,13 +129,13 @@ FileSystemContext::FileSystemContext( this, options.is_incognito())); } - RegisterMountPointProvider(sandbox_provider_.get()); - RegisterMountPointProvider(isolated_provider_.get()); + RegisterBackend(sandbox_backend_.get()); + RegisterBackend(isolated_backend_.get()); - for (ScopedVector<FileSystemMountPointProvider>::const_iterator iter = - additional_providers_.begin(); - iter != additional_providers_.end(); ++iter) { - RegisterMountPointProvider(*iter); + for (ScopedVector<FileSystemBackend>::const_iterator iter = + additional_backends_.begin(); + iter != additional_backends_.end(); ++iter) { + RegisterBackend(*iter); } // Additional mount points must be added before regular system-wide @@ -152,13 +152,13 @@ bool FileSystemContext::DeleteDataForOriginOnFileThread( DCHECK(origin_url == origin_url.GetOrigin()); bool success = true; - for (MountPointProviderMap::iterator iter = provider_map_.begin(); - iter != provider_map_.end(); + for (FileSystemBackendMap::iterator iter = backend_map_.begin(); + iter != backend_map_.end(); ++iter) { - FileSystemMountPointProvider* provider = iter->second; - if (!provider->GetQuotaUtil()) + FileSystemBackend* backend = iter->second; + if (!backend->GetQuotaUtil()) continue; - if (provider->GetQuotaUtil()->DeleteOriginDataOnFileThread( + if (backend->GetQuotaUtil()->DeleteOriginDataOnFileThread( this, quota_manager_proxy(), origin_url, iter->first) != base::PLATFORM_FILE_OK) { // Continue the loop, but record the failure. @@ -171,29 +171,26 @@ bool FileSystemContext::DeleteDataForOriginOnFileThread( FileSystemQuotaUtil* FileSystemContext::GetQuotaUtil(FileSystemType type) const { - FileSystemMountPointProvider* mount_point_provider = - GetMountPointProvider(type); - if (!mount_point_provider) + FileSystemBackend* backend = GetFileSystemBackend(type); + if (!backend) return NULL; - return mount_point_provider->GetQuotaUtil(); + return backend->GetQuotaUtil(); } AsyncFileUtil* FileSystemContext::GetAsyncFileUtil( FileSystemType type) const { - FileSystemMountPointProvider* mount_point_provider = - GetMountPointProvider(type); - if (!mount_point_provider) + FileSystemBackend* backend = GetFileSystemBackend(type); + if (!backend) return NULL; - return mount_point_provider->GetAsyncFileUtil(type); + return backend->GetAsyncFileUtil(type); } FileSystemFileUtil* FileSystemContext::GetFileUtil( FileSystemType type) const { - FileSystemMountPointProvider* mount_point_provider = - GetMountPointProvider(type); - if (!mount_point_provider) + FileSystemBackend* backend = GetFileSystemBackend(type); + if (!backend) return NULL; - return mount_point_provider->GetFileUtil(type); + return backend->GetFileUtil(type); } CopyOrMoveFileValidatorFactory* @@ -201,18 +198,17 @@ FileSystemContext::GetCopyOrMoveFileValidatorFactory( FileSystemType type, base::PlatformFileError* error_code) const { DCHECK(error_code); *error_code = base::PLATFORM_FILE_OK; - FileSystemMountPointProvider* mount_point_provider = - GetMountPointProvider(type); - if (!mount_point_provider) + FileSystemBackend* backend = GetFileSystemBackend(type); + if (!backend) return NULL; - return mount_point_provider->GetCopyOrMoveFileValidatorFactory( + return backend->GetCopyOrMoveFileValidatorFactory( type, error_code); } -FileSystemMountPointProvider* FileSystemContext::GetMountPointProvider( +FileSystemBackend* FileSystemContext::GetFileSystemBackend( FileSystemType type) const { - MountPointProviderMap::const_iterator found = provider_map_.find(type); - if (found != provider_map_.end()) + FileSystemBackendMap::const_iterator found = backend_map_.find(type); + if (found != backend_map_.end()) return found->second; NOTREACHED() << "Unknown filesystem type: " << type; return NULL; @@ -224,41 +220,40 @@ bool FileSystemContext::IsSandboxFileSystem(FileSystemType type) const { const UpdateObserverList* FileSystemContext::GetUpdateObservers( FileSystemType type) const { - // Currently update observer is only available in SandboxMountPointProvider - // and TestMountPointProvider. + // Currently update observer is only available in SandboxFileSystemBackend + // and TestFileSystemBackend. // TODO(kinuko): Probably GetUpdateObservers() virtual method should be - // added to FileSystemMountPointProvider interface and be called like + // added to FileSystemBackend interface and be called like // other GetFoo() methods do. - if (sandbox_provider_->CanHandleType(type)) - return sandbox_provider_->GetUpdateObservers(type); + if (sandbox_backend_->CanHandleType(type)) + return sandbox_backend_->GetUpdateObservers(type); if (type != kFileSystemTypeTest) return NULL; - FileSystemMountPointProvider* mount_point_provider = - GetMountPointProvider(type); - return static_cast<TestMountPointProvider*>( - mount_point_provider)->GetUpdateObservers(type); + FileSystemBackend* backend = GetFileSystemBackend(type); + return static_cast<TestFileSystemBackend*>( + backend)->GetUpdateObservers(type); } const AccessObserverList* FileSystemContext::GetAccessObservers( FileSystemType type) const { - // Currently access observer is only available in SandboxMountPointProvider. - if (sandbox_provider_->CanHandleType(type)) - return sandbox_provider_->GetAccessObservers(type); + // Currently access observer is only available in SandboxFileSystemBackend. + if (sandbox_backend_->CanHandleType(type)) + return sandbox_backend_->GetAccessObservers(type); return NULL; } void FileSystemContext::GetFileSystemTypes( std::vector<FileSystemType>* types) const { types->clear(); - for (MountPointProviderMap::const_iterator iter = provider_map_.begin(); - iter != provider_map_.end(); ++iter) + for (FileSystemBackendMap::const_iterator iter = backend_map_.begin(); + iter != backend_map_.end(); ++iter) types->push_back(iter->first); } -ExternalFileSystemMountPointProvider* -FileSystemContext::external_provider() const { - return static_cast<ExternalFileSystemMountPointProvider*>( - GetMountPointProvider(kFileSystemTypeExternal)); +ExternalFileSystemBackend* +FileSystemContext::external_backend() const { + return static_cast<ExternalFileSystemBackend*>( + GetFileSystemBackend(kFileSystemTypeExternal)); } void FileSystemContext::OpenFileSystem( @@ -268,9 +263,8 @@ void FileSystemContext::OpenFileSystem( const OpenFileSystemCallback& callback) { DCHECK(!callback.is_null()); - FileSystemMountPointProvider* mount_point_provider = - GetMountPointProvider(type); - if (!mount_point_provider) { + FileSystemBackend* backend = GetFileSystemBackend(type); + if (!backend) { callback.Run(base::PLATFORM_FILE_ERROR_SECURITY, std::string(), GURL()); return; } @@ -282,7 +276,7 @@ void FileSystemContext::OpenFileSystem( root_url = GetFileSystemRootURI(origin_url, type); std::string name = GetFileSystemName(origin_url, type); - mount_point_provider->OpenFileSystem( + backend->OpenFileSystem( origin_url, type, mode, base::Bind(&DidOpenFileSystem, callback, root_url, name)); } @@ -292,13 +286,12 @@ void FileSystemContext::DeleteFileSystem( FileSystemType type, const DeleteFileSystemCallback& callback) { DCHECK(origin_url == origin_url.GetOrigin()); - FileSystemMountPointProvider* mount_point_provider = - GetMountPointProvider(type); - if (!mount_point_provider) { + FileSystemBackend* backend = GetFileSystemBackend(type); + if (!backend) { callback.Run(base::PLATFORM_FILE_ERROR_SECURITY); return; } - if (!mount_point_provider->GetQuotaUtil()) { + if (!backend->GetQuotaUtil()) { callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); return; } @@ -308,7 +301,7 @@ void FileSystemContext::DeleteFileSystem( FROM_HERE, // It is safe to pass Unretained(quota_util) since context owns it. base::Bind(&FileSystemQuotaUtil::DeleteOriginDataOnFileThread, - base::Unretained(mount_point_provider->GetQuotaUtil()), + base::Unretained(backend->GetQuotaUtil()), make_scoped_refptr(this), base::Unretained(quota_manager_proxy()), origin_url, @@ -323,11 +316,10 @@ FileSystemContext::CreateFileStreamReader( const base::Time& expected_modification_time) { if (!url.is_valid()) return scoped_ptr<webkit_blob::FileStreamReader>(); - FileSystemMountPointProvider* mount_point_provider = - GetMountPointProvider(url.type()); - if (!mount_point_provider) + FileSystemBackend* backend = GetFileSystemBackend(url.type()); + if (!backend) return scoped_ptr<webkit_blob::FileStreamReader>(); - return mount_point_provider->CreateFileStreamReader( + return backend->CreateFileStreamReader( url, offset, expected_modification_time, this); } @@ -336,11 +328,10 @@ scoped_ptr<FileStreamWriter> FileSystemContext::CreateFileStreamWriter( int64 offset) { if (!url.is_valid()) return scoped_ptr<FileStreamWriter>(); - FileSystemMountPointProvider* mount_point_provider = - GetMountPointProvider(url.type()); - if (!mount_point_provider) + FileSystemBackend* backend = GetFileSystemBackend(url.type()); + if (!backend) return scoped_ptr<FileStreamWriter>(); - return mount_point_provider->CreateFileStreamWriter(url, offset, this); + return backend->CreateFileStreamWriter(url, offset, this); } void FileSystemContext::SetLocalFileChangeTracker( @@ -348,11 +339,11 @@ void FileSystemContext::SetLocalFileChangeTracker( DCHECK(!change_tracker_.get()); DCHECK(tracker.get()); change_tracker_ = tracker.Pass(); - sandbox_provider_->AddFileUpdateObserver( + sandbox_backend_->AddFileUpdateObserver( kFileSystemTypeSyncable, change_tracker_.get(), task_runners_->file_task_runner()); - sandbox_provider_->AddFileChangeObserver( + sandbox_backend_->AddFileChangeObserver( kFileSystemTypeSyncable, change_tracker_.get(), task_runners_->file_task_runner()); @@ -376,7 +367,7 @@ FileSystemURL FileSystemContext::CreateCrackedFileSystemURL( #if defined(OS_CHROMEOS) && defined(GOOGLE_CHROME_BUILD) void FileSystemContext::EnableTemporaryFileSystemInIncognito() { - sandbox_provider_->set_enable_temporary_file_system_in_incognito(true); + sandbox_backend_->set_enable_temporary_file_system_in_incognito(true); } #endif @@ -401,9 +392,8 @@ FileSystemOperation* FileSystemContext::CreateFileSystemOperation( return NULL; } - FileSystemMountPointProvider* mount_point_provider = - GetMountPointProvider(url.type()); - if (!mount_point_provider) { + FileSystemBackend* backend = GetFileSystemBackend(url.type()); + if (!backend) { if (error_code) *error_code = base::PLATFORM_FILE_ERROR_FAILED; return NULL; @@ -411,7 +401,7 @@ FileSystemOperation* FileSystemContext::CreateFileSystemOperation( base::PlatformFileError fs_error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = - mount_point_provider->CreateFileSystemOperation(url, this, &fs_error); + backend->CreateFileSystemOperation(url, this, &fs_error); if (error_code) *error_code = fs_error; @@ -446,29 +436,29 @@ FileSystemURL FileSystemContext::CrackFileSystemURL( return current; } -void FileSystemContext::RegisterMountPointProvider( - FileSystemMountPointProvider* provider) { +void FileSystemContext::RegisterBackend( + FileSystemBackend* backend) { const FileSystemType mount_types[] = { kFileSystemTypeTemporary, kFileSystemTypePersistent, kFileSystemTypeIsolated, kFileSystemTypeExternal, }; - // Register mount point providers for public mount types. + // Register file system backends for public mount types. for (size_t j = 0; j < ARRAYSIZE_UNSAFE(mount_types); ++j) { - if (provider->CanHandleType(mount_types[j])) { - const bool inserted = provider_map_.insert( - std::make_pair(mount_types[j], provider)).second; + if (backend->CanHandleType(mount_types[j])) { + const bool inserted = backend_map_.insert( + std::make_pair(mount_types[j], backend)).second; DCHECK(inserted); } } - // Register mount point providers for internal types. + // Register file system backends for internal types. for (int t = kFileSystemInternalTypeEnumStart + 1; t < kFileSystemInternalTypeEnumEnd; ++t) { FileSystemType type = static_cast<FileSystemType>(t); - if (provider->CanHandleType(type)) { - const bool inserted = provider_map_.insert( - std::make_pair(type, provider)).second; + if (backend->CanHandleType(type)) { + const bool inserted = backend_map_.insert( + std::make_pair(type, backend)).second; DCHECK(inserted); } } diff --git a/webkit/browser/fileapi/file_system_context.h b/webkit/browser/fileapi/file_system_context.h index 21d48be..be293b9 100644 --- a/webkit/browser/fileapi/file_system_context.h +++ b/webkit/browser/fileapi/file_system_context.h @@ -48,20 +48,20 @@ namespace fileapi { class AsyncFileUtil; class CopyOrMoveFileValidatorFactory; -class ExternalFileSystemMountPointProvider; +class ExternalFileSystemBackend; class ExternalMountPoints; class FileStreamWriter; class FileSystemFileUtil; -class FileSystemMountPointProvider; +class FileSystemBackend; class FileSystemOperation; class FileSystemOperationRunner; class FileSystemOptions; class FileSystemQuotaUtil; class FileSystemTaskRunners; class FileSystemURL; -class IsolatedMountPointProvider; +class IsolatedFileSystemBackend; class MountPoints; -class SandboxMountPointProvider; +class SandboxFileSystemBackend; struct DefaultContextDeleter; @@ -80,7 +80,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext static int GetPermissionPolicy(FileSystemType type); // task_runners->file_task_runner() is used as default TaskRunner. - // Unless a MountPointProvider is overridden in CreateFileSystemOperation, + // Unless a FileSystemBackend is overridden in CreateFileSystemOperation, // it is used for all file operations and file related meta operations. // The code assumes that // task_runners->file_task_runner()->RunsTasksOnCurrentThread() @@ -88,12 +88,11 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext // blocking file operations (like SequencedWorkerPool implementation does). // // |external_mount_points| contains non-system external mount points available - // in the context. If not NULL, it will be used during URL cracking. On - // ChromeOS, it will be passed to external_mount_point_provider. + // in the context. If not NULL, it will be used during URL cracking. // |external_mount_points| may be NULL only on platforms different from // ChromeOS (i.e. platforms that don't use external_mount_point_provider). // - // |additional_providers| are added to the internal provider map + // |additional_backends| are added to the internal backend map // to serve filesystem requests for non-regular types. // If none is given, this context only handles HTML5 Sandbox FileSystem // and Drag-and-drop Isolated FileSystem requests. @@ -102,7 +101,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext ExternalMountPoints* external_mount_points, quota::SpecialStoragePolicy* special_storage_policy, quota::QuotaManagerProxy* quota_manager_proxy, - ScopedVector<FileSystemMountPointProvider> additional_providers, + ScopedVector<FileSystemBackend> additional_backends, const base::FilePath& partition_path, const FileSystemOptions& options); @@ -131,10 +130,10 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory( FileSystemType type, base::PlatformFileError* error_code) const; - // Returns the mount point provider instance for the given |type|. + // Returns the file system backend instance for the given |type|. // This may return NULL if it is given an invalid or unsupported filesystem // type. - FileSystemMountPointProvider* GetMountPointProvider( + FileSystemBackend* GetFileSystemBackend( FileSystemType type) const; // Returns true for sandboxed filesystems. Currently this does @@ -150,10 +149,10 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext // Returns all registered filesystem types. void GetFileSystemTypes(std::vector<FileSystemType>* types) const; - // Returns a FileSystemMountPointProvider instance for external filesystem + // Returns a FileSystemBackend instance for external filesystem // type, which is used only by chromeos for now. This is equivalent to - // calling GetMountPointProvider(kFileSystemTypeExternal). - ExternalFileSystemMountPointProvider* external_provider() const; + // calling GetFileSystemBackend(kFileSystemTypeExternal). + ExternalFileSystemBackend* external_backend() const; // Used for OpenFileSystem. typedef base::Callback<void(base::PlatformFileError result, @@ -189,8 +188,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext // the file has been modified, and if it does any succeeding read operations // should fail with ERR_UPLOAD_FILE_CHANGED error. // This method internally cracks the |url|, get an appropriate - // MountPointProvider for the URL and call the provider's CreateFileReader. - // The resolved MountPointProvider could perform further specialization + // FileSystemBackend for the URL and call the backend's CreateFileReader. + // The resolved FileSystemBackend could perform further specialization // depending on the filesystem type pointed by the |url|. scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( const FileSystemURL& url, @@ -236,13 +235,13 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext #endif private: - typedef std::map<FileSystemType, FileSystemMountPointProvider*> - MountPointProviderMap; + typedef std::map<FileSystemType, FileSystemBackend*> + FileSystemBackendMap; // For CreateFileSystemOperation. friend class FileSystemOperationRunner; - // For sandbox_provider(). + // For sandbox_backend(). friend class SandboxFileSystemTestHelper; // Deleters. @@ -255,9 +254,9 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext void DeleteOnCorrectThread() const; // Creates a new FileSystemOperation instance by getting an appropriate - // MountPointProvider for |url| and calling the provider's corresponding + // FileSystemBackend for |url| and calling the backend's corresponding // CreateFileSystemOperation method. - // The resolved MountPointProvider could perform further specialization + // The resolved FileSystemBackend could perform further specialization // depending on the filesystem type pointed by the |url|. // // Called by FileSystemOperationRunner. @@ -274,33 +273,33 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext // returns the original url, without attempting to crack it. FileSystemURL CrackFileSystemURL(const FileSystemURL& url) const; - // For initial provider_map construction. This must be called only from + // For initial backend_map construction. This must be called only from // the constructor. - void RegisterMountPointProvider(FileSystemMountPointProvider* provider); + void RegisterBackend(FileSystemBackend* backend); - // Returns a FileSystemMountPointProvider, used only by test code. - SandboxMountPointProvider* sandbox_provider() const { - return sandbox_provider_.get(); + // Returns a FileSystemBackend, used only by test code. + SandboxFileSystemBackend* sandbox_backend() const { + return sandbox_backend_.get(); } scoped_ptr<FileSystemTaskRunners> task_runners_; scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; - // Regular mount point providers. - scoped_ptr<SandboxMountPointProvider> sandbox_provider_; - scoped_ptr<IsolatedMountPointProvider> isolated_provider_; + // Regular file system backends. + scoped_ptr<SandboxFileSystemBackend> sandbox_backend_; + scoped_ptr<IsolatedFileSystemBackend> isolated_backend_; - // Additional mount point providers. - ScopedVector<FileSystemMountPointProvider> additional_providers_; + // Additional file system backends. + ScopedVector<FileSystemBackend> additional_backends_; - // Registered mount point providers. + // Registered file system backends. // The map must be constructed in the constructor since it can be accessed // on multiple threads. - // This map itself doesn't retain each provider's ownership; ownerships - // of the providers are held by additional_providers_ or other scoped_ptr - // provider fields. - MountPointProviderMap provider_map_; + // This map itself doesn't retain each backend's ownership; ownerships + // of the backends are held by additional_backends_ or other scoped_ptr + // backend fields. + FileSystemBackendMap backend_map_; // External mount points visible in the file system context (excluding system // external mount points). diff --git a/webkit/browser/fileapi/file_system_context_unittest.cc b/webkit/browser/fileapi/file_system_context_unittest.cc index 3c5dfcb..a2beb07a 100644 --- a/webkit/browser/fileapi/file_system_context_unittest.cc +++ b/webkit/browser/fileapi/file_system_context_unittest.cc @@ -9,7 +9,7 @@ #include "base/strings/stringprintf.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/fileapi/external_mount_points.h" -#include "webkit/browser/fileapi/file_system_mount_point_provider.h" +#include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_task_runners.h" #include "webkit/browser/fileapi/isolated_context.h" #include "webkit/browser/fileapi/mock_file_system_options.h" @@ -64,7 +64,7 @@ class FileSystemContextTest : public testing::Test { external_mount_points, storage_policy_.get(), mock_quota_manager_->proxy(), - ScopedVector<FileSystemMountPointProvider>(), + ScopedVector<FileSystemBackend>(), data_dir_.path(), CreateAllowFileAccessOptions()); } diff --git a/webkit/browser/fileapi/file_system_quota_client.cc b/webkit/browser/fileapi/file_system_quota_client.cc index 571a08d..9e72e98 100644 --- a/webkit/browser/fileapi/file_system_quota_client.cc +++ b/webkit/browser/fileapi/file_system_quota_client.cc @@ -22,7 +22,7 @@ #include "webkit/browser/fileapi/file_system_quota_util.h" #include "webkit/browser/fileapi/file_system_task_runners.h" #include "webkit/browser/fileapi/file_system_usage_cache.h" -#include "webkit/browser/fileapi/sandbox_mount_point_provider.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include "webkit/common/fileapi/file_system_util.h" using quota::StorageType; @@ -68,7 +68,7 @@ quota::QuotaStatusCode DeleteOriginOnFileThread( FileSystemContext* context, const GURL& origin, FileSystemType type) { - FileSystemMountPointProvider* provider = context->GetMountPointProvider(type); + FileSystemBackend* provider = context->GetFileSystemBackend(type); if (!provider || !provider->GetQuotaUtil()) return quota::kQuotaErrorNotSupported; base::PlatformFileError result = diff --git a/webkit/browser/fileapi/isolated_mount_point_provider.cc b/webkit/browser/fileapi/isolated_file_system_backend.cc index 362c528..d40fe36 100644 --- a/webkit/browser/fileapi/isolated_mount_point_provider.cc +++ b/webkit/browser/fileapi/isolated_file_system_backend.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/fileapi/isolated_mount_point_provider.h" +#include "webkit/browser/fileapi/isolated_file_system_backend.h" #include <string> @@ -31,16 +31,16 @@ namespace fileapi { -IsolatedMountPointProvider::IsolatedMountPointProvider() +IsolatedFileSystemBackend::IsolatedFileSystemBackend() : isolated_file_util_(new AsyncFileUtilAdapter(new IsolatedFileUtil())), dragged_file_util_(new AsyncFileUtilAdapter(new DraggedFileUtil())), transient_file_util_(new AsyncFileUtilAdapter(new TransientFileUtil())) { } -IsolatedMountPointProvider::~IsolatedMountPointProvider() { +IsolatedFileSystemBackend::~IsolatedFileSystemBackend() { } -bool IsolatedMountPointProvider::CanHandleType(FileSystemType type) const { +bool IsolatedFileSystemBackend::CanHandleType(FileSystemType type) const { switch (type) { case kFileSystemTypeIsolated: case kFileSystemTypeDragged: @@ -56,7 +56,7 @@ bool IsolatedMountPointProvider::CanHandleType(FileSystemType type) const { } } -void IsolatedMountPointProvider::OpenFileSystem( +void IsolatedFileSystemBackend::OpenFileSystem( const GURL& origin_url, FileSystemType type, OpenFileSystemMode mode, @@ -67,7 +67,7 @@ void IsolatedMountPointProvider::OpenFileSystem( base::Bind(callback, base::PLATFORM_FILE_ERROR_SECURITY)); } -FileSystemFileUtil* IsolatedMountPointProvider::GetFileUtil( +FileSystemFileUtil* IsolatedFileSystemBackend::GetFileUtil( FileSystemType type) { switch (type) { case kFileSystemTypeNativeLocal: @@ -82,7 +82,7 @@ FileSystemFileUtil* IsolatedMountPointProvider::GetFileUtil( return NULL; } -AsyncFileUtil* IsolatedMountPointProvider::GetAsyncFileUtil( +AsyncFileUtil* IsolatedFileSystemBackend::GetAsyncFileUtil( FileSystemType type) { switch (type) { case kFileSystemTypeNativeLocal: @@ -98,14 +98,14 @@ AsyncFileUtil* IsolatedMountPointProvider::GetAsyncFileUtil( } CopyOrMoveFileValidatorFactory* -IsolatedMountPointProvider::GetCopyOrMoveFileValidatorFactory( +IsolatedFileSystemBackend::GetCopyOrMoveFileValidatorFactory( FileSystemType type, base::PlatformFileError* error_code) { DCHECK(error_code); *error_code = base::PLATFORM_FILE_OK; return NULL; } -FileSystemOperation* IsolatedMountPointProvider::CreateFileSystemOperation( +FileSystemOperation* IsolatedFileSystemBackend::CreateFileSystemOperation( const FileSystemURL& url, FileSystemContext* context, base::PlatformFileError* error_code) const { @@ -114,7 +114,7 @@ FileSystemOperation* IsolatedMountPointProvider::CreateFileSystemOperation( } scoped_ptr<webkit_blob::FileStreamReader> -IsolatedMountPointProvider::CreateFileStreamReader( +IsolatedFileSystemBackend::CreateFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, @@ -125,7 +125,7 @@ IsolatedMountPointProvider::CreateFileStreamReader( url.path(), offset, expected_modification_time)); } -scoped_ptr<FileStreamWriter> IsolatedMountPointProvider::CreateFileStreamWriter( +scoped_ptr<FileStreamWriter> IsolatedFileSystemBackend::CreateFileStreamWriter( const FileSystemURL& url, int64 offset, FileSystemContext* context) const { @@ -133,7 +133,7 @@ scoped_ptr<FileStreamWriter> IsolatedMountPointProvider::CreateFileStreamWriter( context->task_runners()->file_task_runner(), url.path(), offset)); } -FileSystemQuotaUtil* IsolatedMountPointProvider::GetQuotaUtil() { +FileSystemQuotaUtil* IsolatedFileSystemBackend::GetQuotaUtil() { // No quota support. return NULL; } diff --git a/webkit/browser/fileapi/isolated_mount_point_provider.h b/webkit/browser/fileapi/isolated_file_system_backend.h index 449ecf5..6d869cf 100644 --- a/webkit/browser/fileapi/isolated_mount_point_provider.h +++ b/webkit/browser/fileapi/isolated_file_system_backend.h @@ -2,22 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_FILEAPI_ISOLATED_MOUNT_POINT_PROVIDER_H_ -#define WEBKIT_BROWSER_FILEAPI_ISOLATED_MOUNT_POINT_PROVIDER_H_ +#ifndef WEBKIT_BROWSER_FILEAPI_ISOLATED_FILE_SYSTEM_BACKEND_H_ +#define WEBKIT_BROWSER_FILEAPI_ISOLATED_FILE_SYSTEM_BACKEND_H_ #include "base/memory/scoped_ptr.h" -#include "webkit/browser/fileapi/file_system_mount_point_provider.h" +#include "webkit/browser/fileapi/file_system_backend.h" namespace fileapi { class AsyncFileUtilAdapter; -class IsolatedMountPointProvider : public FileSystemMountPointProvider { +class IsolatedFileSystemBackend : public FileSystemBackend { public: - IsolatedMountPointProvider(); - virtual ~IsolatedMountPointProvider(); + IsolatedFileSystemBackend(); + virtual ~IsolatedFileSystemBackend(); - // FileSystemMountPointProvider implementation. + // FileSystemBackend implementation. virtual bool CanHandleType(FileSystemType type) const OVERRIDE; virtual void OpenFileSystem( const GURL& origin_url, @@ -52,4 +52,4 @@ class IsolatedMountPointProvider : public FileSystemMountPointProvider { } // namespace fileapi -#endif // WEBKIT_BROWSER_FILEAPI_ISOLATED_MOUNT_POINT_PROVIDER_H_ +#endif // WEBKIT_BROWSER_FILEAPI_ISOLATED_FILE_SYSTEM_BACKEND_H_ diff --git a/webkit/browser/fileapi/local_file_system_operation.cc b/webkit/browser/fileapi/local_file_system_operation.cc index 7f09998..688ada6 100644 --- a/webkit/browser/fileapi/local_file_system_operation.cc +++ b/webkit/browser/fileapi/local_file_system_operation.cc @@ -13,9 +13,9 @@ #include "webkit/browser/fileapi/async_file_util.h" #include "webkit/browser/fileapi/copy_or_move_operation_delegate.h" #include "webkit/browser/fileapi/file_observers.h" +#include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_file_util.h" -#include "webkit/browser/fileapi/file_system_mount_point_provider.h" #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_task_runners.h" #include "webkit/browser/fileapi/file_system_url.h" diff --git a/webkit/browser/fileapi/local_file_system_operation.h b/webkit/browser/fileapi/local_file_system_operation.h index 044081db..0ccf33c 100644 --- a/webkit/browser/fileapi/local_file_system_operation.h +++ b/webkit/browser/fileapi/local_file_system_operation.h @@ -29,7 +29,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileSystemOperation : public NON_EXPORTED_BASE(FileSystemOperation), public base::SupportsWeakPtr<LocalFileSystemOperation> { public: - // NOTE: This constructor should not be called outside MountPointProviders; + // NOTE: This constructor should not be called outside FileSystemBackends; // instead please consider using // file_system_context->CreateFileSystemOperation() to instantiate // an appropriate FileSystemOperation. diff --git a/webkit/browser/fileapi/local_file_system_operation_unittest.cc b/webkit/browser/fileapi/local_file_system_operation_unittest.cc index 0dfb82e..3a8a428 100644 --- a/webkit/browser/fileapi/local_file_system_operation_unittest.cc +++ b/webkit/browser/fileapi/local_file_system_operation_unittest.cc @@ -20,8 +20,8 @@ #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_operation_runner.h" #include "webkit/browser/fileapi/mock_file_change_observer.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include "webkit/browser/fileapi/sandbox_file_system_test_helper.h" -#include "webkit/browser/fileapi/sandbox_mount_point_provider.h" #include "webkit/browser/quota/mock_quota_manager.h" #include "webkit/browser/quota/quota_manager.h" #include "webkit/common/blob/shareable_file_reference.h" diff --git a/webkit/browser/fileapi/local_file_system_operation_write_unittest.cc b/webkit/browser/fileapi/local_file_system_operation_write_unittest.cc index e5a879c..8219d19 100644 --- a/webkit/browser/fileapi/local_file_system_operation_write_unittest.cc +++ b/webkit/browser/fileapi/local_file_system_operation_write_unittest.cc @@ -25,7 +25,7 @@ #include "webkit/browser/fileapi/local_file_util.h" #include "webkit/browser/fileapi/mock_file_change_observer.h" #include "webkit/browser/fileapi/mock_file_system_context.h" -#include "webkit/browser/fileapi/test_mount_point_provider.h" +#include "webkit/browser/fileapi/test_file_system_backend.h" #include "webkit/browser/quota/mock_quota_manager.h" #include "webkit/common/blob/blob_data.h" #include "webkit/common/fileapi/file_system_util.h" @@ -80,8 +80,8 @@ class LocalFileSystemOperationWriteTest URLForPath(virtual_path_), true /* exclusive */, base::Bind(&AssertStatusEq, base::PLATFORM_FILE_OK)); - static_cast<TestMountPointProvider*>( - file_system_context_->GetMountPointProvider(kFileSystemType)) + static_cast<TestFileSystemBackend*>( + file_system_context_->GetFileSystemBackend(kFileSystemType)) ->AddFileChangeObserver(change_observer()); } diff --git a/webkit/browser/fileapi/local_file_util.h b/webkit/browser/fileapi/local_file_util.h index 5d08359..abd6b54 100644 --- a/webkit/browser/fileapi/local_file_util.h +++ b/webkit/browser/fileapi/local_file_util.h @@ -23,7 +23,7 @@ namespace fileapi { class FileSystemOperationContext; class FileSystemURL; -// An instance of this class is created and owned by *MountPointProvider. +// An instance of this class is created and owned by *FileSystemBackend. class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE LocalFileUtil : public FileSystemFileUtil { public: diff --git a/webkit/browser/fileapi/mock_file_system_context.cc b/webkit/browser/fileapi/mock_file_system_context.cc index 70ddbcc..329e1a3 100644 --- a/webkit/browser/fileapi/mock_file_system_context.cc +++ b/webkit/browser/fileapi/mock_file_system_context.cc @@ -6,11 +6,11 @@ #include "base/memory/scoped_vector.h" #include "webkit/browser/fileapi/external_mount_points.h" +#include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/browser/fileapi/file_system_mount_point_provider.h" #include "webkit/browser/fileapi/file_system_task_runners.h" #include "webkit/browser/fileapi/mock_file_system_options.h" -#include "webkit/browser/fileapi/test_mount_point_provider.h" +#include "webkit/browser/fileapi/test_file_system_backend.h" #include "webkit/browser/quota/mock_special_storage_policy.h" namespace fileapi { @@ -18,8 +18,8 @@ namespace fileapi { FileSystemContext* CreateFileSystemContextForTesting( quota::QuotaManagerProxy* quota_manager_proxy, const base::FilePath& base_path) { - ScopedVector<FileSystemMountPointProvider> additional_providers; - additional_providers.push_back(new TestMountPointProvider( + ScopedVector<FileSystemBackend> additional_providers; + additional_providers.push_back(new TestFileSystemBackend( base::MessageLoopProxy::current().get(), base_path)); return CreateFileSystemContextWithAdditionalProvidersForTesting( quota_manager_proxy, additional_providers.Pass(), base_path); @@ -27,7 +27,7 @@ FileSystemContext* CreateFileSystemContextForTesting( FileSystemContext* CreateFileSystemContextWithAdditionalProvidersForTesting( quota::QuotaManagerProxy* quota_manager_proxy, - ScopedVector<FileSystemMountPointProvider> additional_providers, + ScopedVector<FileSystemBackend> additional_providers, const base::FilePath& base_path) { return new FileSystemContext( FileSystemTaskRunners::CreateMockTaskRunners(), diff --git a/webkit/browser/fileapi/mock_file_system_context.h b/webkit/browser/fileapi/mock_file_system_context.h index 2081ff9..bf01ba1 100644 --- a/webkit/browser/fileapi/mock_file_system_context.h +++ b/webkit/browser/fileapi/mock_file_system_context.h @@ -16,17 +16,17 @@ class SpecialStoragePolicy; namespace fileapi { class FileSystemContext; -class FileSystemMountPointProvider; +class FileSystemBackend; FileSystemContext* CreateFileSystemContextForTesting( quota::QuotaManagerProxy* quota_manager_proxy, const base::FilePath& base_path); -// The caller is responsible for including TestMountPointProvider in +// The caller is responsible for including TestFileSystemBackend in // |additional_providers| if needed. FileSystemContext* CreateFileSystemContextWithAdditionalProvidersForTesting( quota::QuotaManagerProxy* quota_manager_proxy, - ScopedVector<FileSystemMountPointProvider> additional_providers, + ScopedVector<FileSystemBackend> additional_providers, const base::FilePath& base_path); } // namespace fileapi diff --git a/webkit/browser/fileapi/obfuscated_file_util.cc b/webkit/browser/fileapi/obfuscated_file_util.cc index a5e5ab3..174cb81 100644 --- a/webkit/browser/fileapi/obfuscated_file_util.cc +++ b/webkit/browser/fileapi/obfuscated_file_util.cc @@ -24,8 +24,8 @@ #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/native_file_util.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include "webkit/browser/fileapi/sandbox_isolated_origin_database.h" -#include "webkit/browser/fileapi/sandbox_mount_point_provider.h" #include "webkit/browser/fileapi/sandbox_origin_database.h" #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h" #include "webkit/browser/fileapi/timed_task_helper.h" diff --git a/webkit/browser/fileapi/obfuscated_file_util.h b/webkit/browser/fileapi/obfuscated_file_util.h index 1355ce9..4c39e52 100644 --- a/webkit/browser/fileapi/obfuscated_file_util.h +++ b/webkit/browser/fileapi/obfuscated_file_util.h @@ -159,7 +159,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE ObfuscatedFileUtil // TODO(ericu): This doesn't really feel like it belongs in this class. // The previous version lives in FileSystemPathManager, but perhaps - // SandboxMountPointProvider would be better? + // SandboxFileSystemBackend would be better? static base::FilePath::StringType GetDirectoryNameForType( FileSystemType type); diff --git a/webkit/browser/fileapi/obfuscated_file_util_unittest.cc b/webkit/browser/fileapi/obfuscated_file_util_unittest.cc index ec87a49..31e8e87 100644 --- a/webkit/browser/fileapi/obfuscated_file_util_unittest.cc +++ b/webkit/browser/fileapi/obfuscated_file_util_unittest.cc @@ -16,8 +16,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/fileapi/async_file_test_helper.h" #include "webkit/browser/fileapi/external_mount_points.h" +#include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/browser/fileapi/file_system_mount_point_provider.h" #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_task_runners.h" #include "webkit/browser/fileapi/file_system_usage_cache.h" diff --git a/webkit/browser/fileapi/sandbox_mount_point_provider.cc b/webkit/browser/fileapi/sandbox_file_system_backend.cc index 89d0538..bcaa6a9 100644 --- a/webkit/browser/fileapi/sandbox_mount_point_provider.cc +++ b/webkit/browser/fileapi/sandbox_file_system_backend.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/fileapi/sandbox_mount_point_provider.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include "base/bind.h" #include "base/command_line.h" @@ -75,7 +75,7 @@ const base::FilePath::CharType kRestrictedChars[] = { }; class ObfuscatedOriginEnumerator - : public SandboxMountPointProvider::OriginEnumerator { + : public SandboxFileSystemBackend::OriginEnumerator { public: explicit ObfuscatedOriginEnumerator(ObfuscatedFileUtil* file_util) { enum_.reset(file_util->CreateOriginEnumerator()); @@ -95,8 +95,8 @@ class ObfuscatedOriginEnumerator }; void DidOpenFileSystem( - base::WeakPtr<SandboxMountPointProvider> mount_point_provider, - const FileSystemMountPointProvider::OpenFileSystemCallback& callback, + base::WeakPtr<SandboxFileSystemBackend> mount_point_provider, + const FileSystemBackend::OpenFileSystemCallback& callback, base::PlatformFileError* error) { if (mount_point_provider.get()) mount_point_provider.get()->CollectOpenFileSystemMetrics(*error); @@ -130,10 +130,10 @@ void OpenFileSystemOnFileThread( } // anonymous namespace const base::FilePath::CharType -SandboxMountPointProvider::kFileSystemDirectory[] = +SandboxFileSystemBackend::kFileSystemDirectory[] = FILE_PATH_LITERAL("File System"); -SandboxMountPointProvider::SandboxMountPointProvider( +SandboxFileSystemBackend::SandboxFileSystemBackend( quota::QuotaManagerProxy* quota_manager_proxy, base::SequencedTaskRunner* file_task_runner, const base::FilePath& profile_path, @@ -184,7 +184,7 @@ SandboxMountPointProvider::SandboxMountPointProvider( } } -SandboxMountPointProvider::~SandboxMountPointProvider() { +SandboxFileSystemBackend::~SandboxFileSystemBackend() { if (!file_task_runner_->RunsTasksOnCurrentThread()) { AsyncFileUtilAdapter* sandbox_file_util = sandbox_file_util_.release(); SandboxQuotaObserver* quota_observer = quota_observer_.release(); @@ -199,14 +199,14 @@ SandboxMountPointProvider::~SandboxMountPointProvider() { } } -bool SandboxMountPointProvider::CanHandleType(FileSystemType type) const { +bool SandboxFileSystemBackend::CanHandleType(FileSystemType type) const { return type == kFileSystemTypeTemporary || type == kFileSystemTypePersistent || type == kFileSystemTypeSyncable || type == kFileSystemTypeSyncableForInternalSync; } -void SandboxMountPointProvider::OpenFileSystem( +void SandboxFileSystemBackend::OpenFileSystem( const GURL& origin_url, fileapi::FileSystemType type, OpenFileSystemMode mode, const OpenFileSystemCallback& callback) { @@ -247,24 +247,24 @@ void SandboxMountPointProvider::OpenFileSystem( // --disable-file-system-usage-tracking. file_task_runner_->PostTask( FROM_HERE, - base::Bind(&SandboxMountPointProvider::InvalidateUsageCacheOnFileThread, + base::Bind(&SandboxFileSystemBackend::InvalidateUsageCacheOnFileThread, sandbox_sync_file_util(), origin_url, type, file_system_usage_cache_.get())); }; -FileSystemFileUtil* SandboxMountPointProvider::GetFileUtil( +FileSystemFileUtil* SandboxFileSystemBackend::GetFileUtil( FileSystemType type) { DCHECK(sandbox_file_util_.get()); return sandbox_file_util_->sync_file_util(); } -AsyncFileUtil* SandboxMountPointProvider::GetAsyncFileUtil( +AsyncFileUtil* SandboxFileSystemBackend::GetAsyncFileUtil( FileSystemType type) { return sandbox_file_util_.get(); } CopyOrMoveFileValidatorFactory* -SandboxMountPointProvider::GetCopyOrMoveFileValidatorFactory( +SandboxFileSystemBackend::GetCopyOrMoveFileValidatorFactory( FileSystemType type, base::PlatformFileError* error_code) { DCHECK(error_code); @@ -272,7 +272,7 @@ SandboxMountPointProvider::GetCopyOrMoveFileValidatorFactory( return NULL; } -FileSystemOperation* SandboxMountPointProvider::CreateFileSystemOperation( +FileSystemOperation* SandboxFileSystemBackend::CreateFileSystemOperation( const FileSystemURL& url, FileSystemContext* context, base::PlatformFileError* error_code) const { @@ -307,7 +307,7 @@ FileSystemOperation* SandboxMountPointProvider::CreateFileSystemOperation( } scoped_ptr<webkit_blob::FileStreamReader> -SandboxMountPointProvider::CreateFileStreamReader( +SandboxFileSystemBackend::CreateFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, @@ -320,7 +320,7 @@ SandboxMountPointProvider::CreateFileStreamReader( } scoped_ptr<fileapi::FileStreamWriter> -SandboxMountPointProvider::CreateFileStreamWriter( +SandboxFileSystemBackend::CreateFileStreamWriter( const FileSystemURL& url, int64 offset, FileSystemContext* context) const { @@ -330,16 +330,16 @@ SandboxMountPointProvider::CreateFileStreamWriter( new SandboxFileStreamWriter(context, url, offset, update_observers_)); } -FileSystemQuotaUtil* SandboxMountPointProvider::GetQuotaUtil() { +FileSystemQuotaUtil* SandboxFileSystemBackend::GetQuotaUtil() { return this; } -SandboxMountPointProvider::OriginEnumerator* -SandboxMountPointProvider::CreateOriginEnumerator() { +SandboxFileSystemBackend::OriginEnumerator* +SandboxFileSystemBackend::CreateOriginEnumerator() { return new ObfuscatedOriginEnumerator(sandbox_sync_file_util()); } -base::FilePath SandboxMountPointProvider::GetBaseDirectoryForOriginAndType( +base::FilePath SandboxFileSystemBackend::GetBaseDirectoryForOriginAndType( const GURL& origin_url, fileapi::FileSystemType type, bool create) { base::PlatformFileError error = base::PLATFORM_FILE_OK; @@ -351,7 +351,7 @@ base::FilePath SandboxMountPointProvider::GetBaseDirectoryForOriginAndType( } base::PlatformFileError -SandboxMountPointProvider::DeleteOriginDataOnFileThread( +SandboxFileSystemBackend::DeleteOriginDataOnFileThread( FileSystemContext* file_system_context, QuotaManagerProxy* proxy, const GURL& origin_url, @@ -376,7 +376,7 @@ SandboxMountPointProvider::DeleteOriginDataOnFileThread( return base::PLATFORM_FILE_ERROR_FAILED; } -void SandboxMountPointProvider::GetOriginsForTypeOnFileThread( +void SandboxFileSystemBackend::GetOriginsForTypeOnFileThread( fileapi::FileSystemType type, std::set<GURL>* origins) { DCHECK(CanHandleType(type)); DCHECK(origins); @@ -401,7 +401,7 @@ void SandboxMountPointProvider::GetOriginsForTypeOnFileThread( } } -void SandboxMountPointProvider::GetOriginsForHostOnFileThread( +void SandboxFileSystemBackend::GetOriginsForHostOnFileThread( fileapi::FileSystemType type, const std::string& host, std::set<GURL>* origins) { DCHECK(CanHandleType(type)); @@ -415,7 +415,7 @@ void SandboxMountPointProvider::GetOriginsForHostOnFileThread( } } -int64 SandboxMountPointProvider::GetOriginUsageOnFileThread( +int64 SandboxFileSystemBackend::GetOriginUsageOnFileThread( FileSystemContext* file_system_context, const GURL& origin_url, fileapi::FileSystemType type) { @@ -458,7 +458,7 @@ int64 SandboxMountPointProvider::GetOriginUsageOnFileThread( return usage; } -void SandboxMountPointProvider::InvalidateUsageCache( +void SandboxFileSystemBackend::InvalidateUsageCache( const GURL& origin, fileapi::FileSystemType type) { DCHECK(CanHandleType(type)); @@ -470,7 +470,7 @@ void SandboxMountPointProvider::InvalidateUsageCache( file_system_usage_cache_->IncrementDirty(usage_file_path); } -void SandboxMountPointProvider::StickyInvalidateUsageCache( +void SandboxFileSystemBackend::StickyInvalidateUsageCache( const GURL& origin, fileapi::FileSystemType type) { DCHECK(CanHandleType(type)); @@ -479,7 +479,7 @@ void SandboxMountPointProvider::StickyInvalidateUsageCache( InvalidateUsageCache(origin, type); } -void SandboxMountPointProvider::CollectOpenFileSystemMetrics( +void SandboxFileSystemBackend::CollectOpenFileSystemMetrics( base::PlatformFileError error_code) { base::Time now = base::Time::Now(); bool throttled = now < next_release_time_for_open_filesystem_stat_; @@ -516,7 +516,7 @@ void SandboxMountPointProvider::CollectOpenFileSystemMetrics( #undef REPORT } -const UpdateObserverList* SandboxMountPointProvider::GetUpdateObservers( +const UpdateObserverList* SandboxFileSystemBackend::GetUpdateObservers( FileSystemType type) const { DCHECK(CanHandleType(type)); if (type == kFileSystemTypeSyncable) @@ -524,13 +524,13 @@ const UpdateObserverList* SandboxMountPointProvider::GetUpdateObservers( return &update_observers_; } -const AccessObserverList* SandboxMountPointProvider::GetAccessObservers( +const AccessObserverList* SandboxFileSystemBackend::GetAccessObservers( FileSystemType type) const { DCHECK(CanHandleType(type)); return &access_observers_; } -void SandboxMountPointProvider::AddFileUpdateObserver( +void SandboxFileSystemBackend::AddFileUpdateObserver( FileSystemType type, FileUpdateObserver* observer, base::SequencedTaskRunner* task_runner) { @@ -543,7 +543,7 @@ void SandboxMountPointProvider::AddFileUpdateObserver( *list = UpdateObserverList(observer_source); } -void SandboxMountPointProvider::AddFileChangeObserver( +void SandboxFileSystemBackend::AddFileChangeObserver( FileSystemType type, FileChangeObserver* observer, base::SequencedTaskRunner* task_runner) { @@ -555,7 +555,7 @@ void SandboxMountPointProvider::AddFileChangeObserver( *list = ChangeObserverList(observer_source); } -bool SandboxMountPointProvider::IsAccessValid( +bool SandboxFileSystemBackend::IsAccessValid( const FileSystemURL& url) const { if (!IsAllowedScheme(url.origin())) return false; @@ -590,7 +590,7 @@ bool SandboxMountPointProvider::IsAccessValid( return true; } -base::FilePath SandboxMountPointProvider::GetUsageCachePathForOriginAndType( +base::FilePath SandboxFileSystemBackend::GetUsageCachePathForOriginAndType( const GURL& origin_url, FileSystemType type) { base::PlatformFileError error; @@ -602,7 +602,7 @@ base::FilePath SandboxMountPointProvider::GetUsageCachePathForOriginAndType( } // static -base::FilePath SandboxMountPointProvider::GetUsageCachePathForOriginAndType( +base::FilePath SandboxFileSystemBackend::GetUsageCachePathForOriginAndType( ObfuscatedFileUtil* sandbox_file_util, const GURL& origin_url, fileapi::FileSystemType type, @@ -616,7 +616,7 @@ base::FilePath SandboxMountPointProvider::GetUsageCachePathForOriginAndType( return base_path.Append(FileSystemUsageCache::kUsageFileName); } -bool SandboxMountPointProvider::IsAllowedScheme(const GURL& url) const { +bool SandboxFileSystemBackend::IsAllowedScheme(const GURL& url) const { // Basically we only accept http or https. We allow file:// URLs // only if --allow-file-access-from-files flag is given. if (url.SchemeIs("http") || url.SchemeIs("https")) @@ -634,13 +634,13 @@ bool SandboxMountPointProvider::IsAllowedScheme(const GURL& url) const { return false; } -ObfuscatedFileUtil* SandboxMountPointProvider::sandbox_sync_file_util() { +ObfuscatedFileUtil* SandboxFileSystemBackend::sandbox_sync_file_util() { DCHECK(sandbox_file_util_.get()); return static_cast<ObfuscatedFileUtil*>(sandbox_file_util_->sync_file_util()); } // static -void SandboxMountPointProvider::InvalidateUsageCacheOnFileThread( +void SandboxFileSystemBackend::InvalidateUsageCacheOnFileThread( ObfuscatedFileUtil* file_util, const GURL& origin, FileSystemType type, @@ -652,7 +652,7 @@ void SandboxMountPointProvider::InvalidateUsageCacheOnFileThread( usage_cache->IncrementDirty(usage_cache_path); } -int64 SandboxMountPointProvider::RecalculateUsage(FileSystemContext* context, +int64 SandboxFileSystemBackend::RecalculateUsage(FileSystemContext* context, const GURL& origin, FileSystemType type) { FileSystemOperationContext operation_context(context); diff --git a/webkit/browser/fileapi/sandbox_mount_point_provider.h b/webkit/browser/fileapi/sandbox_file_system_backend.h index 99e91f0..2f5b4b2 100644 --- a/webkit/browser/fileapi/sandbox_mount_point_provider.h +++ b/webkit/browser/fileapi/sandbox_file_system_backend.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_FILEAPI_SANDBOX_MOUNT_POINT_PROVIDER_H_ -#define WEBKIT_BROWSER_FILEAPI_SANDBOX_MOUNT_POINT_PROVIDER_H_ +#ifndef WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ +#define WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ #include <set> #include <string> @@ -15,7 +15,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "url/gurl.h" -#include "webkit/browser/fileapi/file_system_mount_point_provider.h" +#include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_options.h" #include "webkit/browser/fileapi/file_system_quota_util.h" #include "webkit/browser/fileapi/task_runner_bound_observer_list.h" @@ -49,8 +49,8 @@ class SandboxQuotaObserver; // profile directory in a sandboxed way. // This interface also lets one enumerate and remove storage for the origins // that use the filesystem. -class WEBKIT_STORAGE_BROWSER_EXPORT SandboxMountPointProvider - : public FileSystemMountPointProvider, +class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackend + : public FileSystemBackend, public FileSystemQuotaUtil { public: // Origin enumerator interface. @@ -71,15 +71,15 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxMountPointProvider // |file_task_runner| is used to validate the root directory and delete the // obfuscated file util. - SandboxMountPointProvider( + SandboxFileSystemBackend( quota::QuotaManagerProxy* quota_manager_proxy, base::SequencedTaskRunner* file_task_runner, const base::FilePath& profile_path, const FileSystemOptions& file_system_options, quota::SpecialStoragePolicy* special_storage_policy); - virtual ~SandboxMountPointProvider(); + virtual ~SandboxFileSystemBackend(); - // FileSystemMountPointProvider overrides. + // FileSystemBackend overrides. virtual bool CanHandleType(FileSystemType type) const OVERRIDE; virtual void OpenFileSystem( const GURL& origin_url, @@ -106,7 +106,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxMountPointProvider FileSystemContext* context) const OVERRIDE; virtual FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; - // Returns an origin enumerator of this provider. + // Returns an origin enumerator of this backend. // This method can only be called on the file thread. OriginEnumerator* CreateOriginEnumerator(); @@ -168,8 +168,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxMountPointProvider private: friend class SandboxQuotaObserver; friend class SandboxFileSystemTestHelper; - friend class SandboxMountPointProviderMigrationTest; - friend class SandboxMountPointProviderOriginEnumeratorTest; + friend class SandboxFileSystemBackendMigrationTest; + friend class SandboxFileSystemBackendOriginEnumeratorTest; // Returns a path to the usage cache file. base::FilePath GetUsageCachePathForOriginAndType( @@ -239,11 +239,11 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxMountPointProvider scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; - base::WeakPtrFactory<SandboxMountPointProvider> weak_factory_; + base::WeakPtrFactory<SandboxFileSystemBackend> weak_factory_; - DISALLOW_COPY_AND_ASSIGN(SandboxMountPointProvider); + DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackend); }; } // namespace fileapi -#endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_MOUNT_POINT_PROVIDER_H_ +#endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ diff --git a/webkit/browser/fileapi/sandbox_mount_point_provider_unittest.cc b/webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc index 33fad5a..386586b 100644 --- a/webkit/browser/fileapi/sandbox_mount_point_provider_unittest.cc +++ b/webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/fileapi/sandbox_mount_point_provider.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include <set> @@ -14,7 +14,7 @@ #include "base/message_loop/message_loop_proxy.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" -#include "webkit/browser/fileapi/file_system_mount_point_provider.h" +#include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/mock_file_system_options.h" #include "webkit/common/fileapi/file_system_util.h" @@ -78,28 +78,28 @@ void DidOpenFileSystem(base::PlatformFileError* error_out, } // namespace -class SandboxMountPointProviderTest : public testing::Test { +class SandboxFileSystemBackendTest : public testing::Test { protected: virtual void SetUp() { ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); } - void SetUpNewProvider(const FileSystemOptions& options) { - provider_.reset( - new SandboxMountPointProvider(NULL, + void SetUpNewBackend(const FileSystemOptions& options) { + backend_.reset( + new SandboxFileSystemBackend(NULL, base::MessageLoopProxy::current().get(), data_dir_.path(), options, NULL)); } - SandboxMountPointProvider::OriginEnumerator* CreateOriginEnumerator() const { - return provider_->CreateOriginEnumerator(); + SandboxFileSystemBackend::OriginEnumerator* CreateOriginEnumerator() const { + return backend_->CreateOriginEnumerator(); } void CreateOriginTypeDirectory(const GURL& origin, fileapi::FileSystemType type) { - base::FilePath target = provider_-> + base::FilePath target = backend_-> GetBaseDirectoryForOriginAndType(origin, type, true); ASSERT_TRUE(!target.empty()); ASSERT_TRUE(file_util::DirectoryExists(target)); @@ -110,14 +110,14 @@ class SandboxMountPointProviderTest : public testing::Test { OpenFileSystemMode mode, base::FilePath* root_path) { base::PlatformFileError error = base::PLATFORM_FILE_OK; - provider_->OpenFileSystem( + backend_->OpenFileSystem( origin_url, type, mode, base::Bind(&DidOpenFileSystem, &error)); base::MessageLoop::current()->RunUntilIdle(); if (error != base::PLATFORM_FILE_OK) return false; base::FilePath returned_root_path = - provider_->GetBaseDirectoryForOriginAndType( + backend_->GetBaseDirectoryForOriginAndType( origin_url, type, false /* create */); if (root_path) *root_path = returned_root_path; @@ -126,23 +126,23 @@ class SandboxMountPointProviderTest : public testing::Test { base::FilePath file_system_path() const { return data_dir_.path().Append( - SandboxMountPointProvider::kFileSystemDirectory); + SandboxFileSystemBackend::kFileSystemDirectory); } base::ScopedTempDir data_dir_; base::MessageLoop message_loop_; - scoped_ptr<SandboxMountPointProvider> provider_; + scoped_ptr<SandboxFileSystemBackend> backend_; }; -TEST_F(SandboxMountPointProviderTest, Empty) { - SetUpNewProvider(CreateAllowFileAccessOptions()); - scoped_ptr<SandboxMountPointProvider::OriginEnumerator> enumerator( +TEST_F(SandboxFileSystemBackendTest, Empty) { + SetUpNewBackend(CreateAllowFileAccessOptions()); + scoped_ptr<SandboxFileSystemBackend::OriginEnumerator> enumerator( CreateOriginEnumerator()); ASSERT_TRUE(enumerator->Next().is_empty()); } -TEST_F(SandboxMountPointProviderTest, EnumerateOrigins) { - SetUpNewProvider(CreateAllowFileAccessOptions()); +TEST_F(SandboxFileSystemBackendTest, EnumerateOrigins) { + SetUpNewBackend(CreateAllowFileAccessOptions()); const char* temporary_origins[] = { "http://www.bar.com/", "http://www.foo.com/", @@ -169,7 +169,7 @@ TEST_F(SandboxMountPointProviderTest, EnumerateOrigins) { persistent_set.insert(GURL(persistent_origins[i])); } - scoped_ptr<SandboxMountPointProvider::OriginEnumerator> enumerator( + scoped_ptr<SandboxFileSystemBackend::OriginEnumerator> enumerator( CreateOriginEnumerator()); size_t temporary_actual_size = 0; size_t persistent_actual_size = 0; @@ -190,53 +190,53 @@ TEST_F(SandboxMountPointProviderTest, EnumerateOrigins) { EXPECT_EQ(persistent_size, persistent_actual_size); } -TEST_F(SandboxMountPointProviderTest, IsAccessValid) { - SetUpNewProvider(CreateAllowFileAccessOptions()); +TEST_F(SandboxFileSystemBackendTest, IsAccessValid) { + SetUpNewBackend(CreateAllowFileAccessOptions()); // Normal case. - EXPECT_TRUE(provider_->IsAccessValid(CreateFileSystemURL("a"))); + EXPECT_TRUE(backend_->IsAccessValid(CreateFileSystemURL("a"))); // Access to a path with parent references ('..') should be disallowed. - EXPECT_FALSE(provider_->IsAccessValid(CreateFileSystemURL("a/../b"))); + EXPECT_FALSE(backend_->IsAccessValid(CreateFileSystemURL("a/../b"))); // Access from non-allowed scheme should be disallowed. - EXPECT_FALSE(provider_->IsAccessValid( + EXPECT_FALSE(backend_->IsAccessValid( FileSystemURL::CreateForTest( GURL("unknown://bar"), kFileSystemTypeTemporary, base::FilePath::FromUTF8Unsafe("foo")))); // Access for non-sandbox type should be disallowed. - EXPECT_FALSE(provider_->IsAccessValid( + EXPECT_FALSE(backend_->IsAccessValid( FileSystemURL::CreateForTest( GURL("http://foo/"), kFileSystemTypeTest, base::FilePath::FromUTF8Unsafe("foo")))); // Access with restricted name should be disallowed. - EXPECT_FALSE(provider_->IsAccessValid(CreateFileSystemURL("."))); - EXPECT_FALSE(provider_->IsAccessValid(CreateFileSystemURL(".."))); + EXPECT_FALSE(backend_->IsAccessValid(CreateFileSystemURL("."))); + EXPECT_FALSE(backend_->IsAccessValid(CreateFileSystemURL(".."))); // This is also diallowed due to Windows XP parent path handling. - EXPECT_FALSE(provider_->IsAccessValid(CreateFileSystemURL("..."))); + EXPECT_FALSE(backend_->IsAccessValid(CreateFileSystemURL("..."))); // These are identified as unsafe cases due to weird path handling // on Windows. - EXPECT_FALSE(provider_->IsAccessValid(CreateFileSystemURL(" .."))); - EXPECT_FALSE(provider_->IsAccessValid(CreateFileSystemURL(".. "))); + EXPECT_FALSE(backend_->IsAccessValid(CreateFileSystemURL(" .."))); + EXPECT_FALSE(backend_->IsAccessValid(CreateFileSystemURL(".. "))); // Similar but safe cases. - EXPECT_TRUE(provider_->IsAccessValid(CreateFileSystemURL(" ."))); - EXPECT_TRUE(provider_->IsAccessValid(CreateFileSystemURL(". "))); - EXPECT_TRUE(provider_->IsAccessValid(CreateFileSystemURL("b."))); - EXPECT_TRUE(provider_->IsAccessValid(CreateFileSystemURL(".b"))); + EXPECT_TRUE(backend_->IsAccessValid(CreateFileSystemURL(" ."))); + EXPECT_TRUE(backend_->IsAccessValid(CreateFileSystemURL(". "))); + EXPECT_TRUE(backend_->IsAccessValid(CreateFileSystemURL("b."))); + EXPECT_TRUE(backend_->IsAccessValid(CreateFileSystemURL(".b"))); // A path that looks like a drive letter. - EXPECT_TRUE(provider_->IsAccessValid(CreateFileSystemURL("c:"))); + EXPECT_TRUE(backend_->IsAccessValid(CreateFileSystemURL("c:"))); } -TEST_F(SandboxMountPointProviderTest, GetRootPathCreateAndExamine) { +TEST_F(SandboxFileSystemBackendTest, GetRootPathCreateAndExamine) { std::vector<base::FilePath> returned_root_path( ARRAYSIZE_UNSAFE(kRootPathTestCases)); - SetUpNewProvider(CreateAllowFileAccessOptions()); + SetUpNewBackend(CreateAllowFileAccessOptions()); // Create a new root directory. for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kRootPathTestCases); ++i) { @@ -273,11 +273,11 @@ TEST_F(SandboxMountPointProviderTest, GetRootPathCreateAndExamine) { } } -TEST_F(SandboxMountPointProviderTest, - GetRootPathCreateAndExamineWithNewProvider) { +TEST_F(SandboxFileSystemBackendTest, + GetRootPathCreateAndExamineWithNewBackend) { std::vector<base::FilePath> returned_root_path( ARRAYSIZE_UNSAFE(kRootPathTestCases)); - SetUpNewProvider(CreateAllowFileAccessOptions()); + SetUpNewBackend(CreateAllowFileAccessOptions()); GURL origin_url("http://foo.com:1/"); @@ -286,7 +286,7 @@ TEST_F(SandboxMountPointProviderTest, OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, &root_path1)); - SetUpNewProvider(CreateDisallowFileAccessOptions()); + SetUpNewBackend(CreateDisallowFileAccessOptions()); base::FilePath root_path2; EXPECT_TRUE(GetRootPath(origin_url, kFileSystemTypeTemporary, OPEN_FILE_SYSTEM_FAIL_IF_NONEXISTENT, @@ -295,8 +295,8 @@ TEST_F(SandboxMountPointProviderTest, EXPECT_EQ(root_path1.value(), root_path2.value()); } -TEST_F(SandboxMountPointProviderTest, GetRootPathGetWithoutCreate) { - SetUpNewProvider(CreateDisallowFileAccessOptions()); +TEST_F(SandboxFileSystemBackendTest, GetRootPathGetWithoutCreate) { + SetUpNewBackend(CreateDisallowFileAccessOptions()); // Try to get a root directory without creating. for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kRootPathTestCases); ++i) { @@ -309,8 +309,8 @@ TEST_F(SandboxMountPointProviderTest, GetRootPathGetWithoutCreate) { } } -TEST_F(SandboxMountPointProviderTest, GetRootPathInIncognito) { - SetUpNewProvider(CreateIncognitoFileSystemOptions()); +TEST_F(SandboxFileSystemBackendTest, GetRootPathInIncognito) { + SetUpNewBackend(CreateIncognitoFileSystemOptions()); // Try to get a root directory. for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kRootPathTestCases); ++i) { @@ -324,8 +324,8 @@ TEST_F(SandboxMountPointProviderTest, GetRootPathInIncognito) { } } -TEST_F(SandboxMountPointProviderTest, GetRootPathFileURI) { - SetUpNewProvider(CreateDisallowFileAccessOptions()); +TEST_F(SandboxFileSystemBackendTest, GetRootPathFileURI) { + SetUpNewBackend(CreateDisallowFileAccessOptions()); for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kRootPathFileURITestCases); ++i) { SCOPED_TRACE(testing::Message() << "RootPathFileURI (disallow) #" << i << " " << kRootPathFileURITestCases[i].expected_path); @@ -337,8 +337,8 @@ TEST_F(SandboxMountPointProviderTest, GetRootPathFileURI) { } } -TEST_F(SandboxMountPointProviderTest, GetRootPathFileURIWithAllowFlag) { - SetUpNewProvider(CreateAllowFileAccessOptions()); +TEST_F(SandboxFileSystemBackendTest, GetRootPathFileURIWithAllowFlag) { + SetUpNewBackend(CreateAllowFileAccessOptions()); for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kRootPathFileURITestCases); ++i) { SCOPED_TRACE(testing::Message() << "RootPathFileURI (allow) #" << i << " " << kRootPathFileURITestCases[i].expected_path); diff --git a/webkit/browser/fileapi/sandbox_file_system_test_helper.cc b/webkit/browser/fileapi/sandbox_file_system_test_helper.cc index 7cefa1a..84aa9de 100644 --- a/webkit/browser/fileapi/sandbox_file_system_test_helper.cc +++ b/webkit/browser/fileapi/sandbox_file_system_test_helper.cc @@ -16,7 +16,7 @@ #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/file_system_usage_cache.h" #include "webkit/browser/fileapi/mock_file_system_context.h" -#include "webkit/browser/fileapi/sandbox_mount_point_provider.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include "webkit/browser/quota/mock_special_storage_policy.h" #include "webkit/common/fileapi/file_system_util.h" @@ -62,7 +62,7 @@ void SandboxFileSystemTestHelper::TearDown() { } base::FilePath SandboxFileSystemTestHelper::GetOriginRootPath() { - return file_system_context_->sandbox_provider()-> + return file_system_context_->sandbox_backend()-> GetBaseDirectoryForOriginAndType(origin_, type_, false); } @@ -82,7 +82,7 @@ base::FilePath SandboxFileSystemTestHelper::GetLocalPathFromASCII( base::FilePath SandboxFileSystemTestHelper::GetUsageCachePath() const { return file_system_context_-> - sandbox_provider()->GetUsageCachePathForOriginAndType(origin_, type_); + sandbox_backend()->GetUsageCachePathForOriginAndType(origin_, type_); } FileSystemURL SandboxFileSystemTestHelper::CreateURL( @@ -125,23 +125,23 @@ SandboxFileSystemTestHelper::NewOperationContext() { void SandboxFileSystemTestHelper::AddFileChangeObserver( FileChangeObserver* observer) { - file_system_context_->sandbox_provider()-> + file_system_context_->sandbox_backend()-> AddFileChangeObserver(type_, observer, NULL); } FileSystemUsageCache* SandboxFileSystemTestHelper::usage_cache() { - return file_system_context()->sandbox_provider()->usage_cache(); + return file_system_context()->sandbox_backend()->usage_cache(); } void SandboxFileSystemTestHelper::SetUpFileSystem() { DCHECK(file_system_context_.get()); - DCHECK(file_system_context_->sandbox_provider()->CanHandleType(type_)); + DCHECK(file_system_context_->sandbox_backend()->CanHandleType(type_)); file_util_ = file_system_context_->GetFileUtil(type_); DCHECK(file_util_); // Prepare the origin's root directory. - file_system_context_->sandbox_provider()-> + file_system_context_->sandbox_backend()-> GetBaseDirectoryForOriginAndType(origin_, type_, true /* create */); // Initialize the usage cache file. diff --git a/webkit/browser/fileapi/sandbox_quota_observer.cc b/webkit/browser/fileapi/sandbox_quota_observer.cc index a061e3e..b28f335 100644 --- a/webkit/browser/fileapi/sandbox_quota_observer.cc +++ b/webkit/browser/fileapi/sandbox_quota_observer.cc @@ -7,7 +7,7 @@ #include "base/sequenced_task_runner.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/file_system_usage_cache.h" -#include "webkit/browser/fileapi/sandbox_mount_point_provider.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include "webkit/browser/fileapi/timed_task_helper.h" #include "webkit/browser/quota/quota_client.h" #include "webkit/browser/quota/quota_manager.h" @@ -107,7 +107,7 @@ base::FilePath SandboxQuotaObserver::GetUsageCachePath( DCHECK(sandbox_file_util_); base::PlatformFileError error = base::PLATFORM_FILE_OK; base::FilePath path = - SandboxMountPointProvider::GetUsageCachePathForOriginAndType( + SandboxFileSystemBackend::GetUsageCachePathForOriginAndType( sandbox_file_util_, url.origin(), url.type(), &error); if (error != base::PLATFORM_FILE_OK) { LOG(WARNING) << "Could not get usage cache path for: " diff --git a/webkit/browser/fileapi/syncable/canned_syncable_file_system.cc b/webkit/browser/fileapi/syncable/canned_syncable_file_system.cc index 8bad8f3..37c5efc 100644 --- a/webkit/browser/fileapi/syncable/canned_syncable_file_system.cc +++ b/webkit/browser/fileapi/syncable/canned_syncable_file_system.cc @@ -16,13 +16,13 @@ #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/blob/mock_blob_url_request_context.h" #include "webkit/browser/fileapi/external_mount_points.h" +#include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/browser/fileapi/file_system_mount_point_provider.h" #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_operation_runner.h" #include "webkit/browser/fileapi/file_system_task_runners.h" #include "webkit/browser/fileapi/mock_file_system_options.h" -#include "webkit/browser/fileapi/sandbox_mount_point_provider.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include "webkit/browser/fileapi/syncable/local_file_change_tracker.h" #include "webkit/browser/fileapi/syncable/local_file_sync_context.h" #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h" @@ -239,7 +239,7 @@ void CannedSyncableFileSystem::SetUp() { fileapi::ExternalMountPoints::CreateRefCounted().get(), storage_policy.get(), quota_manager_->proxy(), - ScopedVector<fileapi::FileSystemMountPointProvider>(), + ScopedVector<fileapi::FileSystemBackend>(), data_dir_.path(), options); is_filesystem_set_up_ = true; diff --git a/webkit/browser/fileapi/syncable/syncable_file_system_operation.cc b/webkit/browser/fileapi/syncable/syncable_file_system_operation.cc index b256813..6773809 100644 --- a/webkit/browser/fileapi/syncable/syncable_file_system_operation.cc +++ b/webkit/browser/fileapi/syncable/syncable_file_system_operation.cc @@ -10,7 +10,7 @@ #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/local_file_system_operation.h" -#include "webkit/browser/fileapi/sandbox_mount_point_provider.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include "webkit/browser/fileapi/syncable/local_file_sync_context.h" #include "webkit/browser/fileapi/syncable/syncable_file_operation_runner.h" #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h" diff --git a/webkit/browser/fileapi/syncable/syncable_file_system_operation.h b/webkit/browser/fileapi/syncable/syncable_file_system_operation.h index 821dbfa..e8e5c65 100644 --- a/webkit/browser/fileapi/syncable/syncable_file_system_operation.h +++ b/webkit/browser/fileapi/syncable/syncable_file_system_operation.h @@ -18,7 +18,7 @@ namespace fileapi { class FileSystemContext; class FileSystemOperationContext; -class SandboxMountPointProvider; +class SandboxFileSystemBackend; } namespace sync_file_system { @@ -87,9 +87,9 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SyncableFileSystemOperation typedef SyncableFileSystemOperation self; class QueueableTask; - // Only MountPointProviders can create a new operation directly. - friend class fileapi::SandboxMountPointProvider; - friend class SandboxMountPointProvider; + // Only FileSystemBackends can create a new operation directly. + friend class fileapi::SandboxFileSystemBackend; + friend class SandboxFileSystemBackend; SyncableFileSystemOperation( const fileapi::FileSystemURL& url, fileapi::FileSystemContext* file_system_context, diff --git a/webkit/browser/fileapi/syncable/syncable_file_system_util.cc b/webkit/browser/fileapi/syncable/syncable_file_system_util.cc index a703dbd..5aadca5 100644 --- a/webkit/browser/fileapi/syncable/syncable_file_system_util.cc +++ b/webkit/browser/fileapi/syncable/syncable_file_system_util.cc @@ -8,7 +8,7 @@ #include "webkit/browser/fileapi/external_mount_points.h" #include "webkit/browser/fileapi/file_observers.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/browser/fileapi/sandbox_mount_point_provider.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include "webkit/common/fileapi/file_system_util.h" using fileapi::ExternalMountPoints; diff --git a/webkit/browser/fileapi/test_mount_point_provider.cc b/webkit/browser/fileapi/test_file_system_backend.cc index 20a1a4a..ff7ebff 100644 --- a/webkit/browser/fileapi/test_mount_point_provider.cc +++ b/webkit/browser/fileapi/test_file_system_backend.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/fileapi/test_mount_point_provider.h" +#include "webkit/browser/fileapi/test_file_system_backend.h" #include <set> #include <string> @@ -25,7 +25,7 @@ namespace fileapi { // This only supports single origin. -class TestMountPointProvider::QuotaUtil +class TestFileSystemBackend::QuotaUtil : public FileSystemQuotaUtil, public FileUpdateObserver { public: @@ -79,7 +79,7 @@ class TestMountPointProvider::QuotaUtil int64 usage_; }; -TestMountPointProvider::TestMountPointProvider( +TestFileSystemBackend::TestFileSystemBackend( base::SequencedTaskRunner* task_runner, const base::FilePath& base_path) : base_path_(base_path), @@ -92,14 +92,14 @@ TestMountPointProvider::TestMountPointProvider( update_observers_ = UpdateObserverList(source); } -TestMountPointProvider::~TestMountPointProvider() { +TestFileSystemBackend::~TestFileSystemBackend() { } -bool TestMountPointProvider::CanHandleType(FileSystemType type) const { +bool TestFileSystemBackend::CanHandleType(FileSystemType type) const { return (type == kFileSystemTypeTest); } -void TestMountPointProvider::OpenFileSystem( +void TestFileSystemBackend::OpenFileSystem( const GURL& origin_url, FileSystemType type, OpenFileSystemMode mode, @@ -107,17 +107,17 @@ void TestMountPointProvider::OpenFileSystem( callback.Run(base::PLATFORM_FILE_OK); } -FileSystemFileUtil* TestMountPointProvider::GetFileUtil(FileSystemType type) { +FileSystemFileUtil* TestFileSystemBackend::GetFileUtil(FileSystemType type) { DCHECK(local_file_util_.get()); return local_file_util_->sync_file_util(); } -AsyncFileUtil* TestMountPointProvider::GetAsyncFileUtil(FileSystemType type) { +AsyncFileUtil* TestFileSystemBackend::GetAsyncFileUtil(FileSystemType type) { return local_file_util_.get(); } CopyOrMoveFileValidatorFactory* -TestMountPointProvider::GetCopyOrMoveFileValidatorFactory( +TestFileSystemBackend::GetCopyOrMoveFileValidatorFactory( FileSystemType type, base::PlatformFileError* error_code) { DCHECK(error_code); *error_code = base::PLATFORM_FILE_OK; @@ -129,7 +129,7 @@ TestMountPointProvider::GetCopyOrMoveFileValidatorFactory( return NULL; } -void TestMountPointProvider::InitializeCopyOrMoveFileValidatorFactory( +void TestFileSystemBackend::InitializeCopyOrMoveFileValidatorFactory( scoped_ptr<CopyOrMoveFileValidatorFactory> factory) { if (!require_copy_or_move_validator_) { DCHECK(!factory); @@ -139,7 +139,7 @@ void TestMountPointProvider::InitializeCopyOrMoveFileValidatorFactory( copy_or_move_file_validator_factory_ = factory.Pass(); } -FileSystemOperation* TestMountPointProvider::CreateFileSystemOperation( +FileSystemOperation* TestFileSystemBackend::CreateFileSystemOperation( const FileSystemURL& url, FileSystemContext* context, base::PlatformFileError* error_code) const { @@ -152,7 +152,7 @@ FileSystemOperation* TestMountPointProvider::CreateFileSystemOperation( } scoped_ptr<webkit_blob::FileStreamReader> -TestMountPointProvider::CreateFileStreamReader( +TestFileSystemBackend::CreateFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, @@ -163,7 +163,7 @@ TestMountPointProvider::CreateFileStreamReader( } scoped_ptr<fileapi::FileStreamWriter> -TestMountPointProvider::CreateFileStreamWriter( +TestFileSystemBackend::CreateFileStreamWriter( const FileSystemURL& url, int64 offset, FileSystemContext* context) const { @@ -171,16 +171,16 @@ TestMountPointProvider::CreateFileStreamWriter( new SandboxFileStreamWriter(context, url, offset, update_observers_)); } -FileSystemQuotaUtil* TestMountPointProvider::GetQuotaUtil() { +FileSystemQuotaUtil* TestFileSystemBackend::GetQuotaUtil() { return quota_util_.get(); } -const UpdateObserverList* TestMountPointProvider::GetUpdateObservers( +const UpdateObserverList* TestFileSystemBackend::GetUpdateObservers( FileSystemType type) const { return &update_observers_; } -void TestMountPointProvider::AddFileChangeObserver( +void TestFileSystemBackend::AddFileChangeObserver( FileChangeObserver* observer) { ChangeObserverList::Source source = change_observers_.source(); source.AddObserver(observer, task_runner_.get()); diff --git a/webkit/browser/fileapi/test_mount_point_provider.h b/webkit/browser/fileapi/test_file_system_backend.h index 0bb139b..68a23b6 100644 --- a/webkit/browser/fileapi/test_mount_point_provider.h +++ b/webkit/browser/fileapi/test_file_system_backend.h @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_FILEAPI_TEST_MOUNT_POINT_PROVIDER_H_ -#define WEBKIT_BROWSER_FILEAPI_TEST_MOUNT_POINT_PROVIDER_H_ +#ifndef WEBKIT_BROWSER_FILEAPI_TEST_FILE_SYSTEM_BACKEND_H_ +#define WEBKIT_BROWSER_FILEAPI_TEST_FILE_SYSTEM_BACKEND_H_ #include "base/files/file_path.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "webkit/browser/fileapi/async_file_util_adapter.h" -#include "webkit/browser/fileapi/file_system_mount_point_provider.h" +#include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/task_runner_bound_observer_list.h" #include "webkit/browser/webkit_storage_browser_export.h" @@ -23,17 +23,17 @@ class AsyncFileUtilAdapter; class FileSystemQuotaUtil; // This should be only used for testing. -// This mount point provider uses LocalFileUtil and stores data file +// This file system backend uses LocalFileUtil and stores data file // under the given directory. -class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE TestMountPointProvider - : public FileSystemMountPointProvider { +class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE TestFileSystemBackend + : public FileSystemBackend { public: - TestMountPointProvider( + TestFileSystemBackend( base::SequencedTaskRunner* task_runner, const base::FilePath& base_path); - virtual ~TestMountPointProvider(); + virtual ~TestFileSystemBackend(); - // FileSystemMountPointProvider implementation. + // FileSystemBackend implementation. virtual bool CanHandleType(FileSystemType type) const OVERRIDE; virtual void OpenFileSystem( const GURL& origin_url, @@ -89,9 +89,9 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE TestMountPointProvider scoped_ptr<CopyOrMoveFileValidatorFactory> copy_or_move_file_validator_factory_; - DISALLOW_COPY_AND_ASSIGN(TestMountPointProvider); + DISALLOW_COPY_AND_ASSIGN(TestFileSystemBackend); }; } // namespace fileapi -#endif // WEBKIT_BROWSER_FILEAPI_TEST_MOUNT_POINT_PROVIDER_H_ +#endif // WEBKIT_BROWSER_FILEAPI_TEST_FILE_SYSTEM_BACKEND_H_ diff --git a/webkit/browser/fileapi/upload_file_system_file_element_reader_unittest.cc b/webkit/browser/fileapi/upload_file_system_file_element_reader_unittest.cc index ad6fdc6..537973d 100644 --- a/webkit/browser/fileapi/upload_file_system_file_element_reader_unittest.cc +++ b/webkit/browser/fileapi/upload_file_system_file_element_reader_unittest.cc @@ -9,9 +9,9 @@ #include "net/base/io_buffer.h" #include "net/base/test_completion_callback.h" #include "testing/gtest/include/gtest/gtest.h" +#include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_file_util.h" -#include "webkit/browser/fileapi/file_system_mount_point_provider.h" #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/mock_file_system_context.h" |