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

Side by Side Diff: components/sync/engine_impl/directory_commit_contribution.cc

Issue 2258873003: [Sync] Move sessions/ to engine/cycle/ and rename things to match. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/sync/engine_impl/directory_commit_contribution.h" 5 #include "components/sync/engine_impl/directory_commit_contribution.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
11 #include <set> 11 #include <set>
12 12
13 #include "components/sync/engine/cycle/commit_counters.h"
13 #include "components/sync/engine_impl/commit_util.h" 14 #include "components/sync/engine_impl/commit_util.h"
14 #include "components/sync/engine_impl/get_commit_ids.h" 15 #include "components/sync/engine_impl/get_commit_ids.h"
15 #include "components/sync/engine_impl/syncer_util.h" 16 #include "components/sync/engine_impl/syncer_util.h"
16 #include "components/sync/sessions/commit_counters.h"
17 #include "components/sync/syncable/model_neutral_mutable_entry.h" 17 #include "components/sync/syncable/model_neutral_mutable_entry.h"
18 #include "components/sync/syncable/syncable_model_neutral_write_transaction.h" 18 #include "components/sync/syncable/syncable_model_neutral_write_transaction.h"
19 19
20 namespace syncer { 20 namespace syncer {
21 21
22 using syncable::GET_BY_HANDLE; 22 using syncable::GET_BY_HANDLE;
23 using syncable::SYNCER; 23 using syncable::SYNCER;
24 24
25 DirectoryCommitContribution::~DirectoryCommitContribution() { 25 DirectoryCommitContribution::~DirectoryCommitContribution() {
26 DCHECK(!syncing_bits_set_); 26 DCHECK(!syncing_bits_set_);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 RepeatedPtrFieldBackInserter(commit_message->mutable_entries())); 68 RepeatedPtrFieldBackInserter(commit_message->mutable_entries()));
69 if (!context_.context().empty()) 69 if (!context_.context().empty())
70 commit_message->add_client_contexts()->Swap(&context_); 70 commit_message->add_client_contexts()->Swap(&context_);
71 71
72 CommitCounters* counters = debug_info_emitter_->GetMutableCommitCounters(); 72 CommitCounters* counters = debug_info_emitter_->GetMutableCommitCounters();
73 counters->num_commits_attempted += entities_.size(); 73 counters->num_commits_attempted += entities_.size();
74 } 74 }
75 75
76 SyncerError DirectoryCommitContribution::ProcessCommitResponse( 76 SyncerError DirectoryCommitContribution::ProcessCommitResponse(
77 const sync_pb::ClientToServerResponse& response, 77 const sync_pb::ClientToServerResponse& response,
78 sessions::StatusController* status) { 78 StatusController* status) {
79 DCHECK(syncing_bits_set_); 79 DCHECK(syncing_bits_set_);
80 const sync_pb::CommitResponse& commit_response = response.commit(); 80 const sync_pb::CommitResponse& commit_response = response.commit();
81 81
82 int transient_error_commits = 0; 82 int transient_error_commits = 0;
83 int conflicting_commits = 0; 83 int conflicting_commits = 0;
84 int error_commits = 0; 84 int error_commits = 0;
85 int successes = 0; 85 int successes = 0;
86 86
87 std::set<syncable::Id> deleted_folders; 87 std::set<syncable::Id> deleted_folders;
88 { 88 {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 // complete but the Cleanup method is called anyways. It appears these are 186 // complete but the Cleanup method is called anyways. It appears these are
187 // unset on the assumption that the sync cycle must have finished properly, 187 // unset on the assumption that the sync cycle must have finished properly,
188 // although that's actually up to the commit response handling logic. 188 // although that's actually up to the commit response handling logic.
189 entry.PutDirtySync(false); 189 entry.PutDirtySync(false);
190 entry.PutSyncing(false); 190 entry.PutSyncing(false);
191 } 191 }
192 syncing_bits_set_ = false; 192 syncing_bits_set_ = false;
193 } 193 }
194 194
195 } // namespace syncer 195 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698