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

Unified Diff: chrome/browser/sync/engine/process_commit_response_command.cc

Issue 6588119: First-time sync: asymptotic running time improvement (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/Release
Patch Set: Fix test bug. Created 9 years, 10 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 | « no previous file | chrome/browser/sync/engine/syncer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/process_commit_response_command.cc
diff --git a/chrome/browser/sync/engine/process_commit_response_command.cc b/chrome/browser/sync/engine/process_commit_response_command.cc
index 64eb442864a432d08c47c32085b41fbd5d93c22e..53be5395bf614c0f084352186918a964f1c5194a 100644
--- a/chrome/browser/sync/engine/process_commit_response_command.cc
+++ b/chrome/browser/sync/engine/process_commit_response_command.cc
@@ -135,7 +135,7 @@ void ProcessCommitResponseCommand::ProcessCommitResponse(
set<syncable::Id> deleted_folders;
ConflictProgress* conflict_progress = status->mutable_conflict_progress();
OrderedCommitSet::Projection proj = status->commit_id_projection();
- { // Scope for WriteTransaction.
+ if (!proj.empty()) { // Scope for WriteTransaction.
WriteTransaction trans(dir, SYNCER, __FILE__, __LINE__);
for (size_t i = 0; i < proj.size(); i++) {
CommitResponse::ResponseType response_type =
@@ -435,8 +435,7 @@ void ProcessCommitResponseCommand::OverrideClientFieldsAfterCommit(
// We just committed successfully, so we assume that the position
// value we got applies to the PARENT_ID we submitted.
- syncable::Id new_prev = SyncerUtil::ComputePrevIdFromServerPosition(
- local_entry->write_transaction(), local_entry,
+ syncable::Id new_prev = local_entry->ComputePrevIdFromServerPosition(
local_entry->Get(PARENT_ID));
if (!local_entry->PutPredecessor(new_prev))
LOG(WARNING) << "PutPredecessor failed after successful commit";
« no previous file with comments | « no previous file | chrome/browser/sync/engine/syncer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698