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

Unified Diff: webkit/fileapi/syncable/canned_syncable_file_system.h

Issue 11090019: Add LocalFileSyncContext class which wires up profile-owned service and FileSystemContext(s) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments #4 Created 8 years, 2 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/file_system_context.cc ('k') | webkit/fileapi/syncable/canned_syncable_file_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/syncable/canned_syncable_file_system.h
diff --git a/webkit/fileapi/syncable/canned_syncable_file_system.h b/webkit/fileapi/syncable/canned_syncable_file_system.h
index d0b2b2358f61aedc54f9dc47f55786b2dd3730ac..010656720aeb693432f13d5fb30bb5d1ba862b29 100644
--- a/webkit/fileapi/syncable/canned_syncable_file_system.h
+++ b/webkit/fileapi/syncable/canned_syncable_file_system.h
@@ -27,6 +27,7 @@ class QuotaManager;
namespace fileapi {
class FileSystemContext;
+class LocalFileSyncContext;
// A canned syncable filesystem for testing.
// This internally creates its own QuotaManager and FileSystemContext
@@ -45,6 +46,11 @@ class CannedSyncableFileSystem {
// Creates a FileSystemURL for the given (utf8) path string.
FileSystemURL URL(const std::string& path) const;
+ // Initialize this with given |sync_context| if it hasn't
+ // been initialized.
+ SyncStatusCode MaybeInitializeFileSystemContext(
+ LocalFileSyncContext* sync_context);
+
// Opens a new syncable file system.
base::PlatformFileError OpenFileSystem();
@@ -60,6 +66,7 @@ class CannedSyncableFileSystem {
}
// Helper routines to perform file system operations.
+ // OpenFileSystem() must have been called before calling any of them.
// (They run on the current thread and returns synchronously).
base::PlatformFileError CreateDirectory(const FileSystemURL& url);
base::PlatformFileError CreateFile(const FileSystemURL& url);
@@ -78,6 +85,7 @@ class CannedSyncableFileSystem {
void DidOpenFileSystem(base::PlatformFileError result,
const std::string& name,
const GURL& root);
+ void DidInitializeFileSystemContext(SyncStatusCode status);
void StatusCallback(base::PlatformFileError result);
FileSystemOperationContext* NewOperationContext();
@@ -92,6 +100,10 @@ class CannedSyncableFileSystem {
base::PlatformFileError result_;
SyncStatusCode sync_status_;
+ // Boolean flags mainly for helping debug.
+ bool is_filesystem_set_up_;
+ bool is_filesystem_opened_;
+
base::WeakPtrFactory<CannedSyncableFileSystem> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(CannedSyncableFileSystem);
« no previous file with comments | « webkit/fileapi/file_system_context.cc ('k') | webkit/fileapi/syncable/canned_syncable_file_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698