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

Unified Diff: components/sync/sessions_impl/model_type_registry.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
Index: components/sync/sessions_impl/model_type_registry.cc
diff --git a/sync/sessions/model_type_registry.cc b/components/sync/sessions_impl/model_type_registry.cc
similarity index 89%
rename from sync/sessions/model_type_registry.cc
rename to components/sync/sessions_impl/model_type_registry.cc
index 08fbbad0a0f82453ea206245880eb12c1df7b096..d20d1641628fcb82c0a293332ba7b5726766b098 100644
--- a/sync/sessions/model_type_registry.cc
+++ b/components/sync/sessions_impl/model_type_registry.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sync/sessions/model_type_registry.h"
+#include "components/sync/sessions_impl/model_type_registry.h"
#include <stddef.h>
@@ -12,14 +12,14 @@
#include "base/memory/ptr_util.h"
#include "base/observer_list.h"
#include "base/threading/thread_task_runner_handle.h"
-#include "sync/engine/commit_queue.h"
-#include "sync/engine/directory_commit_contributor.h"
-#include "sync/engine/directory_update_handler.h"
-#include "sync/engine/model_type_worker.h"
-#include "sync/internal_api/public/activation_context.h"
-#include "sync/internal_api/public/model_type_processor.h"
-#include "sync/sessions/directory_type_debug_info_emitter.h"
-#include "sync/util/cryptographer.h"
+#include "components/sync/base/cryptographer.h"
+#include "components/sync/core/activation_context.h"
+#include "components/sync/core/model_type_processor.h"
+#include "components/sync/engine_impl/commit_queue.h"
+#include "components/sync/engine_impl/directory_commit_contributor.h"
+#include "components/sync/engine_impl/directory_update_handler.h"
+#include "components/sync/engine_impl/model_type_worker.h"
+#include "components/sync/sessions_impl/directory_type_debug_info_emitter.h"
namespace syncer {
@@ -55,7 +55,7 @@ void CommitQueueProxy::EnqueueForCommit(
} // namespace
ModelTypeRegistry::ModelTypeRegistry(
- const std::vector<scoped_refptr<ModelSafeWorker> >& workers,
+ const std::vector<scoped_refptr<ModelSafeWorker>>& workers,
syncable::Directory* directory,
NudgeHandler* nudge_handler)
: directory_(directory),
@@ -67,16 +67,15 @@ ModelTypeRegistry::ModelTypeRegistry(
}
}
-ModelTypeRegistry::~ModelTypeRegistry() {
-}
+ModelTypeRegistry::~ModelTypeRegistry() {}
void ModelTypeRegistry::SetEnabledDirectoryTypes(
const ModelSafeRoutingInfo& routing_info) {
// Remove all existing directory processors and delete them. The
// DebugInfoEmitters are not deleted here, since we want to preserve their
// counters.
- for (ModelTypeSet::Iterator it = enabled_directory_types_.First();
- it.Good(); it.Inc()) {
+ for (ModelTypeSet::Iterator it = enabled_directory_types_.First(); it.Good();
+ it.Inc()) {
size_t result1 = update_handler_map_.erase(it.Get());
size_t result2 = commit_contributor_map_.erase(it.Get());
DCHECK_EQ(1U, result1);
@@ -97,7 +96,7 @@ void ModelTypeRegistry::SetEnabledDirectoryTypes(
ModelSafeGroup group = routing_iter->second;
if (group == GROUP_NON_BLOCKING)
continue;
- std::map<ModelSafeGroup, scoped_refptr<ModelSafeWorker> >::iterator
+ std::map<ModelSafeGroup, scoped_refptr<ModelSafeWorker>>::iterator
worker_it = workers_map_.find(group);
DCHECK(worker_it != workers_map_.end());
scoped_refptr<ModelSafeWorker> worker = worker_it->second;
@@ -135,8 +134,8 @@ void ModelTypeRegistry::SetEnabledDirectoryTypes(
enabled_directory_types_.Put(type);
}
- DCHECK(Intersection(GetEnabledDirectoryTypes(),
- GetEnabledNonBlockingTypes()).Empty());
+ DCHECK(Intersection(GetEnabledDirectoryTypes(), GetEnabledNonBlockingTypes())
+ .Empty());
}
void ModelTypeRegistry::ConnectType(
@@ -175,8 +174,8 @@ void ModelTypeRegistry::ConnectType(
// The container takes ownership.
model_type_workers_.push_back(std::move(worker));
- DCHECK(Intersection(GetEnabledDirectoryTypes(),
- GetEnabledNonBlockingTypes()).Empty());
+ DCHECK(Intersection(GetEnabledDirectoryTypes(), GetEnabledNonBlockingTypes())
+ .Empty());
}
void ModelTypeRegistry::DisconnectType(ModelType type) {
@@ -252,7 +251,7 @@ bool ModelTypeRegistry::HasDirectoryTypeDebugInfoObserver(
void ModelTypeRegistry::RequestEmitDebugInfo() {
for (DirectoryTypeDebugInfoEmitterMap::iterator it =
- directory_type_debug_info_emitter_map_.begin();
+ directory_type_debug_info_emitter_map_.begin();
it != directory_type_debug_info_emitter_map_.end(); ++it) {
it->second->EmitCommitCountersUpdate();
it->second->EmitUpdateCountersUpdate();
@@ -266,16 +265,13 @@ base::WeakPtr<syncer_v2::ModelTypeConnector> ModelTypeRegistry::AsWeakPtr() {
void ModelTypeRegistry::OnPassphraseRequired(
PassphraseRequiredReason reason,
- const sync_pb::EncryptedData& pending_keys) {
-}
+ const sync_pb::EncryptedData& pending_keys) {}
-void ModelTypeRegistry::OnPassphraseAccepted() {
-}
+void ModelTypeRegistry::OnPassphraseAccepted() {}
void ModelTypeRegistry::OnBootstrapTokenUpdated(
const std::string& bootstrap_token,
- BootstrapTokenType type) {
-}
+ BootstrapTokenType type) {}
void ModelTypeRegistry::OnEncryptedTypesChanged(ModelTypeSet encrypted_types,
bool encrypt_everything) {
@@ -283,8 +279,7 @@ void ModelTypeRegistry::OnEncryptedTypesChanged(ModelTypeSet encrypted_types,
OnEncryptionStateChanged();
}
-void ModelTypeRegistry::OnEncryptionComplete() {
-}
+void ModelTypeRegistry::OnEncryptionComplete() {}
void ModelTypeRegistry::OnCryptographerStateChanged(
Cryptographer* cryptographer) {
@@ -293,12 +288,10 @@ void ModelTypeRegistry::OnCryptographerStateChanged(
}
void ModelTypeRegistry::OnPassphraseTypeChanged(PassphraseType type,
- base::Time passphrase_time) {
-}
+ base::Time passphrase_time) {}
void ModelTypeRegistry::OnLocalSetPassphraseEncryption(
- const SyncEncryptionHandler::NigoriState& nigori_state) {
-}
+ const SyncEncryptionHandler::NigoriState& nigori_state) {}
ModelTypeSet ModelTypeRegistry::GetEnabledDirectoryTypes() const {
return enabled_directory_types_;
« no previous file with comments | « components/sync/sessions_impl/model_type_registry.h ('k') | components/sync/sessions_impl/model_type_registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698