Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Unified Diff: webkit/fileapi/local_file_system_operation.h

Issue 14341004: FileAPI code should not rely on or assume specific MountPointProvider types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/fileapi/isolated_mount_point_provider.cc ('k') | webkit/fileapi/local_file_system_operation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/local_file_system_operation.h
diff --git a/webkit/fileapi/local_file_system_operation.h b/webkit/fileapi/local_file_system_operation.h
index 1bfa32eb695923e7b8cc1cfd938c93a5fa789d39..4e056d1bf4a0f3b6cf57df4ac9895b7c1590be43 100644
--- a/webkit/fileapi/local_file_system_operation.h
+++ b/webkit/fileapi/local_file_system_operation.h
@@ -34,6 +34,14 @@ class RecursiveOperationDelegate;
class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
: public NON_EXPORTED_BASE(FileSystemOperation) {
public:
+ // NOTE: This constructor should not be called outside MountPointProviders;
+ // instead please consider using
+ // file_system_context->CreateFileSystemOperation() to instantiate
+ // an appropriate FileSystemOperation.
+ LocalFileSystemOperation(
+ FileSystemContext* file_system_context,
+ scoped_ptr<FileSystemOperationContext> operation_context);
+
virtual ~LocalFileSystemOperation();
// FileSystemOperation overrides.
@@ -158,34 +166,6 @@ class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
void SyncGetPlatformPath(const FileSystemURL& url,
base::FilePath* platform_path);
- private:
- enum OperationMode {
- OPERATION_MODE_READ,
- OPERATION_MODE_WRITE,
- };
-
- // Only MountPointProviders or testing class can create a
- // new operation directly.
- friend class FileSystemTestHelper;
- friend class IsolatedMountPointProvider;
- friend class SandboxMountPointProvider;
- friend class TestMountPointProvider;
- friend class chromeos::CrosMountPointProvider;
-
- friend class LocalFileSystemOperationTest;
- friend class LocalFileSystemOperationWriteTest;
- friend class FileWriterDelegateTest;
- friend class FileSystemQuotaTest;
- friend class LocalFileSystemTestOriginHelper;
-
- friend class RecursiveOperationDelegate;
- friend class CrossOperationDelegate;
- friend class sync_file_system::SyncableFileSystemOperation;
-
- LocalFileSystemOperation(
- FileSystemContext* file_system_context,
- scoped_ptr<FileSystemOperationContext> operation_context);
-
FileSystemContext* file_system_context() const {
return file_system_context_;
}
@@ -196,6 +176,14 @@ class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
return operation_context_.get();
}
+ private:
+ enum OperationMode {
+ OPERATION_MODE_READ,
+ OPERATION_MODE_WRITE,
+ };
+
+ friend class sync_file_system::SyncableFileSystemOperation;
+
// Queries the quota and usage and then runs the given |task|.
// If an error occurs during the quota query it runs |error_callback| instead.
void GetUsageAndQuotaThenRunTask(
@@ -316,7 +304,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
// this holds non-null value and points to the parent operation.
// TODO(kinuko): Cleanup this when we finish cleaning up the
// FileSystemOperation lifetime issue.
- LocalFileSystemOperation* parent_operation_;
+ base::WeakPtr<LocalFileSystemOperation> parent_operation_;
// These are all used only by Write().
friend class FileWriterDelegate;
« no previous file with comments | « webkit/fileapi/isolated_mount_point_provider.cc ('k') | webkit/fileapi/local_file_system_operation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698