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

Unified Diff: sync/engine/commit_processor.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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 | « sync/engine/commit_processor.h ('k') | sync/engine/commit_queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/commit_processor.cc
diff --git a/sync/engine/commit_processor.cc b/sync/engine/commit_processor.cc
deleted file mode 100644
index 87e2696e6040bce4b0447a8a054ec507a29764c7..0000000000000000000000000000000000000000
--- a/sync/engine/commit_processor.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sync/engine/commit_processor.h"
-
-#include <stddef.h>
-
-#include <utility>
-
-#include "base/metrics/histogram_macros.h"
-#include "sync/engine/commit_contribution.h"
-#include "sync/engine/commit_contributor.h"
-#include "sync/protocol/sync.pb.h"
-
-namespace syncer {
-
-typedef std::map<ModelType, size_t> TypeToIndexMap;
-
-CommitProcessor::CommitProcessor(CommitContributorMap* commit_contributor_map)
- : commit_contributor_map_(commit_contributor_map) {}
-
-CommitProcessor::~CommitProcessor() {}
-
-void CommitProcessor::GatherCommitContributions(
- ModelTypeSet commit_types,
- size_t max_entries,
- bool cookie_jar_mismatch,
- bool cookie_jar_empty,
- Commit::ContributionMap* contributions) {
- size_t num_entries = 0;
- for (ModelTypeSet::Iterator it = commit_types.First();
- it.Good(); it.Inc()) {
- CommitContributorMap::iterator cm_it =
- commit_contributor_map_->find(it.Get());
- if (cm_it == commit_contributor_map_->end()) {
- NOTREACHED()
- << "Could not find requested type " << ModelTypeToString(it.Get())
- << " in contributor map.";
- continue;
- }
- size_t spaces_remaining = max_entries - num_entries;
- std::unique_ptr<CommitContribution> contribution =
- cm_it->second->GetContribution(spaces_remaining);
- if (contribution) {
- num_entries += contribution->GetNumEntries();
- contributions->insert(std::make_pair(it.Get(), std::move(contribution)));
-
- if (it.Get() == SESSIONS) {
- UMA_HISTOGRAM_BOOLEAN("Sync.CookieJarMatchOnNavigation",
- !cookie_jar_mismatch);
- if (cookie_jar_mismatch) {
- UMA_HISTOGRAM_BOOLEAN("Sync.CookieJarEmptyOnMismatch",
- cookie_jar_empty);
- }
- }
- }
- if (num_entries >= max_entries) {
- DCHECK_EQ(num_entries, max_entries)
- << "Number of commit entries exceeeds maximum";
- break;
- }
- }
-}
-
-} // namespace syncer
« no previous file with comments | « sync/engine/commit_processor.h ('k') | sync/engine/commit_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698