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

Unified Diff: chrome/browser/sync_file_system/local/local_file_sync_service.cc

Issue 24106002: Add SNAPSHOT sync mode to LocalFileSyncContext::PrepareForSync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « chrome/browser/sync_file_system/local/local_file_sync_context_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/local/local_file_sync_service.cc
diff --git a/chrome/browser/sync_file_system/local/local_file_sync_service.cc b/chrome/browser/sync_file_system/local/local_file_sync_service.cc
index a6e5414147c8be8414c9d5b1360c67c19bbb3617..33fbb34757feabae27d3aacca15f3c41bc094940 100644
--- a/chrome/browser/sync_file_system/local/local_file_sync_service.cc
+++ b/chrome/browser/sync_file_system/local/local_file_sync_service.cc
@@ -236,6 +236,7 @@ void LocalFileSyncService::PrepareForProcessRemoteChange(
DCHECK(ContainsKey(origin_to_contexts_, url.origin()));
sync_context_->PrepareForSync(
origin_to_contexts_[url.origin()], url,
+ LocalFileSyncContext::SYNC_EXCLUSIVE,
base::Bind(&PrepareForProcessRemoteChangeCallbackAdapter, callback));
}
@@ -418,18 +419,11 @@ void LocalFileSyncService::ProcessNextChangeForURL(
const FileSystemURL& url = sync_file_info.url;
if (status != SYNC_STATUS_OK || changes.empty()) {
- if (status == SYNC_STATUS_OK || status == SYNC_STATUS_HAS_CONFLICT) {
- // Clear the recorded changes for the URL if the sync was successfull
- // OR has failed due to conflict (so that we won't stick to the same
- // conflicting file again and again).
- DCHECK(ContainsKey(origin_to_contexts_, url.origin()));
- sync_context_->ClearChangesForURL(
- origin_to_contexts_[url.origin()], url,
- base::Bind(&LocalFileSyncService::RunLocalSyncCallback,
- AsWeakPtr(), status, url));
- return;
- }
- RunLocalSyncCallback(status, url);
+ DCHECK(ContainsKey(origin_to_contexts_, url.origin()));
+ sync_context_->CommitChangeStatusForURL(
+ origin_to_contexts_[url.origin()], url, status,
+ base::Bind(&LocalFileSyncService::RunLocalSyncCallback,
+ AsWeakPtr(), status, url));
return;
}
« no previous file with comments | « chrome/browser/sync_file_system/local/local_file_sync_context_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698