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

Unified Diff: chrome/browser/sync_file_system/drive_backend/list_changes_task.cc

Issue 443793003: [SyncFS] Clear dirty flag on changelist application phase (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/drive_backend/list_changes_task.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/list_changes_task.cc b/chrome/browser/sync_file_system/drive_backend/list_changes_task.cc
index 01cb0fbc40e8bf55067a9fcec5bf2e60214ae38a..c6273d2cc8dfc00182c431b74ecc575a27903a12 100644
--- a/chrome/browser/sync_file_system/drive_backend/list_changes_task.cc
+++ b/chrome/browser/sync_file_system/drive_backend/list_changes_task.cc
@@ -113,9 +113,27 @@ void ListChangesTask::CheckInChangeList(int64 largest_change_id,
"Got %" PRIuS " changes, updating MetadataDatabase.",
change_list_.size()));
+ DCHECK(file_ids_.empty());
+ file_ids_.reserve(change_list_.size());
+ for (size_t i = 0; i < change_list_.size(); ++i)
+ file_ids_.push_back(change_list_[i]->file_id());
+
metadata_database()->UpdateByChangeList(
largest_change_id,
change_list_.Pass(),
+ base::Bind(&ListChangesTask::DidCheckInChangeList,
+ weak_ptr_factory_.GetWeakPtr(), base::Passed(&token)));
+}
+
+void ListChangesTask::DidCheckInChangeList(scoped_ptr<SyncTaskToken> token,
+ SyncStatusCode status) {
+ if (status != SYNC_STATUS_OK) {
+ SyncTaskManager::NotifyTaskDone(token.Pass(), status);
+ return;
+ }
+
+ metadata_database()->SweepDirtyTrackers(
+ file_ids_,
base::Bind(&SyncTaskManager::NotifyTaskDone, base::Passed(&token)));
}

Powered by Google App Engine
This is Rietveld 408576698