| Index: chrome/browser/chromeos/fileapi/file_system_backend.cc
|
| diff --git a/chrome/browser/chromeos/fileapi/cros_mount_point_provider.cc b/chrome/browser/chromeos/fileapi/file_system_backend.cc
|
| similarity index 89%
|
| rename from chrome/browser/chromeos/fileapi/cros_mount_point_provider.cc
|
| rename to chrome/browser/chromeos/fileapi/file_system_backend.cc
|
| index 82da08320e5721fa0bfce493090ee54ef904b248..a0a8d4cfdd3d59ce3f0083185fbf54663e6053b5 100644
|
| --- a/chrome/browser/chromeos/fileapi/cros_mount_point_provider.cc
|
| +++ b/chrome/browser/chromeos/fileapi/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 "chrome/browser/chromeos/fileapi/cros_mount_point_provider.h"
|
| +#include "chrome/browser/chromeos/fileapi/file_system_backend.h"
|
|
|
| #include "base/logging.h"
|
| #include "base/memory/scoped_ptr.h"
|
| @@ -37,7 +37,7 @@ const char kChromeUIScheme[] = "chrome";
|
| namespace chromeos {
|
|
|
| // static
|
| -bool CrosMountPointProvider::CanHandleURL(const fileapi::FileSystemURL& url) {
|
| +bool FileSystemBackend::CanHandleURL(const fileapi::FileSystemURL& url) {
|
| if (!url.is_valid())
|
| return false;
|
| return url.type() == fileapi::kFileSystemTypeNativeLocal ||
|
| @@ -45,7 +45,7 @@ bool CrosMountPointProvider::CanHandleURL(const fileapi::FileSystemURL& url) {
|
| url.type() == fileapi::kFileSystemTypeDrive;
|
| }
|
|
|
| -CrosMountPointProvider::CrosMountPointProvider(
|
| +FileSystemBackend::FileSystemBackend(
|
| scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy,
|
| scoped_refptr<fileapi::ExternalMountPoints> mount_points,
|
| fileapi::ExternalMountPoints* system_mount_points)
|
| @@ -57,10 +57,10 @@ CrosMountPointProvider::CrosMountPointProvider(
|
| system_mount_points_(system_mount_points) {
|
| }
|
|
|
| -CrosMountPointProvider::~CrosMountPointProvider() {
|
| +FileSystemBackend::~FileSystemBackend() {
|
| }
|
|
|
| -void CrosMountPointProvider::AddSystemMountPoints() {
|
| +void FileSystemBackend::AddSystemMountPoints() {
|
| // RegisterFileSystem() is no-op if the mount point with the same name
|
| // already exists, hence it's safe to call without checking if a mount
|
| // point already exists or not.
|
| @@ -91,7 +91,7 @@ void CrosMountPointProvider::AddSystemMountPoints() {
|
| base::FilePath(FILE_PATH_LITERAL("/usr/share/oem")));
|
| }
|
|
|
| -bool CrosMountPointProvider::CanHandleType(fileapi::FileSystemType type) const {
|
| +bool FileSystemBackend::CanHandleType(fileapi::FileSystemType type) const {
|
| switch (type) {
|
| case fileapi::kFileSystemTypeExternal:
|
| case fileapi::kFileSystemTypeDrive:
|
| @@ -104,7 +104,7 @@ bool CrosMountPointProvider::CanHandleType(fileapi::FileSystemType type) const {
|
| }
|
| }
|
|
|
| -void CrosMountPointProvider::OpenFileSystem(
|
| +void FileSystemBackend::OpenFileSystem(
|
| const GURL& origin_url,
|
| fileapi::FileSystemType type,
|
| fileapi::OpenFileSystemMode mode,
|
| @@ -114,12 +114,12 @@ void CrosMountPointProvider::OpenFileSystem(
|
| callback.Run(base::PLATFORM_FILE_OK);
|
| }
|
|
|
| -fileapi::FileSystemQuotaUtil* CrosMountPointProvider::GetQuotaUtil() {
|
| +fileapi::FileSystemQuotaUtil* FileSystemBackend::GetQuotaUtil() {
|
| // No quota support.
|
| return NULL;
|
| }
|
|
|
| -void CrosMountPointProvider::DeleteFileSystem(
|
| +void FileSystemBackend::DeleteFileSystem(
|
| const GURL& origin_url,
|
| fileapi::FileSystemType type,
|
| fileapi::FileSystemContext* context,
|
| @@ -128,7 +128,7 @@ void CrosMountPointProvider::DeleteFileSystem(
|
| callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION);
|
| }
|
|
|
| -bool CrosMountPointProvider::IsAccessAllowed(
|
| +bool FileSystemBackend::IsAccessAllowed(
|
| const fileapi::FileSystemURL& url) const {
|
| if (!url.is_valid())
|
| return false;
|
| @@ -154,7 +154,7 @@ bool CrosMountPointProvider::IsAccessAllowed(
|
| url.virtual_path());
|
| }
|
|
|
| -void CrosMountPointProvider::GrantFullAccessToExtension(
|
| +void FileSystemBackend::GrantFullAccessToExtension(
|
| const std::string& extension_id) {
|
| DCHECK(special_storage_policy_->IsFileHandler(extension_id));
|
| if (!special_storage_policy_->IsFileHandler(extension_id))
|
| @@ -171,7 +171,7 @@ void CrosMountPointProvider::GrantFullAccessToExtension(
|
| }
|
| }
|
|
|
| -void CrosMountPointProvider::GrantFileAccessToExtension(
|
| +void FileSystemBackend::GrantFileAccessToExtension(
|
| const std::string& extension_id, const base::FilePath& virtual_path) {
|
| // All we care about here is access from extensions for now.
|
| DCHECK(special_storage_policy_->IsFileHandler(extension_id));
|
| @@ -195,12 +195,12 @@ void CrosMountPointProvider::GrantFileAccessToExtension(
|
| file_access_permissions_->GrantAccessPermission(extension_id, virtual_path);
|
| }
|
|
|
| -void CrosMountPointProvider::RevokeAccessForExtension(
|
| +void FileSystemBackend::RevokeAccessForExtension(
|
| const std::string& extension_id) {
|
| file_access_permissions_->RevokePermissions(extension_id);
|
| }
|
|
|
| -std::vector<base::FilePath> CrosMountPointProvider::GetRootDirectories() const {
|
| +std::vector<base::FilePath> FileSystemBackend::GetRootDirectories() const {
|
| std::vector<fileapi::MountPoints::MountPointInfo> mount_points;
|
| mount_points_->AddMountPointInfosTo(&mount_points);
|
| system_mount_points_->AddMountPointInfosTo(&mount_points);
|
| @@ -211,14 +211,14 @@ std::vector<base::FilePath> CrosMountPointProvider::GetRootDirectories() const {
|
| return root_dirs;
|
| }
|
|
|
| -fileapi::FileSystemFileUtil* CrosMountPointProvider::GetFileUtil(
|
| +fileapi::FileSystemFileUtil* FileSystemBackend::GetFileUtil(
|
| fileapi::FileSystemType type) {
|
| DCHECK(type == fileapi::kFileSystemTypeNativeLocal ||
|
| type == fileapi::kFileSystemTypeRestrictedNativeLocal);
|
| return local_file_util_->sync_file_util();
|
| }
|
|
|
| -fileapi::AsyncFileUtil* CrosMountPointProvider::GetAsyncFileUtil(
|
| +fileapi::AsyncFileUtil* FileSystemBackend::GetAsyncFileUtil(
|
| fileapi::FileSystemType type) {
|
| DCHECK(type == fileapi::kFileSystemTypeNativeLocal ||
|
| type == fileapi::kFileSystemTypeRestrictedNativeLocal);
|
| @@ -226,14 +226,14 @@ fileapi::AsyncFileUtil* CrosMountPointProvider::GetAsyncFileUtil(
|
| }
|
|
|
| fileapi::CopyOrMoveFileValidatorFactory*
|
| -CrosMountPointProvider::GetCopyOrMoveFileValidatorFactory(
|
| +FileSystemBackend::GetCopyOrMoveFileValidatorFactory(
|
| fileapi::FileSystemType type, base::PlatformFileError* error_code) {
|
| DCHECK(error_code);
|
| *error_code = base::PLATFORM_FILE_OK;
|
| return NULL;
|
| }
|
|
|
| -fileapi::FileSystemOperation* CrosMountPointProvider::CreateFileSystemOperation(
|
| +fileapi::FileSystemOperation* FileSystemBackend::CreateFileSystemOperation(
|
| const fileapi::FileSystemURL& url,
|
| fileapi::FileSystemContext* context,
|
| base::PlatformFileError* error_code) const {
|
| @@ -264,7 +264,7 @@ fileapi::FileSystemOperation* CrosMountPointProvider::CreateFileSystemOperation(
|
| }
|
|
|
| scoped_ptr<webkit_blob::FileStreamReader>
|
| -CrosMountPointProvider::CreateFileStreamReader(
|
| +FileSystemBackend::CreateFileStreamReader(
|
| const fileapi::FileSystemURL& url,
|
| int64 offset,
|
| const base::Time& expected_modification_time,
|
| @@ -290,7 +290,7 @@ CrosMountPointProvider::CreateFileStreamReader(
|
| }
|
|
|
| scoped_ptr<fileapi::FileStreamWriter>
|
| -CrosMountPointProvider::CreateFileStreamWriter(
|
| +FileSystemBackend::CreateFileStreamWriter(
|
| const fileapi::FileSystemURL& url,
|
| int64 offset,
|
| fileapi::FileSystemContext* context) const {
|
| @@ -319,14 +319,14 @@ CrosMountPointProvider::CreateFileStreamWriter(
|
| context->task_runners()->file_task_runner(), url.path(), offset));
|
| }
|
|
|
| -bool CrosMountPointProvider::GetVirtualPath(
|
| +bool FileSystemBackend::GetVirtualPath(
|
| const base::FilePath& filesystem_path,
|
| base::FilePath* virtual_path) {
|
| return mount_points_->GetVirtualPath(filesystem_path, virtual_path) ||
|
| system_mount_points_->GetVirtualPath(filesystem_path, virtual_path);
|
| }
|
|
|
| -fileapi::RemoteFileSystemProxyInterface* CrosMountPointProvider::GetRemoteProxy(
|
| +fileapi::RemoteFileSystemProxyInterface* FileSystemBackend::GetRemoteProxy(
|
| const std::string& mount_name) const {
|
| fileapi::RemoteFileSystemProxyInterface* proxy =
|
| mount_points_->GetRemoteFileSystemProxy(mount_name);
|
| @@ -335,7 +335,7 @@ fileapi::RemoteFileSystemProxyInterface* CrosMountPointProvider::GetRemoteProxy(
|
| return system_mount_points_->GetRemoteFileSystemProxy(mount_name);
|
| }
|
|
|
| -base::FilePath CrosMountPointProvider::GetFileSystemRootPath(
|
| +base::FilePath FileSystemBackend::GetFileSystemRootPath(
|
| const fileapi::FileSystemURL& url) const {
|
| DCHECK(fileapi::IsolatedContext::IsIsolatedType(url.mount_type()));
|
| if (!url.is_valid())
|
|
|