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

Unified Diff: sync/sessions/model_type_registry.cc

Issue 224563004: sync: Re-implement getAllNodes WebUI function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment fix Created 6 years, 9 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/sessions/model_type_registry.h ('k') | sync/sync_core.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/model_type_registry.cc
diff --git a/sync/sessions/model_type_registry.cc b/sync/sessions/model_type_registry.cc
index f93cba3e32ed3bc0d7e1712be536d5884ea22841..4bf374ed272c96be3cd6bf5d97f3aa6a1cdba79a 100644
--- a/sync/sessions/model_type_registry.cc
+++ b/sync/sessions/model_type_registry.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/message_loop/message_loop_proxy.h"
#include "sync/engine/directory_commit_contributor.h"
+#include "sync/engine/directory_type_debug_info_emitter.h"
#include "sync/engine/directory_update_handler.h"
#include "sync/engine/non_blocking_type_processor_core.h"
#include "sync/internal_api/public/non_blocking_type_processor.h"
@@ -34,14 +35,17 @@ void ModelTypeRegistry::SetEnabledDirectoryTypes(
it.Good(); it.Inc()) {
size_t result1 = update_handler_map_.erase(it.Get());
size_t result2 = commit_contributor_map_.erase(it.Get());
+ size_t result3 = directory_type_debug_info_emitter_map_.erase(it.Get());
DCHECK_EQ(1U, result1);
DCHECK_EQ(1U, result2);
+ DCHECK_EQ(1U, result3);
}
// Clear the old instances of directory update handlers and commit
// contributors, deleting their contents in the processs.
directory_update_handlers_.clear();
directory_commit_contributors_.clear();
+ directory_type_debug_info_emitters_.clear();
// Create new ones and add them to the appropriate containers.
for (ModelSafeRoutingInfo::const_iterator routing_iter = routing_info.begin();
@@ -57,10 +61,13 @@ void ModelTypeRegistry::SetEnabledDirectoryTypes(
new DirectoryCommitContributor(directory_, type);
DirectoryUpdateHandler* updater =
new DirectoryUpdateHandler(directory_, type, worker);
+ DirectoryTypeDebugInfoEmitter* emitter =
+ new DirectoryTypeDebugInfoEmitter(directory_, type);
// These containers take ownership of their contents.
directory_commit_contributors_.push_back(committer);
directory_update_handlers_.push_back(updater);
+ directory_type_debug_info_emitters_.push_back(emitter);
bool inserted1 =
update_handler_map_.insert(std::make_pair(type, updater)).second;
@@ -69,6 +76,11 @@ void ModelTypeRegistry::SetEnabledDirectoryTypes(
bool inserted2 =
commit_contributor_map_.insert(std::make_pair(type, committer)).second;
DCHECK(inserted2) << "Attempt to override existing type handler in map";
+
+ bool inserted3 =
+ directory_type_debug_info_emitter_map_.insert(
+ std::make_pair(type, emitter)).second;
+ DCHECK(inserted3) << "Attempt to override existing type handler in map";
}
enabled_directory_types_ = GetRoutingInfoTypes(routing_info);
@@ -142,6 +154,11 @@ CommitContributorMap* ModelTypeRegistry::commit_contributor_map() {
return &commit_contributor_map_;
}
+DirectoryTypeDebugInfoEmitterMap*
+ModelTypeRegistry::directory_type_debug_info_emitter_map() {
+ return &directory_type_debug_info_emitter_map_;
+}
+
ModelTypeSet ModelTypeRegistry::GetEnabledDirectoryTypes() const {
return enabled_directory_types_;
}
« no previous file with comments | « sync/sessions/model_type_registry.h ('k') | sync/sync_core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698