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

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

Issue 24106002: Add SNAPSHOT sync mode to LocalFileSyncContext::PrepareForSync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: change handling 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_change_tracker.h
diff --git a/chrome/browser/sync_file_system/local/local_file_change_tracker.h b/chrome/browser/sync_file_system/local/local_file_change_tracker.h
index 916c9b21c988265268f2cbf9158abf4a48581fa3..5c75917b6ffed18f428995686c76e3554dfecf45 100644
--- a/chrome/browser/sync_file_system/local/local_file_change_tracker.h
+++ b/chrome/browser/sync_file_system/local/local_file_change_tracker.h
@@ -75,6 +75,17 @@ class LocalFileChangeTracker
// Clears the pending changes recorded in this tracker for |url|.
void ClearChangesForURL(const fileapi::FileSystemURL& url);
+ // Creates a fresh (empty) in-memory record for |url|.
+ // Note that new changes are recorded to the mirror too.
+ void CreateFreshMirrorForURL(const fileapi::FileSystemURL& url);
+
+ // Removes a mirror for |url|, and commit the change status to database.
nhiroki 2013/09/13 06:23:08 commit -> commits
kinuko 2013/09/13 08:21:46 Done.
+ void RemoveMirrorAndCommitChangesForURL(const fileapi::FileSystemURL& url);
+
+ // Reset the changes to the ones recorded in mirror for |url|, and commit the
nhiroki 2013/09/13 06:23:08 Reset -> Resets commit -> commits
kinuko 2013/09/13 08:21:46 Done.
+ // updated change status to database.
+ void ResetToMirrorAndCommitChangesForURL(const fileapi::FileSystemURL& url);
+
// Called by FileSyncService at the startup time to restore last dirty changes
// left after the last shutdown (if any).
SyncStatusCode Initialize(fileapi::FileSystemContext* file_system_context);
@@ -123,6 +134,12 @@ class LocalFileChangeTracker
void RecordChange(const fileapi::FileSystemURL& url,
const FileChange& change);
+ static void RecordChangeToChangeMaps(const fileapi::FileSystemURL& url,
+ const FileChange& change,
+ int change_seq,
+ FileChangeMap* changes,
+ ChangeSeqMap* change_seqs);
+
bool initialized_;
scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
@@ -130,6 +147,9 @@ class LocalFileChangeTracker
FileChangeMap changes_;
ChangeSeqMap change_seqs_;
+ // For mirrors.
+ FileChangeMap mirror_changes_;
+
scoped_ptr<TrackerDB> tracker_db_;
// Change sequence number. Briefly gives a hint about the order of changes,

Powered by Google App Engine
This is Rietveld 408576698