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

Unified Diff: sync/sessions/sync_session_context.cc

Issue 25638003: sync: Implement per-type commit interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Attempt to fix win compile Created 7 years, 2 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/sync_session_context.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/sync_session_context.cc
diff --git a/sync/sessions/sync_session_context.cc b/sync/sessions/sync_session_context.cc
index bf1da3a174c3309aec7df73f128e304a68927948..78b34427c937d8f337da172e5501f70c64660efb 100644
--- a/sync/sessions/sync_session_context.cc
+++ b/sync/sessions/sync_session_context.cc
@@ -23,6 +23,7 @@ SyncSessionContext::SyncSessionContext(
const std::string& invalidator_client_id)
: connection_manager_(connection_manager),
directory_(directory),
+ commit_contributor_deleter_(&commit_contributor_map_),
extensions_activity_(extensions_activity),
notifications_enabled_(false),
max_commit_batch_size_(kDefaultMaxCommitBatchSize),
@@ -44,5 +45,20 @@ SyncSessionContext::SyncSessionContext(
SyncSessionContext::~SyncSessionContext() {
}
+void SyncSessionContext::set_routing_info(
+ const ModelSafeRoutingInfo& routing_info) {
+ routing_info_ = routing_info;
+
+ // TODO(rlarocque): This is not a good long-term solution. We must find a
+ // better way to initialize the set of CommitContributors.
+ STLDeleteValues<CommitContributorMap>(&commit_contributor_map_);
+ ModelTypeSet enabled_types = GetRoutingInfoTypes(routing_info);
+ for (ModelTypeSet::Iterator it = enabled_types.First(); it.Good(); it.Inc()) {
+ SyncDirectoryCommitContributor* contributor =
+ new SyncDirectoryCommitContributor(directory(), it.Get());
+ commit_contributor_map_.insert(std::make_pair(it.Get(), contributor));
+ }
+}
+
} // namespace sessions
} // namespace syncer
« no previous file with comments | « sync/sessions/sync_session_context.h ('k') | sync/sync_core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698