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

Unified Diff: chrome/browser/sync_file_system/local/local_file_sync_context.h

Issue 23578026: Use SNAPSHOT sync mode for LocalSync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased on thread_bundle fix Created 7 years, 3 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
Index: chrome/browser/sync_file_system/local/local_file_sync_context.h
diff --git a/chrome/browser/sync_file_system/local/local_file_sync_context.h b/chrome/browser/sync_file_system/local/local_file_sync_context.h
index 7a4cfe703ee27be261888b49036ba69c633364a5..788721dfdf3964ea0f8cbec34ad4492fe421ff0e 100644
--- a/chrome/browser/sync_file_system/local/local_file_sync_context.h
+++ b/chrome/browser/sync_file_system/local/local_file_sync_context.h
@@ -33,6 +33,10 @@ class FileSystemContext;
class FileSystemURL;
}
+namespace webkit_blob {
+class ScopedFile;
+}
+
namespace sync_file_system {
class FileChange;
@@ -56,14 +60,17 @@ class LocalFileSyncContext
};
typedef base::Callback<void(
- SyncStatusCode status, const LocalFileSyncInfo& sync_file_info)>
+ SyncStatusCode status,
+ const LocalFileSyncInfo& sync_file_info,
+ scoped_ptr<webkit_blob::ScopedFile> snapshot)>
LocalFileSyncInfoCallback;
typedef base::Callback<void(SyncStatusCode status,
bool has_pending_changes)>
HasPendingLocalChangeCallback;
- LocalFileSyncContext(base::SingleThreadTaskRunner* ui_task_runner,
+ LocalFileSyncContext(const base::FilePath& base_path,
+ base::SingleThreadTaskRunner* ui_task_runner,
base::SingleThreadTaskRunner* io_task_runner);
// Initializes |file_system_context| for syncable file operations
@@ -237,7 +244,8 @@ class LocalFileSyncContext
std::deque<fileapi::FileSystemURL>* remaining_urls,
const LocalFileSyncInfoCallback& callback,
SyncStatusCode status,
- const LocalFileSyncInfo& sync_file_info);
+ const LocalFileSyncInfo& sync_file_info,
+ scoped_ptr<webkit_blob::ScopedFile> snapshot);
// Callback routine for PrepareForSync and GetFileForLocalSync.
void DidGetWritingStatusForSync(
@@ -247,9 +255,16 @@ class LocalFileSyncContext
SyncMode sync_mode,
const LocalFileSyncInfoCallback& callback);
- // Helper routine for ClearSyncFlagForURL.
- void EnableWritingOnIOThread(const fileapi::FileSystemURL& url,
- bool may_have_updates);
+ // Helper routine for sync/writing flag handling, primarily for
+ // ClearSyncFlagForURL but is also called by other internal routines.
+ // If |keep_url_in_writing| is true this increments the writing counter
+ // for |url| (after clearing syncing flag), so that the caller can
+ // continue to hold a shared lock on the URL.
+ // (The counter must be manually decremented by EndWritingOnIOThread
+ // if that's the case)
+ void ClearSyncFlagOnIOThread(const fileapi::FileSystemURL& url,
+ bool keep_url_in_writing);
+ void EndWritingOnIOThread(const fileapi::FileSystemURL& url);
void DidRemoveExistingEntryForApplyRemoteChange(
fileapi::FileSystemContext* file_system_context,
@@ -279,6 +294,8 @@ class LocalFileSyncContext
const StatusCallback& callback,
base::PlatformFileError error);
+ const base::FilePath local_base_path_;
+
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;

Powered by Google App Engine
This is Rietveld 408576698