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

Side by Side Diff: sync/engine/commit.cc

Issue 1991973002: [Sync] Add histograms for cookie jar state on Sessions commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 4 years, 7 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
« no previous file with comments | « sync/engine/commit.h ('k') | sync/engine/commit_processor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "sync/engine/commit.h" 5 #include "sync/engine/commit.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/metrics/sparse_histogram.h" 9 #include "base/metrics/sparse_histogram.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 14 matching lines...) Expand all
25 ExtensionsActivity::Records extensions_activity_buffer) 25 ExtensionsActivity::Records extensions_activity_buffer)
26 : contributions_(std::move(contributions)), 26 : contributions_(std::move(contributions)),
27 message_(message), 27 message_(message),
28 extensions_activity_buffer_(extensions_activity_buffer), 28 extensions_activity_buffer_(extensions_activity_buffer),
29 cleaned_up_(false) {} 29 cleaned_up_(false) {}
30 30
31 Commit::~Commit() { 31 Commit::~Commit() {
32 DCHECK(cleaned_up_); 32 DCHECK(cleaned_up_);
33 } 33 }
34 34
35 Commit* Commit::Init( 35 Commit* Commit::Init(ModelTypeSet requested_types,
36 ModelTypeSet requested_types, 36 ModelTypeSet enabled_types,
37 ModelTypeSet enabled_types, 37 size_t max_entries,
38 size_t max_entries, 38 const std::string& account_name,
39 const std::string& account_name, 39 const std::string& cache_guid,
40 const std::string& cache_guid, 40 bool cookie_jar_mismatch,
41 bool cookie_jar_mismatch, 41 bool cookie_jar_empty,
42 CommitProcessor* commit_processor, 42 CommitProcessor* commit_processor,
43 ExtensionsActivity* extensions_activity) { 43 ExtensionsActivity* extensions_activity) {
44 // Gather per-type contributions. 44 // Gather per-type contributions.
45 ContributionMap contributions; 45 ContributionMap contributions;
46 commit_processor->GatherCommitContributions( 46 commit_processor->GatherCommitContributions(requested_types, max_entries,
47 requested_types, 47 cookie_jar_mismatch,
48 max_entries, 48 cookie_jar_empty, &contributions);
49 &contributions);
50 49
51 // Give up if no one had anything to commit. 50 // Give up if no one had anything to commit.
52 if (contributions.empty()) 51 if (contributions.empty())
53 return NULL; 52 return NULL;
54 53
55 sync_pb::ClientToServerMessage message; 54 sync_pb::ClientToServerMessage message;
56 message.set_message_contents(sync_pb::ClientToServerMessage::COMMIT); 55 message.set_message_contents(sync_pb::ClientToServerMessage::COMMIT);
57 message.set_share(account_name); 56 message.set_share(account_name);
58 57
59 sync_pb::CommitMessage* commit_message = message.mutable_commit(); 58 sync_pb::CommitMessage* commit_message = message.mutable_commit();
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 185
187 void Commit::CleanUp() { 186 void Commit::CleanUp() {
188 for (ContributionMap::const_iterator it = contributions_.begin(); 187 for (ContributionMap::const_iterator it = contributions_.begin();
189 it != contributions_.end(); ++it) { 188 it != contributions_.end(); ++it) {
190 it->second->CleanUp(); 189 it->second->CleanUp();
191 } 190 }
192 cleaned_up_ = true; 191 cleaned_up_ = true;
193 } 192 }
194 193
195 } // namespace syncer 194 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/engine/commit.h ('k') | sync/engine/commit_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698