| Index: sync/sessions/sync_session_context.cc
|
| diff --git a/sync/sessions/sync_session_context.cc b/sync/sessions/sync_session_context.cc
|
| index 78b34427c937d8f337da172e5501f70c64660efb..d44591d79d852da92acded66ea8ac35475bec1f7 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),
|
| + update_handler_deleter_(&update_handler_map_),
|
| commit_contributor_deleter_(&commit_contributor_map_),
|
| extensions_activity_(extensions_activity),
|
| notifications_enabled_(false),
|
| @@ -50,14 +51,22 @@ void SyncSessionContext::set_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_);
|
| + // better way to initialize the set of CommitContributors and UpdateHandlers.
|
| ModelTypeSet enabled_types = GetRoutingInfoTypes(routing_info);
|
| +
|
| + STLDeleteValues<CommitContributorMap>(&commit_contributor_map_);
|
| 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));
|
| }
|
| +
|
| + STLDeleteValues<UpdateHandlerMap>(&update_handler_map_);
|
| + for (ModelTypeSet::Iterator it = enabled_types.First(); it.Good(); it.Inc()) {
|
| + SyncDirectoryUpdateHandler* handler =
|
| + new SyncDirectoryUpdateHandler(directory(), it.Get());
|
| + update_handler_map_.insert(std::make_pair(it.Get(), handler));
|
| + }
|
| }
|
|
|
| } // namespace sessions
|
|
|