summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorhidehiko@chromium.org <hidehiko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-01 15:00:10 +0000
committerhidehiko@chromium.org <hidehiko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-01 15:00:10 +0000
commit61b48e0b43489dd7cad06b2f2bc5e056089a1c75 (patch)
tree02fe03da717ed1c646f6cbcd27df32bc74a7af8b /webkit
parent2df5a7b9b6344f33b8f0ab672c8b780be0d52b64 (diff)
downloadchromium_src-61b48e0b43489dd7cad06b2f2bc5e056089a1c75.zip
chromium_src-61b48e0b43489dd7cad06b2f2bc5e056089a1c75.tar.gz
chromium_src-61b48e0b43489dd7cad06b2f2bc5e056089a1c75.tar.bz2
Rename fileapi::LocalFileSystemOperation to FileSystemOperationImpl.
Drive File System starts to use LocalFileSystemOperation, so it is no longer "local". As it is the default implementation of FileSystemOperation, this CL renames it to FileSystemOperationImpl BUG=261477 TEST=Ran unit_tests Review URL: https://chromiumcodereview.appspot.com/21370003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215033 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/browser/fileapi/async_file_util.h32
-rw-r--r--webkit/browser/fileapi/file_system_operation.h6
-rw-r--r--webkit/browser/fileapi/file_system_operation_impl.cc (renamed from webkit/browser/fileapi/local_file_system_operation.cc)191
-rw-r--r--webkit/browser/fileapi/file_system_operation_impl.h (renamed from webkit/browser/fileapi/local_file_system_operation.h)22
-rw-r--r--webkit/browser/fileapi/file_system_operation_impl_unittest.cc (renamed from webkit/browser/fileapi/local_file_system_operation_unittest.cc)120
-rw-r--r--webkit/browser/fileapi/file_system_operation_impl_write_unittest.cc (renamed from webkit/browser/fileapi/local_file_system_operation_write_unittest.cc)30
-rw-r--r--webkit/browser/fileapi/file_system_operation_runner.cc30
-rw-r--r--webkit/browser/fileapi/file_system_operation_runner.h10
-rw-r--r--webkit/browser/fileapi/file_writer_delegate_unittest.cc1
-rw-r--r--webkit/browser/fileapi/isolated_file_system_backend.cc4
-rw-r--r--webkit/browser/fileapi/isolated_file_util_unittest.cc1
-rw-r--r--webkit/browser/fileapi/sandbox_file_system_backend.cc5
-rw-r--r--webkit/browser/fileapi/sandbox_file_system_test_helper.h1
-rw-r--r--webkit/browser/fileapi/syncable/local_file_sync_context.cc1
-rw-r--r--webkit/browser/fileapi/syncable/syncable_file_operation_runner_unittest.cc2
-rw-r--r--webkit/browser/fileapi/syncable/syncable_file_system_operation.cc14
-rw-r--r--webkit/browser/fileapi/syncable/syncable_file_system_operation.h12
-rw-r--r--webkit/browser/fileapi/syncable/syncable_file_system_unittest.cc1
-rw-r--r--webkit/browser/fileapi/syncable/syncable_file_system_util.cc1
-rw-r--r--webkit/browser/fileapi/syncable/syncable_file_system_util.h1
-rw-r--r--webkit/browser/fileapi/test_file_system_backend.cc4
-rw-r--r--webkit/storage_browser.gyp4
22 files changed, 243 insertions, 250 deletions
diff --git a/webkit/browser/fileapi/async_file_util.h b/webkit/browser/fileapi/async_file_util.h
index def2d2d..dc8216e 100644
--- a/webkit/browser/fileapi/async_file_util.h
+++ b/webkit/browser/fileapi/async_file_util.h
@@ -27,9 +27,9 @@ class FileSystemOperationContext;
class FileSystemURL;
// An interface which provides filesystem-specific file operations for
-// LocalFileSystemOperation.
+// FileSystemOperationImpl.
//
-// Each filesystem which needs to be dispatched from LocalFileSystemOperation
+// Each filesystem which needs to be dispatched from FileSystemOperationImpl
// must implement this interface or a synchronous version of interface:
// FileSystemFileUtil.
//
@@ -84,7 +84,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil {
// a new file at the given |url| and calls back with
// PLATFORM_FILE_ERROR_FILE_EXISTS if the |url| already exists.
//
- // LocalFileSystemOperation::OpenFile calls this.
+ // FileSystemOperationImpl::OpenFile calls this.
// This is used only by Pepper/NaCL File API.
//
virtual void CreateOrOpen(
@@ -96,7 +96,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil {
// Ensures that the given |url| exist. This creates a empty new file
// at |url| if the |url| does not exist.
//
- // LocalFileSystemOperation::CreateFile calls this.
+ // FileSystemOperationImpl::CreateFile calls this.
//
// This reports following error code via |callback|:
// - PLATFORM_FILE_OK and created==true if a file has not existed and
@@ -112,7 +112,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil {
// Creates directory at given url.
//
- // LocalFileSystemOperation::CreateDirectory calls this.
+ // FileSystemOperationImpl::CreateDirectory calls this.
//
// This reports following error code via |callback|:
// - PLATFORM_FILE_ERROR_NOT_FOUND if the |url|'s parent directory
@@ -132,7 +132,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil {
// Retrieves the information about a file.
//
- // LocalFileSystemOperation::GetMetadata calls this.
+ // FileSystemOperationImpl::GetMetadata calls this.
//
// This reports following error code via |callback|:
// - PLATFORM_FILE_ERROR_NOT_FOUND if the file doesn't exist.
@@ -145,7 +145,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil {
// Reads contents of a directory at |path|.
//
- // LocalFileSystemOperation::ReadDirectory calls this.
+ // FileSystemOperationImpl::ReadDirectory calls this.
//
// Note that the |name| field of each entry in |file_list|
// returned by |callback| should have a base file name
@@ -170,7 +170,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil {
// |last_access_time| and |last_modified_time|. The function DOES NOT
// create a file unlike 'touch' command on Linux.
//
- // LocalFileSystemOperation::TouchFile calls this.
+ // FileSystemOperationImpl::TouchFile calls this.
// This is used only by Pepper/NaCL File API.
//
virtual void Touch(
@@ -184,7 +184,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil {
// the original file size, the file will be extended, and the extended
// part is filled with null bytes.
//
- // LocalFileSystemOperation::Truncate calls this.
+ // FileSystemOperationImpl::Truncate calls this.
//
// This reports following error code via |callback|:
// - PLATFORM_FILE_ERROR_NOT_FOUND if the file doesn't exist.
@@ -199,7 +199,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil {
// This must be called for files that belong to the same filesystem
// (i.e. type() and origin() of the |src_url| and |dest_url| must match).
//
- // LocalFileSystemOperation::Copy calls this for same-filesystem copy case.
+ // FileSystemOperationImpl::Copy calls this for same-filesystem copy case.
//
// This reports following error code via |callback|:
// - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url|
@@ -220,7 +220,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil {
// This must be called for files that belong to the same filesystem
// (i.e. type() and origin() of the |src_url| and |dest_url| must match).
//
- // LocalFileSystemOperation::Move calls this for same-filesystem move case.
+ // FileSystemOperationImpl::Move calls this for same-filesystem move case.
//
// This reports following error code via |callback|:
// - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url|
@@ -239,7 +239,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil {
// Copies in a single file from a different filesystem.
//
- // LocalFileSystemOperation::Copy or Move calls this for cross-filesystem
+ // FileSystemOperationImpl::Copy or Move calls this for cross-filesystem
// cases.
//
// This reports following error code via |callback|:
@@ -258,7 +258,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil {
// Deletes a single file.
//
- // LocalFileSystemOperation::RemoveFile calls this.
+ // FileSystemOperationImpl::RemoveFile calls this.
//
// This reports following error code via |callback|:
// - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist.
@@ -271,7 +271,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil {
// Removes a single empty directory.
//
- // LocalFileSystemOperation::RemoveDirectory calls this.
+ // FileSystemOperationImpl::RemoveDirectory calls this.
//
// This reports following error code via |callback|:
// - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist.
@@ -286,7 +286,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil {
// Removes a single file or a single directory with its contents
// (i.e. files/subdirectories under the directory).
//
- // LocalFileSystemOperation::Remove calls this.
+ // FileSystemOperationImpl::Remove calls this.
// On some platforms, such as Chrome OS Drive File System, recursive file
// deletion can be implemented more efficiently than calling DeleteFile() and
// DeleteDirectory() for each files/directories.
@@ -323,7 +323,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil {
// Via the |file_ref| implementors can schedule a file deletion
// or arbitrary callbacks when the last reference of File/Blob is dropped.
//
- // LocalFileSystemOperation::CreateSnapshotFile calls this.
+ // FileSystemOperationImpl::CreateSnapshotFile calls this.
//
// This reports following error code via |callback|:
// - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist.
diff --git a/webkit/browser/fileapi/file_system_operation.h b/webkit/browser/fileapi/file_system_operation.h
index a24c415..f1adc19 100644
--- a/webkit/browser/fileapi/file_system_operation.h
+++ b/webkit/browser/fileapi/file_system_operation.h
@@ -31,7 +31,7 @@ namespace fileapi {
class FileSystemURL;
class FileWriterDelegate;
-class LocalFileSystemOperation;
+class FileSystemOperationImpl;
// The interface class for FileSystemOperation implementations.
//
@@ -230,10 +230,10 @@ class FileSystemOperation {
base::ProcessHandle peer_handle,
const OpenFileCallback& callback) = 0;
- // For downcasting to FileSystemOperation.
+ // For downcasting to FileSystemOperationImpl.
// TODO(kinuko): this hack should go away once appropriate upload-stream
// handling based on element types is supported.
- virtual LocalFileSystemOperation* AsLocalFileSystemOperation() = 0;
+ virtual FileSystemOperationImpl* AsFileSystemOperationImpl() = 0;
// Creates a local snapshot file for a given |path| and returns the
// metadata and platform path of the snapshot file via |callback|.
diff --git a/webkit/browser/fileapi/local_file_system_operation.cc b/webkit/browser/fileapi/file_system_operation_impl.cc
index 1309caf..6e07539 100644
--- a/webkit/browser/fileapi/local_file_system_operation.cc
+++ b/webkit/browser/fileapi/file_system_operation_impl.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "webkit/browser/fileapi/local_file_system_operation.h"
+#include "webkit/browser/fileapi/file_system_operation_impl.h"
#include "base/bind.h"
#include "base/single_thread_task_runner.h"
@@ -32,7 +32,7 @@ using webkit_blob::ScopedFile;
namespace fileapi {
-LocalFileSystemOperation::LocalFileSystemOperation(
+FileSystemOperationImpl::FileSystemOperationImpl(
const FileSystemURL& url,
FileSystemContext* file_system_context,
scoped_ptr<FileSystemOperationContext> operation_context)
@@ -47,35 +47,35 @@ LocalFileSystemOperation::LocalFileSystemOperation(
DCHECK(async_file_util_);
}
-LocalFileSystemOperation::~LocalFileSystemOperation() {
+FileSystemOperationImpl::~FileSystemOperationImpl() {
}
-void LocalFileSystemOperation::CreateFile(const FileSystemURL& url,
- bool exclusive,
- const StatusCallback& callback) {
+void FileSystemOperationImpl::CreateFile(const FileSystemURL& url,
+ bool exclusive,
+ const StatusCallback& callback) {
DCHECK(SetPendingOperationType(kOperationCreateFile));
GetUsageAndQuotaThenRunTask(
url,
- base::Bind(&LocalFileSystemOperation::DoCreateFile,
+ base::Bind(&FileSystemOperationImpl::DoCreateFile,
AsWeakPtr(), url, callback, exclusive),
base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED));
}
-void LocalFileSystemOperation::CreateDirectory(const FileSystemURL& url,
- bool exclusive,
- bool recursive,
- const StatusCallback& callback) {
+void FileSystemOperationImpl::CreateDirectory(const FileSystemURL& url,
+ bool exclusive,
+ bool recursive,
+ const StatusCallback& callback) {
DCHECK(SetPendingOperationType(kOperationCreateDirectory));
GetUsageAndQuotaThenRunTask(
url,
- base::Bind(&LocalFileSystemOperation::DoCreateDirectory,
+ base::Bind(&FileSystemOperationImpl::DoCreateDirectory,
AsWeakPtr(), url, callback, exclusive, recursive),
base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED));
}
-void LocalFileSystemOperation::Copy(const FileSystemURL& src_url,
- const FileSystemURL& dest_url,
- const StatusCallback& callback) {
+void FileSystemOperationImpl::Copy(const FileSystemURL& src_url,
+ const FileSystemURL& dest_url,
+ const StatusCallback& callback) {
DCHECK(SetPendingOperationType(kOperationCopy));
DCHECK(!recursive_operation_delegate_);
recursive_operation_delegate_.reset(
@@ -83,14 +83,14 @@ void LocalFileSystemOperation::Copy(const FileSystemURL& src_url,
file_system_context(),
src_url, dest_url,
CopyOrMoveOperationDelegate::OPERATION_COPY,
- base::Bind(&LocalFileSystemOperation::DidFinishOperation,
+ base::Bind(&FileSystemOperationImpl::DidFinishOperation,
AsWeakPtr(), callback)));
recursive_operation_delegate_->RunRecursively();
}
-void LocalFileSystemOperation::Move(const FileSystemURL& src_url,
- const FileSystemURL& dest_url,
- const StatusCallback& callback) {
+void FileSystemOperationImpl::Move(const FileSystemURL& src_url,
+ const FileSystemURL& dest_url,
+ const StatusCallback& callback) {
DCHECK(SetPendingOperationType(kOperationMove));
DCHECK(!recursive_operation_delegate_);
recursive_operation_delegate_.reset(
@@ -98,45 +98,45 @@ void LocalFileSystemOperation::Move(const FileSystemURL& src_url,
file_system_context(),
src_url, dest_url,
CopyOrMoveOperationDelegate::OPERATION_MOVE,
- base::Bind(&LocalFileSystemOperation::DidFinishOperation,
+ base::Bind(&FileSystemOperationImpl::DidFinishOperation,
AsWeakPtr(), callback)));
recursive_operation_delegate_->RunRecursively();
}
-void LocalFileSystemOperation::DirectoryExists(const FileSystemURL& url,
- const StatusCallback& callback) {
+void FileSystemOperationImpl::DirectoryExists(const FileSystemURL& url,
+ const StatusCallback& callback) {
DCHECK(SetPendingOperationType(kOperationDirectoryExists));
async_file_util_->GetFileInfo(
operation_context_.Pass(), url,
- base::Bind(&LocalFileSystemOperation::DidDirectoryExists,
+ base::Bind(&FileSystemOperationImpl::DidDirectoryExists,
AsWeakPtr(), callback));
}
-void LocalFileSystemOperation::FileExists(const FileSystemURL& url,
- const StatusCallback& callback) {
+void FileSystemOperationImpl::FileExists(const FileSystemURL& url,
+ const StatusCallback& callback) {
DCHECK(SetPendingOperationType(kOperationFileExists));
async_file_util_->GetFileInfo(
operation_context_.Pass(), url,
- base::Bind(&LocalFileSystemOperation::DidFileExists,
+ base::Bind(&FileSystemOperationImpl::DidFileExists,
AsWeakPtr(), callback));
}
-void LocalFileSystemOperation::GetMetadata(
+void FileSystemOperationImpl::GetMetadata(
const FileSystemURL& url, const GetMetadataCallback& callback) {
DCHECK(SetPendingOperationType(kOperationGetMetadata));
async_file_util_->GetFileInfo(operation_context_.Pass(), url, callback);
}
-void LocalFileSystemOperation::ReadDirectory(
+void FileSystemOperationImpl::ReadDirectory(
const FileSystemURL& url, const ReadDirectoryCallback& callback) {
DCHECK(SetPendingOperationType(kOperationReadDirectory));
async_file_util_->ReadDirectory(
operation_context_.Pass(), url, callback);
}
-void LocalFileSystemOperation::Remove(const FileSystemURL& url,
- bool recursive,
- const StatusCallback& callback) {
+void FileSystemOperationImpl::Remove(const FileSystemURL& url,
+ bool recursive,
+ const StatusCallback& callback) {
DCHECK(SetPendingOperationType(kOperationRemove));
DCHECK(!recursive_operation_delegate_);
@@ -146,7 +146,7 @@ void LocalFileSystemOperation::Remove(const FileSystemURL& url,
// in DidDeleteRecursively.
async_file_util_->DeleteRecursively(
operation_context_.Pass(), url,
- base::Bind(&LocalFileSystemOperation::DidDeleteRecursively,
+ base::Bind(&FileSystemOperationImpl::DidDeleteRecursively,
AsWeakPtr(), url, callback));
return;
}
@@ -154,12 +154,12 @@ void LocalFileSystemOperation::Remove(const FileSystemURL& url,
recursive_operation_delegate_.reset(
new RemoveOperationDelegate(
file_system_context(), url,
- base::Bind(&LocalFileSystemOperation::DidFinishOperation,
+ base::Bind(&FileSystemOperationImpl::DidFinishOperation,
AsWeakPtr(), callback)));
recursive_operation_delegate_->Run();
}
-void LocalFileSystemOperation::Write(
+void FileSystemOperationImpl::Write(
const FileSystemURL& url,
scoped_ptr<FileWriterDelegate> writer_delegate,
scoped_ptr<net::URLRequest> blob_request,
@@ -168,36 +168,36 @@ void LocalFileSystemOperation::Write(
file_writer_delegate_ = writer_delegate.Pass();
file_writer_delegate_->Start(
blob_request.Pass(),
- base::Bind(&LocalFileSystemOperation::DidWrite, AsWeakPtr(),
+ base::Bind(&FileSystemOperationImpl::DidWrite, AsWeakPtr(),
url, callback));
}
-void LocalFileSystemOperation::Truncate(const FileSystemURL& url, int64 length,
- const StatusCallback& callback) {
+void FileSystemOperationImpl::Truncate(const FileSystemURL& url, int64 length,
+ const StatusCallback& callback) {
DCHECK(SetPendingOperationType(kOperationTruncate));
GetUsageAndQuotaThenRunTask(
url,
- base::Bind(&LocalFileSystemOperation::DoTruncate,
+ base::Bind(&FileSystemOperationImpl::DoTruncate,
AsWeakPtr(), url, callback, length),
base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED));
}
-void LocalFileSystemOperation::TouchFile(const FileSystemURL& url,
- const base::Time& last_access_time,
- const base::Time& last_modified_time,
- const StatusCallback& callback) {
+void FileSystemOperationImpl::TouchFile(const FileSystemURL& url,
+ const base::Time& last_access_time,
+ const base::Time& last_modified_time,
+ const StatusCallback& callback) {
DCHECK(SetPendingOperationType(kOperationTouchFile));
async_file_util_->Touch(
operation_context_.Pass(), url,
last_access_time, last_modified_time,
- base::Bind(&LocalFileSystemOperation::DidFinishOperation,
+ base::Bind(&FileSystemOperationImpl::DidFinishOperation,
AsWeakPtr(), callback));
}
-void LocalFileSystemOperation::OpenFile(const FileSystemURL& url,
- int file_flags,
- base::ProcessHandle peer_handle,
- const OpenFileCallback& callback) {
+void FileSystemOperationImpl::OpenFile(const FileSystemURL& url,
+ int file_flags,
+ base::ProcessHandle peer_handle,
+ const OpenFileCallback& callback) {
DCHECK(SetPendingOperationType(kOperationOpenFile));
peer_handle_ = peer_handle;
@@ -212,7 +212,7 @@ void LocalFileSystemOperation::OpenFile(const FileSystemURL& url,
}
GetUsageAndQuotaThenRunTask(
url,
- base::Bind(&LocalFileSystemOperation::DoOpenFile,
+ base::Bind(&FileSystemOperationImpl::DoOpenFile,
AsWeakPtr(),
url, callback, file_flags),
base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED,
@@ -223,7 +223,7 @@ void LocalFileSystemOperation::OpenFile(const FileSystemURL& url,
// We can only get here on a write or truncate that's not yet completed.
// We don't support cancelling any other operation at this time.
-void LocalFileSystemOperation::Cancel(const StatusCallback& cancel_callback) {
+void FileSystemOperationImpl::Cancel(const StatusCallback& cancel_callback) {
DCHECK(cancel_callback_.is_null());
cancel_callback_ = cancel_callback;
@@ -238,12 +238,11 @@ void LocalFileSystemOperation::Cancel(const StatusCallback& cancel_callback) {
}
}
-LocalFileSystemOperation*
-LocalFileSystemOperation::AsLocalFileSystemOperation() {
+FileSystemOperationImpl* FileSystemOperationImpl::AsFileSystemOperationImpl() {
return this;
}
-base::PlatformFileError LocalFileSystemOperation::SyncGetPlatformPath(
+base::PlatformFileError FileSystemOperationImpl::SyncGetPlatformPath(
const FileSystemURL& url,
base::FilePath* platform_path) {
DCHECK(SetPendingOperationType(kOperationGetLocalPath));
@@ -255,7 +254,7 @@ base::PlatformFileError LocalFileSystemOperation::SyncGetPlatformPath(
return base::PLATFORM_FILE_OK;
}
-void LocalFileSystemOperation::CreateSnapshotFile(
+void FileSystemOperationImpl::CreateSnapshotFile(
const FileSystemURL& url,
const SnapshotFileCallback& callback) {
DCHECK(SetPendingOperationType(kOperationCreateSnapshotFile));
@@ -263,40 +262,40 @@ void LocalFileSystemOperation::CreateSnapshotFile(
operation_context_.Pass(), url, callback);
}
-void LocalFileSystemOperation::CopyInForeignFile(
+void FileSystemOperationImpl::CopyInForeignFile(
const base::FilePath& src_local_disk_file_path,
const FileSystemURL& dest_url,
const StatusCallback& callback) {
DCHECK(SetPendingOperationType(kOperationCopyInForeignFile));
GetUsageAndQuotaThenRunTask(
dest_url,
- base::Bind(&LocalFileSystemOperation::DoCopyInForeignFile,
+ base::Bind(&FileSystemOperationImpl::DoCopyInForeignFile,
AsWeakPtr(), src_local_disk_file_path, dest_url,
callback),
base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED));
}
-void LocalFileSystemOperation::RemoveFile(
+void FileSystemOperationImpl::RemoveFile(
const FileSystemURL& url,
const StatusCallback& callback) {
DCHECK(SetPendingOperationType(kOperationRemove));
async_file_util_->DeleteFile(
operation_context_.Pass(), url,
- base::Bind(&LocalFileSystemOperation::DidFinishOperation,
+ base::Bind(&FileSystemOperationImpl::DidFinishOperation,
AsWeakPtr(), callback));
}
-void LocalFileSystemOperation::RemoveDirectory(
+void FileSystemOperationImpl::RemoveDirectory(
const FileSystemURL& url,
const StatusCallback& callback) {
DCHECK(SetPendingOperationType(kOperationRemove));
async_file_util_->DeleteDirectory(
operation_context_.Pass(), url,
- base::Bind(&LocalFileSystemOperation::DidFinishOperation,
+ base::Bind(&FileSystemOperationImpl::DidFinishOperation,
AsWeakPtr(), callback));
}
-void LocalFileSystemOperation::CopyFileLocal(
+void FileSystemOperationImpl::CopyFileLocal(
const FileSystemURL& src_url,
const FileSystemURL& dest_url,
const StatusCallback& callback) {
@@ -304,12 +303,12 @@ void LocalFileSystemOperation::CopyFileLocal(
DCHECK(src_url.IsInSameFileSystem(dest_url));
GetUsageAndQuotaThenRunTask(
dest_url,
- base::Bind(&LocalFileSystemOperation::DoCopyFileLocal,
+ base::Bind(&FileSystemOperationImpl::DoCopyFileLocal,
AsWeakPtr(), src_url, dest_url, callback),
base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED));
}
-void LocalFileSystemOperation::MoveFileLocal(
+void FileSystemOperationImpl::MoveFileLocal(
const FileSystemURL& src_url,
const FileSystemURL& dest_url,
const StatusCallback& callback) {
@@ -317,12 +316,12 @@ void LocalFileSystemOperation::MoveFileLocal(
DCHECK(src_url.IsInSameFileSystem(dest_url));
GetUsageAndQuotaThenRunTask(
dest_url,
- base::Bind(&LocalFileSystemOperation::DoMoveFileLocal,
+ base::Bind(&FileSystemOperationImpl::DoMoveFileLocal,
AsWeakPtr(), src_url, dest_url, callback),
base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED));
}
-void LocalFileSystemOperation::GetUsageAndQuotaThenRunTask(
+void FileSystemOperationImpl::GetUsageAndQuotaThenRunTask(
const FileSystemURL& url,
const base::Closure& task,
const base::Closure& error_callback) {
@@ -342,11 +341,11 @@ void LocalFileSystemOperation::GetUsageAndQuotaThenRunTask(
quota_manager_proxy->quota_manager()->GetUsageAndQuota(
url.origin(),
FileSystemTypeToQuotaStorageType(url.type()),
- base::Bind(&LocalFileSystemOperation::DidGetUsageAndQuotaAndRunTask,
+ base::Bind(&FileSystemOperationImpl::DidGetUsageAndQuotaAndRunTask,
AsWeakPtr(), task, error_callback));
}
-void LocalFileSystemOperation::DidGetUsageAndQuotaAndRunTask(
+void FileSystemOperationImpl::DidGetUsageAndQuotaAndRunTask(
const base::Closure& task,
const base::Closure& error_callback,
quota::QuotaStatusCode status,
@@ -361,7 +360,7 @@ void LocalFileSystemOperation::DidGetUsageAndQuotaAndRunTask(
task.Run();
}
-void LocalFileSystemOperation::DoCreateFile(
+void FileSystemOperationImpl::DoCreateFile(
const FileSystemURL& url,
const StatusCallback& callback,
bool exclusive) {
@@ -369,72 +368,72 @@ void LocalFileSystemOperation::DoCreateFile(
operation_context_.Pass(), url,
base::Bind(
exclusive ?
- &LocalFileSystemOperation::DidEnsureFileExistsExclusive :
- &LocalFileSystemOperation::DidEnsureFileExistsNonExclusive,
+ &FileSystemOperationImpl::DidEnsureFileExistsExclusive :
+ &FileSystemOperationImpl::DidEnsureFileExistsNonExclusive,
AsWeakPtr(), callback));
}
-void LocalFileSystemOperation::DoCreateDirectory(
+void FileSystemOperationImpl::DoCreateDirectory(
const FileSystemURL& url,
const StatusCallback& callback,
bool exclusive, bool recursive) {
async_file_util_->CreateDirectory(
operation_context_.Pass(),
url, exclusive, recursive,
- base::Bind(&LocalFileSystemOperation::DidFinishOperation,
+ base::Bind(&FileSystemOperationImpl::DidFinishOperation,
AsWeakPtr(), callback));
}
-void LocalFileSystemOperation::DoCopyFileLocal(
+void FileSystemOperationImpl::DoCopyFileLocal(
const FileSystemURL& src_url,
const FileSystemURL& dest_url,
const StatusCallback& callback) {
async_file_util_->CopyFileLocal(
operation_context_.Pass(), src_url, dest_url,
- base::Bind(&LocalFileSystemOperation::DidFinishOperation,
+ base::Bind(&FileSystemOperationImpl::DidFinishOperation,
AsWeakPtr(), callback));
}
-void LocalFileSystemOperation::DoMoveFileLocal(
+void FileSystemOperationImpl::DoMoveFileLocal(
const FileSystemURL& src_url,
const FileSystemURL& dest_url,
const StatusCallback& callback) {
async_file_util_->MoveFileLocal(
operation_context_.Pass(), src_url, dest_url,
- base::Bind(&LocalFileSystemOperation::DidFinishOperation,
+ base::Bind(&FileSystemOperationImpl::DidFinishOperation,
AsWeakPtr(), callback));
}
-void LocalFileSystemOperation::DoCopyInForeignFile(
+void FileSystemOperationImpl::DoCopyInForeignFile(
const base::FilePath& src_local_disk_file_path,
const FileSystemURL& dest_url,
const StatusCallback& callback) {
async_file_util_->CopyInForeignFile(
operation_context_.Pass(),
src_local_disk_file_path, dest_url,
- base::Bind(&LocalFileSystemOperation::DidFinishOperation,
+ base::Bind(&FileSystemOperationImpl::DidFinishOperation,
AsWeakPtr(), callback));
}
-void LocalFileSystemOperation::DoTruncate(const FileSystemURL& url,
- const StatusCallback& callback,
- int64 length) {
+void FileSystemOperationImpl::DoTruncate(const FileSystemURL& url,
+ const StatusCallback& callback,
+ int64 length) {
async_file_util_->Truncate(
operation_context_.Pass(), url, length,
- base::Bind(&LocalFileSystemOperation::DidFinishOperation,
+ base::Bind(&FileSystemOperationImpl::DidFinishOperation,
AsWeakPtr(), callback));
}
-void LocalFileSystemOperation::DoOpenFile(const FileSystemURL& url,
- const OpenFileCallback& callback,
- int file_flags) {
+void FileSystemOperationImpl::DoOpenFile(const FileSystemURL& url,
+ const OpenFileCallback& callback,
+ int file_flags) {
async_file_util_->CreateOrOpen(
operation_context_.Pass(), url, file_flags,
- base::Bind(&LocalFileSystemOperation::DidOpenFile,
+ base::Bind(&FileSystemOperationImpl::DidOpenFile,
AsWeakPtr(), callback));
}
-void LocalFileSystemOperation::DidEnsureFileExistsExclusive(
+void FileSystemOperationImpl::DidEnsureFileExistsExclusive(
const StatusCallback& callback,
base::PlatformFileError rv, bool created) {
if (rv == base::PLATFORM_FILE_OK && !created) {
@@ -444,13 +443,13 @@ void LocalFileSystemOperation::DidEnsureFileExistsExclusive(
}
}
-void LocalFileSystemOperation::DidEnsureFileExistsNonExclusive(
+void FileSystemOperationImpl::DidEnsureFileExistsNonExclusive(
const StatusCallback& callback,
base::PlatformFileError rv, bool /* created */) {
DidFinishOperation(callback, rv);
}
-void LocalFileSystemOperation::DidFinishOperation(
+void FileSystemOperationImpl::DidFinishOperation(
const StatusCallback& callback,
base::PlatformFileError rv) {
if (!cancel_callback_.is_null()) {
@@ -464,7 +463,7 @@ void LocalFileSystemOperation::DidFinishOperation(
}
}
-void LocalFileSystemOperation::DidDirectoryExists(
+void FileSystemOperationImpl::DidDirectoryExists(
const StatusCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info) {
@@ -473,7 +472,7 @@ void LocalFileSystemOperation::DidDirectoryExists(
callback.Run(rv);
}
-void LocalFileSystemOperation::DidFileExists(
+void FileSystemOperationImpl::DidFileExists(
const StatusCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info) {
@@ -482,7 +481,7 @@ void LocalFileSystemOperation::DidFileExists(
callback.Run(rv);
}
-void LocalFileSystemOperation::DidDeleteRecursively(
+void FileSystemOperationImpl::DidDeleteRecursively(
const FileSystemURL& url,
const StatusCallback& callback,
base::PlatformFileError rv) {
@@ -492,7 +491,7 @@ void LocalFileSystemOperation::DidDeleteRecursively(
recursive_operation_delegate_.reset(
new RemoveOperationDelegate(
file_system_context(), url,
- base::Bind(&LocalFileSystemOperation::DidFinishOperation,
+ base::Bind(&FileSystemOperationImpl::DidFinishOperation,
AsWeakPtr(), callback)));
recursive_operation_delegate_->RunRecursively();
return;
@@ -501,7 +500,7 @@ void LocalFileSystemOperation::DidDeleteRecursively(
callback.Run(rv);
}
-void LocalFileSystemOperation::DidWrite(
+void FileSystemOperationImpl::DidWrite(
const FileSystemURL& url,
const WriteCallback& write_callback,
base::PlatformFileError rv,
@@ -521,7 +520,7 @@ void LocalFileSystemOperation::DidWrite(
cancel_callback.Run(base::PLATFORM_FILE_OK);
}
-void LocalFileSystemOperation::DidOpenFile(
+void FileSystemOperationImpl::DidOpenFile(
const OpenFileCallback& callback,
base::PlatformFileError rv,
base::PassPlatformFile file,
@@ -531,7 +530,7 @@ void LocalFileSystemOperation::DidOpenFile(
callback.Run(rv, file.ReleaseValue(), on_close_callback, peer_handle_);
}
-bool LocalFileSystemOperation::SetPendingOperationType(OperationType type) {
+bool FileSystemOperationImpl::SetPendingOperationType(OperationType type) {
if (pending_operation_ != kOperationNone)
return false;
pending_operation_ = type;
diff --git a/webkit/browser/fileapi/local_file_system_operation.h b/webkit/browser/fileapi/file_system_operation_impl.h
index 1ccaf40..293ac51 100644
--- a/webkit/browser/fileapi/local_file_system_operation.h
+++ b/webkit/browser/fileapi/file_system_operation_impl.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef WEBKIT_BROWSER_FILEAPI_LOCAL_FILE_SYSTEM_OPERATION_H_
-#define WEBKIT_BROWSER_FILEAPI_LOCAL_FILE_SYSTEM_OPERATION_H_
+#ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_IMPL_H_
+#define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_IMPL_H_
#include <vector>
@@ -24,21 +24,21 @@ class AsyncFileUtil;
class FileSystemContext;
class RecursiveOperationDelegate;
-// FileSystemOperation implementation for local file systems.
-class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileSystemOperation
+// The default implementation of FileSystemOperation for file systems.
+class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationImpl
: public NON_EXPORTED_BASE(FileSystemOperation),
- public base::SupportsWeakPtr<LocalFileSystemOperation> {
+ public base::SupportsWeakPtr<FileSystemOperationImpl> {
public:
// NOTE: This constructor should not be called outside FileSystemBackends;
// instead please consider using
// file_system_context->CreateFileSystemOperation() to instantiate
// an appropriate FileSystemOperation.
- LocalFileSystemOperation(
+ FileSystemOperationImpl(
const FileSystemURL& url,
FileSystemContext* file_system_context,
scoped_ptr<FileSystemOperationContext> operation_context);
- virtual ~LocalFileSystemOperation();
+ virtual ~FileSystemOperationImpl();
// FileSystemOperation overrides.
virtual void CreateFile(const FileSystemURL& url,
@@ -79,7 +79,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileSystemOperation
base::ProcessHandle peer_handle,
const OpenFileCallback& callback) OVERRIDE;
virtual void Cancel(const StatusCallback& cancel_callback) OVERRIDE;
- virtual LocalFileSystemOperation* AsLocalFileSystemOperation() OVERRIDE;
+ virtual FileSystemOperationImpl* AsFileSystemOperationImpl() OVERRIDE;
virtual void CreateSnapshotFile(
const FileSystemURL& path,
const SnapshotFileCallback& callback) OVERRIDE;
@@ -255,9 +255,9 @@ class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileSystemOperation
// A flag to make sure we call operation only once per instance.
OperationType pending_operation_;
- DISALLOW_COPY_AND_ASSIGN(LocalFileSystemOperation);
+ DISALLOW_COPY_AND_ASSIGN(FileSystemOperationImpl);
};
} // namespace fileapi
-#endif // WEBKIT_BROWSER_FILEAPI_LOCAL_FILE_SYSTEM_OPERATION_H_
+#endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_IMPL_H_
diff --git a/webkit/browser/fileapi/local_file_system_operation_unittest.cc b/webkit/browser/fileapi/file_system_operation_impl_unittest.cc
index ff71954..846335c 100644
--- a/webkit/browser/fileapi/local_file_system_operation_unittest.cc
+++ b/webkit/browser/fileapi/file_system_operation_impl_unittest.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "webkit/browser/fileapi/local_file_system_operation.h"
+#include "webkit/browser/fileapi/file_system_operation_impl.h"
#include "base/bind.h"
#include "base/file_util.h"
@@ -45,12 +45,12 @@ void AssertFileErrorEq(const tracked_objects::Location& from_here,
} // namespace (anonymous)
-// Test class for LocalFileSystemOperation.
-class LocalFileSystemOperationTest
+// Test class for FileSystemOperationImpl.
+class FileSystemOperationImplTest
: public testing::Test,
- public base::SupportsWeakPtr<LocalFileSystemOperationTest> {
+ public base::SupportsWeakPtr<FileSystemOperationImplTest> {
public:
- LocalFileSystemOperationTest()
+ FileSystemOperationImplTest()
: status_(kFileOperationStatusNotSet) {}
protected:
@@ -165,22 +165,22 @@ class LocalFileSystemOperationTest
// Callbacks for recording test results.
FileSystemOperation::StatusCallback RecordStatusCallback() {
- return base::Bind(&LocalFileSystemOperationTest::DidFinish, AsWeakPtr());
+ return base::Bind(&FileSystemOperationImplTest::DidFinish, AsWeakPtr());
}
FileSystemOperation::ReadDirectoryCallback
RecordReadDirectoryCallback() {
- return base::Bind(&LocalFileSystemOperationTest::DidReadDirectory,
+ return base::Bind(&FileSystemOperationImplTest::DidReadDirectory,
AsWeakPtr());
}
FileSystemOperation::GetMetadataCallback RecordMetadataCallback() {
- return base::Bind(&LocalFileSystemOperationTest::DidGetMetadata,
+ return base::Bind(&FileSystemOperationImplTest::DidGetMetadata,
AsWeakPtr());
}
FileSystemOperation::SnapshotFileCallback RecordSnapshotFileCallback() {
- return base::Bind(&LocalFileSystemOperationTest::DidCreateSnapshotFile,
+ return base::Bind(&FileSystemOperationImplTest::DidCreateSnapshotFile,
AsWeakPtr());
}
@@ -287,10 +287,10 @@ class LocalFileSystemOperationTest
MockFileChangeObserver change_observer_;
ChangeObserverList change_observers_;
- DISALLOW_COPY_AND_ASSIGN(LocalFileSystemOperationTest);
+ DISALLOW_COPY_AND_ASSIGN(FileSystemOperationImplTest);
};
-TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcDoesntExist) {
+TEST_F(FileSystemOperationImplTest, TestMoveFailureSrcDoesntExist) {
change_observer()->ResetCount();
operation_runner()->Move(URLForPath("a"), URLForPath("b"),
RecordStatusCallback());
@@ -299,7 +299,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcDoesntExist) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestMoveFailureContainsPath) {
+TEST_F(FileSystemOperationImplTest, TestMoveFailureContainsPath) {
FileSystemURL src_dir(CreateDirectory("src"));
FileSystemURL dest_dir(CreateDirectory("src/dest"));
@@ -309,7 +309,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureContainsPath) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcDirExistsDestFile) {
+TEST_F(FileSystemOperationImplTest, TestMoveFailureSrcDirExistsDestFile) {
// Src exists and is dir. Dest is a file.
FileSystemURL src_dir(CreateDirectory("src"));
FileSystemURL dest_dir(CreateDirectory("dest"));
@@ -321,7 +321,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcDirExistsDestFile) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest,
+TEST_F(FileSystemOperationImplTest,
TestMoveFailureSrcFileExistsDestNonEmptyDir) {
// Src exists and is a directory. Dest is a non-empty directory.
FileSystemURL src_dir(CreateDirectory("src"));
@@ -334,7 +334,7 @@ TEST_F(LocalFileSystemOperationTest,
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcFileExistsDestDir) {
+TEST_F(FileSystemOperationImplTest, TestMoveFailureSrcFileExistsDestDir) {
// Src exists and is a file. Dest is a directory.
FileSystemURL src_dir(CreateDirectory("src"));
FileSystemURL src_file(CreateFile("src/file"));
@@ -346,7 +346,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcFileExistsDestDir) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestMoveFailureDestParentDoesntExist) {
+TEST_F(FileSystemOperationImplTest, TestMoveFailureDestParentDoesntExist) {
// Dest. parent path does not exist.
FileSystemURL src_dir(CreateDirectory("src"));
operation_runner()->Move(src_dir, URLForPath("nonexistent/deset"),
@@ -356,7 +356,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureDestParentDoesntExist) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcFileAndOverwrite) {
+TEST_F(FileSystemOperationImplTest, TestMoveSuccessSrcFileAndOverwrite) {
FileSystemURL src_file(CreateFile("src"));
FileSystemURL dest_file(CreateFile("dest"));
@@ -372,7 +372,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcFileAndOverwrite) {
EXPECT_EQ(1, quota_manager_proxy()->notify_storage_accessed_count());
}
-TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcFileAndNew) {
+TEST_F(FileSystemOperationImplTest, TestMoveSuccessSrcFileAndNew) {
FileSystemURL src_file(CreateFile("src"));
operation_runner()->Move(src_file, URLForPath("new"), RecordStatusCallback());
@@ -385,7 +385,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcFileAndNew) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirAndOverwrite) {
+TEST_F(FileSystemOperationImplTest, TestMoveSuccessSrcDirAndOverwrite) {
FileSystemURL src_dir(CreateDirectory("src"));
FileSystemURL dest_dir(CreateDirectory("dest"));
@@ -403,7 +403,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirAndOverwrite) {
EXPECT_FALSE(DirectoryExists("dest/src"));
}
-TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirAndNew) {
+TEST_F(FileSystemOperationImplTest, TestMoveSuccessSrcDirAndNew) {
FileSystemURL src_dir(CreateDirectory("src"));
FileSystemURL dest_dir(CreateDirectory("dest"));
@@ -419,7 +419,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirAndNew) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirRecursive) {
+TEST_F(FileSystemOperationImplTest, TestMoveSuccessSrcDirRecursive) {
FileSystemURL src_dir(CreateDirectory("src"));
CreateDirectory("src/dir");
CreateFile("src/dir/sub");
@@ -439,7 +439,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirRecursive) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcDoesntExist) {
+TEST_F(FileSystemOperationImplTest, TestCopyFailureSrcDoesntExist) {
operation_runner()->Copy(URLForPath("a"), URLForPath("b"),
RecordStatusCallback());
base::MessageLoop::current()->RunUntilIdle();
@@ -447,7 +447,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcDoesntExist) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCopyFailureContainsPath) {
+TEST_F(FileSystemOperationImplTest, TestCopyFailureContainsPath) {
FileSystemURL src_dir(CreateDirectory("src"));
FileSystemURL dest_dir(CreateDirectory("src/dir"));
@@ -457,7 +457,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureContainsPath) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcDirExistsDestFile) {
+TEST_F(FileSystemOperationImplTest, TestCopyFailureSrcDirExistsDestFile) {
// Src exists and is dir. Dest is a file.
FileSystemURL src_dir(CreateDirectory("src"));
FileSystemURL dest_dir(CreateDirectory("dest"));
@@ -469,7 +469,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcDirExistsDestFile) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest,
+TEST_F(FileSystemOperationImplTest,
TestCopyFailureSrcFileExistsDestNonEmptyDir) {
// Src exists and is a directory. Dest is a non-empty directory.
FileSystemURL src_dir(CreateDirectory("src"));
@@ -482,7 +482,7 @@ TEST_F(LocalFileSystemOperationTest,
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcFileExistsDestDir) {
+TEST_F(FileSystemOperationImplTest, TestCopyFailureSrcFileExistsDestDir) {
// Src exists and is a file. Dest is a directory.
FileSystemURL src_file(CreateFile("src"));
FileSystemURL dest_dir(CreateDirectory("dest"));
@@ -493,7 +493,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcFileExistsDestDir) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCopyFailureDestParentDoesntExist) {
+TEST_F(FileSystemOperationImplTest, TestCopyFailureDestParentDoesntExist) {
// Dest. parent path does not exist.
FileSystemURL src_dir(CreateDirectory("src"));
@@ -504,7 +504,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureDestParentDoesntExist) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCopyFailureByQuota) {
+TEST_F(FileSystemOperationImplTest, TestCopyFailureByQuota) {
FileSystemURL src_dir(CreateDirectory("src"));
FileSystemURL src_file(CreateFile("src/file"));
FileSystemURL dest_dir(CreateDirectory("dest"));
@@ -524,7 +524,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureByQuota) {
EXPECT_FALSE(FileExists("dest/file"));
}
-TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcFileAndOverwrite) {
+TEST_F(FileSystemOperationImplTest, TestCopySuccessSrcFileAndOverwrite) {
FileSystemURL src_file(CreateFile("src"));
FileSystemURL dest_file(CreateFile("dest"));
@@ -538,7 +538,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcFileAndOverwrite) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcFileAndNew) {
+TEST_F(FileSystemOperationImplTest, TestCopySuccessSrcFileAndNew) {
FileSystemURL src_file(CreateFile("src"));
operation_runner()->Copy(src_file, URLForPath("new"),
@@ -552,7 +552,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcFileAndNew) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirAndOverwrite) {
+TEST_F(FileSystemOperationImplTest, TestCopySuccessSrcDirAndOverwrite) {
FileSystemURL src_dir(CreateDirectory("src"));
FileSystemURL dest_dir(CreateDirectory("dest"));
@@ -570,7 +570,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirAndOverwrite) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirAndNew) {
+TEST_F(FileSystemOperationImplTest, TestCopySuccessSrcDirAndNew) {
FileSystemURL src_dir(CreateDirectory("src"));
FileSystemURL dest_dir_new(URLForPath("dest"));
@@ -584,7 +584,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirAndNew) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirRecursive) {
+TEST_F(FileSystemOperationImplTest, TestCopySuccessSrcDirRecursive) {
FileSystemURL src_dir(CreateDirectory("src"));
CreateDirectory("src/dir");
CreateFile("src/dir/sub");
@@ -607,7 +607,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirRecursive) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCopyInForeignFileSuccess) {
+TEST_F(FileSystemOperationImplTest, TestCopyInForeignFileSuccess) {
base::FilePath src_local_disk_file_path;
file_util::CreateTemporaryFile(&src_local_disk_file_path);
const char test_data[] = "foo";
@@ -640,7 +640,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyInForeignFileSuccess) {
EXPECT_EQ(test_data[i], buffer[i]);
}
-TEST_F(LocalFileSystemOperationTest, TestCopyInForeignFileFailureByQuota) {
+TEST_F(FileSystemOperationImplTest, TestCopyInForeignFileFailureByQuota) {
base::FilePath src_local_disk_file_path;
file_util::CreateTemporaryFile(&src_local_disk_file_path);
const char test_data[] = "foo";
@@ -660,7 +660,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyInForeignFileFailureByQuota) {
EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status());
}
-TEST_F(LocalFileSystemOperationTest, TestCreateFileFailure) {
+TEST_F(FileSystemOperationImplTest, TestCreateFileFailure) {
// Already existing file and exclusive true.
FileSystemURL file(CreateFile("file"));
operation_runner()->CreateFile(file, true, RecordStatusCallback());
@@ -669,7 +669,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateFileFailure) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessFileExists) {
+TEST_F(FileSystemOperationImplTest, TestCreateFileSuccessFileExists) {
// Already existing file and exclusive false.
FileSystemURL file(CreateFile("file"));
operation_runner()->CreateFile(file, false, RecordStatusCallback());
@@ -681,7 +681,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessFileExists) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessExclusive) {
+TEST_F(FileSystemOperationImplTest, TestCreateFileSuccessExclusive) {
// File doesn't exist but exclusive is true.
operation_runner()->CreateFile(URLForPath("new"), true,
RecordStatusCallback());
@@ -691,7 +691,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessExclusive) {
EXPECT_EQ(1, change_observer()->get_and_reset_create_file_count());
}
-TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessFileDoesntExist) {
+TEST_F(FileSystemOperationImplTest, TestCreateFileSuccessFileDoesntExist) {
// Non existing file.
operation_runner()->CreateFile(URLForPath("nonexistent"), false,
RecordStatusCallback());
@@ -700,7 +700,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessFileDoesntExist) {
EXPECT_EQ(1, change_observer()->get_and_reset_create_file_count());
}
-TEST_F(LocalFileSystemOperationTest,
+TEST_F(FileSystemOperationImplTest,
TestCreateDirFailureDestParentDoesntExist) {
// Dest. parent path does not exist.
operation_runner()->CreateDirectory(
@@ -711,7 +711,7 @@ TEST_F(LocalFileSystemOperationTest,
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCreateDirFailureDirExists) {
+TEST_F(FileSystemOperationImplTest, TestCreateDirFailureDirExists) {
// Exclusive and dir existing at path.
FileSystemURL dir(CreateDirectory("dir"));
operation_runner()->CreateDirectory(dir, true, false,
@@ -721,7 +721,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateDirFailureDirExists) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCreateDirFailureFileExists) {
+TEST_F(FileSystemOperationImplTest, TestCreateDirFailureFileExists) {
// Exclusive true and file existing at path.
FileSystemURL file(CreateFile("file"));
operation_runner()->CreateDirectory(file, true, false,
@@ -731,7 +731,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateDirFailureFileExists) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestCreateDirSuccess) {
+TEST_F(FileSystemOperationImplTest, TestCreateDirSuccess) {
// Dir exists and exclusive is false.
FileSystemURL dir(CreateDirectory("dir"));
operation_runner()->CreateDirectory(dir, false, false,
@@ -749,7 +749,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateDirSuccess) {
EXPECT_EQ(1, change_observer()->get_and_reset_create_directory_count());
}
-TEST_F(LocalFileSystemOperationTest, TestCreateDirSuccessExclusive) {
+TEST_F(FileSystemOperationImplTest, TestCreateDirSuccessExclusive) {
// Dir doesn't exist.
operation_runner()->CreateDirectory(URLForPath("new"), true, false,
RecordStatusCallback());
@@ -760,7 +760,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateDirSuccessExclusive) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestExistsAndMetadataFailure) {
+TEST_F(FileSystemOperationImplTest, TestExistsAndMetadataFailure) {
operation_runner()->GetMetadata(URLForPath("nonexistent"),
RecordMetadataCallback());
base::MessageLoop::current()->RunUntilIdle();
@@ -778,7 +778,7 @@ TEST_F(LocalFileSystemOperationTest, TestExistsAndMetadataFailure) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestExistsAndMetadataSuccess) {
+TEST_F(FileSystemOperationImplTest, TestExistsAndMetadataSuccess) {
FileSystemURL dir(CreateDirectory("dir"));
FileSystemURL file(CreateFile("dir/file"));
int read_access = 0;
@@ -810,7 +810,7 @@ TEST_F(LocalFileSystemOperationTest, TestExistsAndMetadataSuccess) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestTypeMismatchErrors) {
+TEST_F(FileSystemOperationImplTest, TestTypeMismatchErrors) {
FileSystemURL dir(CreateDirectory("dir"));
operation_runner()->FileExists(dir, RecordStatusCallback());
base::MessageLoop::current()->RunUntilIdle();
@@ -822,7 +822,7 @@ TEST_F(LocalFileSystemOperationTest, TestTypeMismatchErrors) {
EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, status());
}
-TEST_F(LocalFileSystemOperationTest, TestReadDirFailure) {
+TEST_F(FileSystemOperationImplTest, TestReadDirFailure) {
// Path doesn't exist
operation_runner()->ReadDirectory(URLForPath("nonexistent"),
RecordReadDirectoryCallback());
@@ -837,7 +837,7 @@ TEST_F(LocalFileSystemOperationTest, TestReadDirFailure) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestReadDirSuccess) {
+TEST_F(FileSystemOperationImplTest, TestReadDirSuccess) {
// parent_dir
// | |
// child_dir child_file
@@ -861,7 +861,7 @@ TEST_F(LocalFileSystemOperationTest, TestReadDirSuccess) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestRemoveFailure) {
+TEST_F(FileSystemOperationImplTest, TestRemoveFailure) {
// Path doesn't exist.
operation_runner()->Remove(URLForPath("nonexistent"), false /* recursive */,
RecordStatusCallback());
@@ -885,7 +885,7 @@ TEST_F(LocalFileSystemOperationTest, TestRemoveFailure) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestRemoveSuccess) {
+TEST_F(FileSystemOperationImplTest, TestRemoveSuccess) {
FileSystemURL empty_dir(CreateDirectory("empty_dir"));
EXPECT_TRUE(DirectoryExists("empty_dir"));
operation_runner()->Remove(empty_dir, false /* recursive */,
@@ -898,7 +898,7 @@ TEST_F(LocalFileSystemOperationTest, TestRemoveSuccess) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestRemoveSuccessRecursive) {
+TEST_F(FileSystemOperationImplTest, TestRemoveSuccessRecursive) {
// Removing a non-empty directory with recursive flag == true should be ok.
// parent_dir
// | |
@@ -925,7 +925,7 @@ TEST_F(LocalFileSystemOperationTest, TestRemoveSuccessRecursive) {
EXPECT_TRUE(change_observer()->HasNoChange());
}
-TEST_F(LocalFileSystemOperationTest, TestTruncate) {
+TEST_F(FileSystemOperationImplTest, TestTruncate) {
FileSystemURL file(CreateFile("file"));
base::FilePath platform_path = PlatformPath("file");
@@ -982,7 +982,7 @@ TEST_F(LocalFileSystemOperationTest, TestTruncate) {
EXPECT_EQ(1, quota_manager_proxy()->notify_storage_accessed_count());
}
-TEST_F(LocalFileSystemOperationTest, TestTruncateFailureByQuota) {
+TEST_F(FileSystemOperationImplTest, TestTruncateFailureByQuota) {
FileSystemURL dir(CreateDirectory("dir"));
FileSystemURL file(CreateFile("dir/file"));
@@ -1005,7 +1005,7 @@ TEST_F(LocalFileSystemOperationTest, TestTruncateFailureByQuota) {
EXPECT_EQ(10, GetFileSize("dir/file"));
}
-TEST_F(LocalFileSystemOperationTest, TestTouchFile) {
+TEST_F(FileSystemOperationImplTest, TestTouchFile) {
FileSystemURL file(CreateFile("file"));
base::FilePath platform_path = PlatformPath("file");
@@ -1036,7 +1036,7 @@ TEST_F(LocalFileSystemOperationTest, TestTouchFile) {
EXPECT_EQ(new_accessed_time.ToTimeT(), info.last_accessed.ToTimeT());
}
-TEST_F(LocalFileSystemOperationTest, TestCreateSnapshotFile) {
+TEST_F(FileSystemOperationImplTest, TestCreateSnapshotFile) {
FileSystemURL dir(CreateDirectory("dir"));
// Create a file for the testing.
@@ -1047,7 +1047,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateSnapshotFile) {
EXPECT_EQ(base::PLATFORM_FILE_OK, status());
// See if we can get a 'snapshot' file info for the file.
- // Since LocalFileSystemOperation assumes the file exists in the local
+ // Since FileSystemOperationImpl assumes the file exists in the local
// directory it should just returns the same metadata and platform_path
// as the file itself.
operation_runner()->CreateSnapshotFile(file, RecordSnapshotFileCallback());
@@ -1062,7 +1062,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateSnapshotFile) {
EXPECT_EQ(NULL, shareable_file_ref());
}
-TEST_F(LocalFileSystemOperationTest,
+TEST_F(FileSystemOperationImplTest,
TestMoveSuccessSrcDirRecursiveWithQuota) {
FileSystemURL src(CreateDirectory("src"));
int src_path_cost = GetUsage();
@@ -1110,7 +1110,7 @@ TEST_F(LocalFileSystemOperationTest,
GetUsage());
}
-TEST_F(LocalFileSystemOperationTest,
+TEST_F(FileSystemOperationImplTest,
TestCopySuccessSrcDirRecursiveWithQuota) {
FileSystemURL src(CreateDirectory("src"));
FileSystemURL dest1(CreateDirectory("dest1"));
diff --git a/webkit/browser/fileapi/local_file_system_operation_write_unittest.cc b/webkit/browser/fileapi/file_system_operation_impl_write_unittest.cc
index a1f0cfb..88a48d8 100644
--- a/webkit/browser/fileapi/local_file_system_operation_write_unittest.cc
+++ b/webkit/browser/fileapi/file_system_operation_impl_write_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -47,11 +47,11 @@ void AssertStatusEq(base::PlatformFileError expected,
} // namespace
-class LocalFileSystemOperationWriteTest
+class FileSystemOperationImplWriteTest
: public testing::Test,
- public base::SupportsWeakPtr<LocalFileSystemOperationWriteTest> {
+ public base::SupportsWeakPtr<FileSystemOperationImplWriteTest> {
public:
- LocalFileSystemOperationWriteTest()
+ FileSystemOperationImplWriteTest()
: loop_(base::MessageLoop::TYPE_IO),
status_(base::PLATFORM_FILE_OK),
cancel_status_(base::PLATFORM_FILE_ERROR_FAILED),
@@ -117,12 +117,12 @@ class LocalFileSystemOperationWriteTest
// Callback function for recording test results.
FileSystemOperation::WriteCallback RecordWriteCallback() {
- return base::Bind(&LocalFileSystemOperationWriteTest::DidWrite,
+ return base::Bind(&FileSystemOperationImplWriteTest::DidWrite,
AsWeakPtr());
}
FileSystemOperation::StatusCallback RecordCancelCallback() {
- return base::Bind(&LocalFileSystemOperationWriteTest::DidCancel,
+ return base::Bind(&FileSystemOperationImplWriteTest::DidCancel,
AsWeakPtr());
}
@@ -168,10 +168,10 @@ class LocalFileSystemOperationWriteTest
MockFileChangeObserver change_observer_;
ChangeObserverList change_observers_;
- DISALLOW_COPY_AND_ASSIGN(LocalFileSystemOperationWriteTest);
+ DISALLOW_COPY_AND_ASSIGN(FileSystemOperationImplWriteTest);
};
-TEST_F(LocalFileSystemOperationWriteTest, TestWriteSuccess) {
+TEST_F(FileSystemOperationImplWriteTest, TestWriteSuccess) {
const GURL blob_url("blob:success");
ScopedTextBlob blob(url_request_context(), blob_url, "Hello, world!\n");
@@ -187,7 +187,7 @@ TEST_F(LocalFileSystemOperationWriteTest, TestWriteSuccess) {
EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count());
}
-TEST_F(LocalFileSystemOperationWriteTest, TestWriteZero) {
+TEST_F(FileSystemOperationImplWriteTest, TestWriteZero) {
GURL blob_url("blob:zero");
scoped_refptr<webkit_blob::BlobData> blob_data(new webkit_blob::BlobData());
@@ -208,7 +208,7 @@ TEST_F(LocalFileSystemOperationWriteTest, TestWriteZero) {
EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count());
}
-TEST_F(LocalFileSystemOperationWriteTest, TestWriteInvalidBlobUrl) {
+TEST_F(FileSystemOperationImplWriteTest, TestWriteInvalidBlobUrl) {
file_system_context_->operation_runner()->Write(
&url_request_context(), URLForPath(virtual_path_),
GURL("blob:invalid"), 0, RecordWriteCallback());
@@ -221,7 +221,7 @@ TEST_F(LocalFileSystemOperationWriteTest, TestWriteInvalidBlobUrl) {
EXPECT_EQ(0, change_observer()->get_and_reset_modify_file_count());
}
-TEST_F(LocalFileSystemOperationWriteTest, TestWriteInvalidFile) {
+TEST_F(FileSystemOperationImplWriteTest, TestWriteInvalidFile) {
GURL blob_url("blob:writeinvalidfile");
ScopedTextBlob blob(url_request_context(), blob_url,
"It\'ll not be written.");
@@ -239,7 +239,7 @@ TEST_F(LocalFileSystemOperationWriteTest, TestWriteInvalidFile) {
EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count());
}
-TEST_F(LocalFileSystemOperationWriteTest, TestWriteDir) {
+TEST_F(FileSystemOperationImplWriteTest, TestWriteDir) {
base::FilePath virtual_dir_path(FILE_PATH_LITERAL("d"));
file_system_context_->operation_runner()->CreateDirectory(
URLForPath(virtual_dir_path),
@@ -266,7 +266,7 @@ TEST_F(LocalFileSystemOperationWriteTest, TestWriteDir) {
EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count());
}
-TEST_F(LocalFileSystemOperationWriteTest, TestWriteFailureByQuota) {
+TEST_F(FileSystemOperationImplWriteTest, TestWriteFailureByQuota) {
GURL blob_url("blob:success");
ScopedTextBlob blob(url_request_context(), blob_url, "Hello, world!\n");
@@ -284,7 +284,7 @@ TEST_F(LocalFileSystemOperationWriteTest, TestWriteFailureByQuota) {
EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count());
}
-TEST_F(LocalFileSystemOperationWriteTest, TestImmediateCancelSuccessfulWrite) {
+TEST_F(FileSystemOperationImplWriteTest, TestImmediateCancelSuccessfulWrite) {
GURL blob_url("blob:success");
ScopedTextBlob blob(url_request_context(), blob_url, "Hello, world!\n");
@@ -308,7 +308,7 @@ TEST_F(LocalFileSystemOperationWriteTest, TestImmediateCancelSuccessfulWrite) {
EXPECT_EQ(0, change_observer()->get_and_reset_modify_file_count());
}
-TEST_F(LocalFileSystemOperationWriteTest, TestImmediateCancelFailingWrite) {
+TEST_F(FileSystemOperationImplWriteTest, TestImmediateCancelFailingWrite) {
GURL blob_url("blob:writeinvalidfile");
ScopedTextBlob blob(url_request_context(), blob_url,
"It\'ll not be written.");
diff --git a/webkit/browser/fileapi/file_system_operation_runner.cc b/webkit/browser/fileapi/file_system_operation_runner.cc
index d16b727..351536b 100644
--- a/webkit/browser/fileapi/file_system_operation_runner.cc
+++ b/webkit/browser/fileapi/file_system_operation_runner.cc
@@ -9,8 +9,8 @@
#include "webkit/browser/fileapi/file_observers.h"
#include "webkit/browser/fileapi/file_stream_writer.h"
#include "webkit/browser/fileapi/file_system_context.h"
+#include "webkit/browser/fileapi/file_system_operation_impl.h"
#include "webkit/browser/fileapi/file_writer_delegate.h"
-#include "webkit/browser/fileapi/local_file_system_operation.h"
#include "webkit/common/blob/shareable_file_reference.h"
namespace fileapi {
@@ -348,14 +348,14 @@ OperationID FileSystemOperationRunner::CopyInForeignFile(
const FileSystemURL& dest_url,
const StatusCallback& callback) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FileSystemOperation* operation = CreateLocalFileSystemOperation(
+ FileSystemOperation* operation = CreateFileSystemOperationImpl(
dest_url, &error);
if (!operation) {
callback.Run(error);
return kErrorOperationID;
}
OperationID id = operations_.Add(operation);
- operation->AsLocalFileSystemOperation()->CopyInForeignFile(
+ operation->AsFileSystemOperationImpl()->CopyInForeignFile(
src_local_disk_path, dest_url,
base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
id, callback));
@@ -366,13 +366,13 @@ OperationID FileSystemOperationRunner::RemoveFile(
const FileSystemURL& url,
const StatusCallback& callback) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FileSystemOperation* operation = CreateLocalFileSystemOperation(url, &error);
+ FileSystemOperation* operation = CreateFileSystemOperationImpl(url, &error);
if (!operation) {
callback.Run(error);
return kErrorOperationID;
}
OperationID id = operations_.Add(operation);
- operation->AsLocalFileSystemOperation()->RemoveFile(
+ operation->AsFileSystemOperationImpl()->RemoveFile(
url,
base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
id, callback));
@@ -383,13 +383,13 @@ OperationID FileSystemOperationRunner::RemoveDirectory(
const FileSystemURL& url,
const StatusCallback& callback) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FileSystemOperation* operation = CreateLocalFileSystemOperation(url, &error);
+ FileSystemOperation* operation = CreateFileSystemOperationImpl(url, &error);
if (!operation) {
callback.Run(error);
return kErrorOperationID;
}
OperationID id = operations_.Add(operation);
- operation->AsLocalFileSystemOperation()->RemoveDirectory(
+ operation->AsFileSystemOperationImpl()->RemoveDirectory(
url,
base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
id, callback));
@@ -401,14 +401,14 @@ OperationID FileSystemOperationRunner::CopyFileLocal(
const FileSystemURL& dest_url,
const StatusCallback& callback) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FileSystemOperation* operation = CreateLocalFileSystemOperation(
+ FileSystemOperation* operation = CreateFileSystemOperationImpl(
src_url, &error);
if (!operation) {
callback.Run(error);
return kErrorOperationID;
}
OperationID id = operations_.Add(operation);
- operation->AsLocalFileSystemOperation()->CopyFileLocal(
+ operation->AsFileSystemOperationImpl()->CopyFileLocal(
src_url, dest_url,
base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
id, callback));
@@ -420,14 +420,14 @@ OperationID FileSystemOperationRunner::MoveFileLocal(
const FileSystemURL& dest_url,
const StatusCallback& callback) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FileSystemOperation* operation = CreateLocalFileSystemOperation(
+ FileSystemOperation* operation = CreateFileSystemOperationImpl(
src_url, &error);
if (!operation) {
callback.Run(error);
return kErrorOperationID;
}
OperationID id = operations_.Add(operation);
- operation->AsLocalFileSystemOperation()->MoveFileLocal(
+ operation->AsFileSystemOperationImpl()->MoveFileLocal(
src_url, dest_url,
base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
id, callback));
@@ -438,11 +438,11 @@ base::PlatformFileError FileSystemOperationRunner::SyncGetPlatformPath(
const FileSystemURL& url,
base::FilePath* platform_path) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FileSystemOperation* operation = CreateLocalFileSystemOperation(url, &error);
+ FileSystemOperation* operation = CreateFileSystemOperationImpl(url, &error);
if (!operation)
return error;
- return operation->AsLocalFileSystemOperation()->SyncGetPlatformPath(
+ return operation->AsFileSystemOperationImpl()->SyncGetPlatformPath(
url, platform_path);
}
@@ -512,13 +512,13 @@ void FileSystemOperationRunner::DidCreateSnapshot(
}
FileSystemOperation*
-FileSystemOperationRunner::CreateLocalFileSystemOperation(
+FileSystemOperationRunner::CreateFileSystemOperationImpl(
const FileSystemURL& url, base::PlatformFileError* error) {
FileSystemOperation* operation =
file_system_context_->CreateFileSystemOperation(url, error);
if (!operation)
return NULL;
- if (!operation->AsLocalFileSystemOperation()) {
+ if (!operation->AsFileSystemOperationImpl()) {
*error = base::PLATFORM_FILE_ERROR_INVALID_OPERATION;
delete operation;
return NULL;
diff --git a/webkit/browser/fileapi/file_system_operation_runner.h b/webkit/browser/fileapi/file_system_operation_runner.h
index 2c5389b..67f30b8 100644
--- a/webkit/browser/fileapi/file_system_operation_runner.h
+++ b/webkit/browser/fileapi/file_system_operation_runner.h
@@ -34,7 +34,7 @@ class FileSystemContext;
//
// Some operations (e.g. CopyInForeignFile, RemoveFile, RemoveDirectory,
// CopyFileLocal, MoveFileLocal and SyncGetPlatformPath) are only supported
-// by filesystems which implement LocalFileSystemOperation.
+// by filesystems which implement FileSystemOperationImpl.
// If they are called on other filesystems
// base::PLATFORM_FILE_ERROR_INVALID_OPERATION is returned via callback.
class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner
@@ -263,12 +263,12 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner
const base::FilePath& platform_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
- // A helper method for creating LocalFileSystemOperation for operations
- // that are supported only in LocalFileSystemOperation.
+ // A helper method for creating FileSystemOperationImpl for operations
+ // that are supported only in FileSystemOperationImpl.
// Note that this returns FileSystemOperation, so the caller needs to
- // call AsLocalFileSystemOperation() (which is guaranteed to be non-null
+ // call AsFileSystemOperationImpl() (which is guaranteed to be non-null
// if this method returns without error).
- FileSystemOperation* CreateLocalFileSystemOperation(
+ FileSystemOperation* CreateFileSystemOperationImpl(
const FileSystemURL& url,
base::PlatformFileError* error);
diff --git a/webkit/browser/fileapi/file_writer_delegate_unittest.cc b/webkit/browser/fileapi/file_writer_delegate_unittest.cc
index b3c73fb..340fcb0 100644
--- a/webkit/browser/fileapi/file_writer_delegate_unittest.cc
+++ b/webkit/browser/fileapi/file_writer_delegate_unittest.cc
@@ -22,7 +22,6 @@
#include "webkit/browser/fileapi/file_system_operation_context.h"
#include "webkit/browser/fileapi/file_system_quota_util.h"
#include "webkit/browser/fileapi/file_writer_delegate.h"
-#include "webkit/browser/fileapi/local_file_system_operation.h"
#include "webkit/browser/fileapi/mock_file_system_context.h"
#include "webkit/browser/fileapi/sandbox_file_stream_writer.h"
diff --git a/webkit/browser/fileapi/isolated_file_system_backend.cc b/webkit/browser/fileapi/isolated_file_system_backend.cc
index 4f35932..c46edc0 100644
--- a/webkit/browser/fileapi/isolated_file_system_backend.cc
+++ b/webkit/browser/fileapi/isolated_file_system_backend.cc
@@ -19,11 +19,11 @@
#include "webkit/browser/fileapi/file_system_context.h"
#include "webkit/browser/fileapi/file_system_file_stream_reader.h"
#include "webkit/browser/fileapi/file_system_operation_context.h"
+#include "webkit/browser/fileapi/file_system_operation_impl.h"
#include "webkit/browser/fileapi/file_system_task_runners.h"
#include "webkit/browser/fileapi/isolated_context.h"
#include "webkit/browser/fileapi/isolated_file_util.h"
#include "webkit/browser/fileapi/local_file_stream_writer.h"
-#include "webkit/browser/fileapi/local_file_system_operation.h"
#include "webkit/browser/fileapi/native_file_util.h"
#include "webkit/browser/fileapi/transient_file_util.h"
#include "webkit/common/fileapi/file_system_types.h"
@@ -115,7 +115,7 @@ FileSystemOperation* IsolatedFileSystemBackend::CreateFileSystemOperation(
const FileSystemURL& url,
FileSystemContext* context,
base::PlatformFileError* error_code) const {
- return new LocalFileSystemOperation(
+ return new FileSystemOperationImpl(
url, context, make_scoped_ptr(new FileSystemOperationContext(context)));
}
diff --git a/webkit/browser/fileapi/isolated_file_util_unittest.cc b/webkit/browser/fileapi/isolated_file_util_unittest.cc
index c08ec23..4d6b447 100644
--- a/webkit/browser/fileapi/isolated_file_util_unittest.cc
+++ b/webkit/browser/fileapi/isolated_file_util_unittest.cc
@@ -22,7 +22,6 @@
#include "webkit/browser/fileapi/file_system_task_runners.h"
#include "webkit/browser/fileapi/isolated_context.h"
#include "webkit/browser/fileapi/isolated_file_util.h"
-#include "webkit/browser/fileapi/local_file_system_operation.h"
#include "webkit/browser/fileapi/local_file_util.h"
#include "webkit/browser/fileapi/mock_file_system_context.h"
#include "webkit/browser/fileapi/native_file_util.h"
diff --git a/webkit/browser/fileapi/sandbox_file_system_backend.cc b/webkit/browser/fileapi/sandbox_file_system_backend.cc
index 5251681..9365a4d 100644
--- a/webkit/browser/fileapi/sandbox_file_system_backend.cc
+++ b/webkit/browser/fileapi/sandbox_file_system_backend.cc
@@ -15,9 +15,10 @@
#include "webkit/browser/fileapi/file_system_context.h"
#include "webkit/browser/fileapi/file_system_file_stream_reader.h"
#include "webkit/browser/fileapi/file_system_operation_context.h"
+#include "webkit/browser/fileapi/file_system_operation_impl.h"
#include "webkit/browser/fileapi/file_system_options.h"
#include "webkit/browser/fileapi/file_system_task_runners.h"
-#include "webkit/browser/fileapi/local_file_system_operation.h"
+#include "webkit/browser/fileapi/file_system_usage_cache.h"
#include "webkit/browser/fileapi/obfuscated_file_util.h"
#include "webkit/browser/fileapi/sandbox_context.h"
#include "webkit/browser/fileapi/sandbox_file_stream_writer.h"
@@ -153,7 +154,7 @@ FileSystemOperation* SandboxFileSystemBackend::CreateFileSystemOperation(
else
operation_context->set_quota_limit_type(quota::kQuotaLimitTypeLimited);
- return new LocalFileSystemOperation(url, context, operation_context.Pass());
+ return new FileSystemOperationImpl(url, context, operation_context.Pass());
}
scoped_ptr<webkit_blob::FileStreamReader>
diff --git a/webkit/browser/fileapi/sandbox_file_system_test_helper.h b/webkit/browser/fileapi/sandbox_file_system_test_helper.h
index fa5dd06..5a48872 100644
--- a/webkit/browser/fileapi/sandbox_file_system_test_helper.h
+++ b/webkit/browser/fileapi/sandbox_file_system_test_helper.h
@@ -31,7 +31,6 @@ class FileSystemContext;
class FileSystemFileUtil;
class FileSystemOperationContext;
class FileSystemOperationRunner;
-class LocalFileSystemOperation;
// Filesystem test helper class that encapsulates test environment for
// a given {origin, type} pair. This helper only works for sandboxed
diff --git a/webkit/browser/fileapi/syncable/local_file_sync_context.cc b/webkit/browser/fileapi/syncable/local_file_sync_context.cc
index 764eb42..c543ce1 100644
--- a/webkit/browser/fileapi/syncable/local_file_sync_context.cc
+++ b/webkit/browser/fileapi/syncable/local_file_sync_context.cc
@@ -28,7 +28,6 @@ using fileapi::FileSystemFileUtil;
using fileapi::FileSystemOperation;
using fileapi::FileSystemOperationContext;
using fileapi::FileSystemURL;
-using fileapi::LocalFileSystemOperation;
namespace sync_file_system {
diff --git a/webkit/browser/fileapi/syncable/syncable_file_operation_runner_unittest.cc b/webkit/browser/fileapi/syncable/syncable_file_operation_runner_unittest.cc
index c5b3ef3..f5719ed 100644
--- a/webkit/browser/fileapi/syncable/syncable_file_operation_runner_unittest.cc
+++ b/webkit/browser/fileapi/syncable/syncable_file_operation_runner_unittest.cc
@@ -333,7 +333,7 @@ TEST_F(SyncableFileOperationRunnerTest, QueueAndCancel) {
}
// Test if CopyInForeignFile runs cooperatively with other Sync operations
-// when it is called directly via AsLocalFileSystemOperation.
+// when it is called directly via AsFileSystemOperationImpl.
TEST_F(SyncableFileOperationRunnerTest, CopyInForeignFile) {
const std::string kTestData("test data");
diff --git a/webkit/browser/fileapi/syncable/syncable_file_system_operation.cc b/webkit/browser/fileapi/syncable/syncable_file_system_operation.cc
index 6773809..9908378 100644
--- a/webkit/browser/fileapi/syncable/syncable_file_system_operation.cc
+++ b/webkit/browser/fileapi/syncable/syncable_file_system_operation.cc
@@ -8,8 +8,8 @@
#include "net/url_request/url_request.h"
#include "webkit/browser/fileapi/file_system_context.h"
#include "webkit/browser/fileapi/file_system_operation_context.h"
+#include "webkit/browser/fileapi/file_system_operation_impl.h"
#include "webkit/browser/fileapi/file_system_url.h"
-#include "webkit/browser/fileapi/local_file_system_operation.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"
@@ -18,7 +18,7 @@
using fileapi::FileSystemURL;
using fileapi::FileSystemOperationContext;
-using fileapi::LocalFileSystemOperation;
+using fileapi::FileSystemOperationImpl;
namespace sync_file_system {
@@ -303,7 +303,7 @@ void SyncableFileSystemOperation::CopyInForeignFile(
completion_callback_ = callback;
scoped_ptr<SyncableFileOperationRunner::Task> task(new QueueableTask(
AsWeakPtr(),
- base::Bind(&LocalFileSystemOperation::CopyInForeignFile,
+ base::Bind(&FileSystemOperationImpl::CopyInForeignFile,
NewOperation()->AsWeakPtr(),
src_local_disk_path, dest_url,
base::Bind(&self::DidFinish, AsWeakPtr()))));
@@ -314,8 +314,8 @@ SyncableFileSystemOperation::SyncableFileSystemOperation(
const FileSystemURL& url,
fileapi::FileSystemContext* file_system_context,
scoped_ptr<FileSystemOperationContext> operation_context)
- : LocalFileSystemOperation(url, file_system_context,
- operation_context.Pass()),
+ : FileSystemOperationImpl(url, file_system_context,
+ operation_context.Pass()),
url_(url) {
DCHECK(file_system_context);
if (!file_system_context->sync_context()) {
@@ -328,9 +328,9 @@ SyncableFileSystemOperation::SyncableFileSystemOperation(
is_directory_operation_enabled_ = IsSyncFSDirectoryOperationEnabled();
}
-LocalFileSystemOperation* SyncableFileSystemOperation::NewOperation() {
+FileSystemOperationImpl* SyncableFileSystemOperation::NewOperation() {
DCHECK(operation_context_);
- inflight_operation_.reset(new LocalFileSystemOperation(
+ inflight_operation_.reset(new FileSystemOperationImpl(
url_, file_system_context(), operation_context_.Pass()));
DCHECK(inflight_operation_);
return inflight_operation_.get();
diff --git a/webkit/browser/fileapi/syncable/syncable_file_system_operation.h b/webkit/browser/fileapi/syncable/syncable_file_system_operation.h
index e8e5c65..a47d6e2c 100644
--- a/webkit/browser/fileapi/syncable/syncable_file_system_operation.h
+++ b/webkit/browser/fileapi/syncable/syncable_file_system_operation.h
@@ -12,7 +12,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
-#include "webkit/browser/fileapi/local_file_system_operation.h"
+#include "webkit/browser/fileapi/file_system_operation_impl.h"
#include "webkit/browser/webkit_storage_browser_export.h"
namespace fileapi {
@@ -25,9 +25,9 @@ namespace sync_file_system {
class SyncableFileOperationRunner;
-// A wrapper class of LocalFileSystemOperation for syncable file system.
+// A wrapper class of FileSystemOperationImpl for syncable file system.
class WEBKIT_STORAGE_BROWSER_EXPORT SyncableFileSystemOperation
- : public fileapi::LocalFileSystemOperation,
+ : public fileapi::FileSystemOperationImpl,
public base::SupportsWeakPtr<SyncableFileSystemOperation>,
public base::NonThreadSafe {
public:
@@ -76,7 +76,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SyncableFileSystemOperation
const fileapi::FileSystemURL& path,
const SnapshotFileCallback& callback) OVERRIDE;
- // LocalFileSystemOperation overrides.
+ // FileSystemOperationImpl overrides.
virtual void CopyInForeignFile(const base::FilePath& src_local_disk_path,
const fileapi::FileSystemURL& dest_url,
const StatusCallback& callback) OVERRIDE;
@@ -94,7 +94,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SyncableFileSystemOperation
const fileapi::FileSystemURL& url,
fileapi::FileSystemContext* file_system_context,
scoped_ptr<fileapi::FileSystemOperationContext> operation_context);
- fileapi::LocalFileSystemOperation* NewOperation();
+ fileapi::FileSystemOperationImpl* NewOperation();
void DidFinish(base::PlatformFileError status);
void DidWrite(const WriteCallback& callback,
@@ -107,7 +107,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SyncableFileSystemOperation
const fileapi::FileSystemURL url_;
base::WeakPtr<SyncableFileOperationRunner> operation_runner_;
- scoped_ptr<fileapi::LocalFileSystemOperation> inflight_operation_;
+ scoped_ptr<fileapi::FileSystemOperationImpl> inflight_operation_;
std::vector<fileapi::FileSystemURL> target_paths_;
StatusCallback completion_callback_;
diff --git a/webkit/browser/fileapi/syncable/syncable_file_system_unittest.cc b/webkit/browser/fileapi/syncable/syncable_file_system_unittest.cc
index 824ae59..7d1d3ff 100644
--- a/webkit/browser/fileapi/syncable/syncable_file_system_unittest.cc
+++ b/webkit/browser/fileapi/syncable/syncable_file_system_unittest.cc
@@ -9,7 +9,6 @@
#include "webkit/browser/fileapi/file_system_operation_context.h"
#include "webkit/browser/fileapi/file_system_task_runners.h"
#include "webkit/browser/fileapi/isolated_context.h"
-#include "webkit/browser/fileapi/local_file_system_operation.h"
#include "webkit/browser/fileapi/sandbox_file_system_test_helper.h"
#include "webkit/browser/fileapi/syncable/canned_syncable_file_system.h"
#include "webkit/browser/fileapi/syncable/local_file_change_tracker.h"
diff --git a/webkit/browser/fileapi/syncable/syncable_file_system_util.cc b/webkit/browser/fileapi/syncable/syncable_file_system_util.cc
index 5aadca5..052bed1 100644
--- a/webkit/browser/fileapi/syncable/syncable_file_system_util.cc
+++ b/webkit/browser/fileapi/syncable/syncable_file_system_util.cc
@@ -14,7 +14,6 @@
using fileapi::ExternalMountPoints;
using fileapi::FileSystemContext;
using fileapi::FileSystemURL;
-using fileapi::LocalFileSystemOperation;
namespace sync_file_system {
diff --git a/webkit/browser/fileapi/syncable/syncable_file_system_util.h b/webkit/browser/fileapi/syncable/syncable_file_system_util.h
index f71d96d..41636c7 100644
--- a/webkit/browser/fileapi/syncable/syncable_file_system_util.h
+++ b/webkit/browser/fileapi/syncable/syncable_file_system_util.h
@@ -14,7 +14,6 @@
namespace fileapi {
class FileSystemContext;
class FileSystemURL;
-class LocalFileSystemOperation;
}
namespace sync_file_system {
diff --git a/webkit/browser/fileapi/test_file_system_backend.cc b/webkit/browser/fileapi/test_file_system_backend.cc
index 547d6eb..569800f 100644
--- a/webkit/browser/fileapi/test_file_system_backend.cc
+++ b/webkit/browser/fileapi/test_file_system_backend.cc
@@ -14,8 +14,8 @@
#include "webkit/browser/fileapi/file_observers.h"
#include "webkit/browser/fileapi/file_system_file_stream_reader.h"
#include "webkit/browser/fileapi/file_system_operation_context.h"
+#include "webkit/browser/fileapi/file_system_operation_impl.h"
#include "webkit/browser/fileapi/file_system_quota_util.h"
-#include "webkit/browser/fileapi/local_file_system_operation.h"
#include "webkit/browser/fileapi/local_file_util.h"
#include "webkit/browser/fileapi/native_file_util.h"
#include "webkit/browser/fileapi/sandbox_file_stream_writer.h"
@@ -204,7 +204,7 @@ FileSystemOperation* TestFileSystemBackend::CreateFileSystemOperation(
operation_context->set_change_observers(
*quota_util_->GetChangeObservers(url.type()));
operation_context->set_root_path(base_path_);
- return new LocalFileSystemOperation(url, context, operation_context.Pass());
+ return new FileSystemOperationImpl(url, context, operation_context.Pass());
}
scoped_ptr<webkit_blob::FileStreamReader>
diff --git a/webkit/storage_browser.gyp b/webkit/storage_browser.gyp
index c5d8b86..b72e0aa 100644
--- a/webkit/storage_browser.gyp
+++ b/webkit/storage_browser.gyp
@@ -135,6 +135,8 @@
'browser/fileapi/file_system_operation.h',
'browser/fileapi/file_system_operation_context.cc',
'browser/fileapi/file_system_operation_context.h',
+ 'browser/fileapi/file_system_operation_impl.cc',
+ 'browser/fileapi/file_system_operation_impl.h',
'browser/fileapi/file_system_operation_runner.cc',
'browser/fileapi/file_system_operation_runner.h',
'browser/fileapi/file_system_options.cc',
@@ -162,8 +164,6 @@
'browser/fileapi/isolated_file_util.h',
'browser/fileapi/local_file_stream_writer.cc',
'browser/fileapi/local_file_stream_writer.h',
- 'browser/fileapi/local_file_system_operation.cc',
- 'browser/fileapi/local_file_system_operation.h',
'browser/fileapi/local_file_util.cc',
'browser/fileapi/local_file_util.h',
'browser/fileapi/mount_points.cc',