| Index: sync/internal_api/sync_manager_impl.cc
|
| diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc
|
| index 950e280370a16d871598251792294b8bcf257481..acb244ee39f83eb022e5ebae9f054d34f10b7830 100644
|
| --- a/sync/internal_api/sync_manager_impl.cc
|
| +++ b/sync/internal_api/sync_manager_impl.cc
|
| @@ -63,6 +63,8 @@ using syncable::SPECIFICS;
|
|
|
| namespace {
|
|
|
| +const char kHandlerName[] = "SyncManagerImpl";
|
| +
|
| // Delays for syncer nudges.
|
| static const int kDefaultNudgeDelayMilliseconds = 200;
|
| static const int kPreferencesNudgeDelayMilliseconds = 2000;
|
| @@ -396,6 +398,9 @@ bool SyncManagerImpl::Init(
|
| change_delegate_ = change_delegate;
|
|
|
| sync_notifier_ = sync_notifier.Pass();
|
| + if (sync_notifier_.get()) {
|
| + sync_notifier_->SetHandler(kHandlerName, this);
|
| + }
|
|
|
| AddObserver(&js_sync_manager_observer_);
|
| SetJsEventHandler(event_handler);
|
| @@ -734,14 +739,20 @@ void SyncManagerImpl::UpdateEnabledTypes(
|
| const ModelTypeSet& enabled_types) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| sync_notifier_->UpdateRegisteredIds(
|
| - this,
|
| + kHandlerName,
|
| ModelTypeSetToObjectIdSet(enabled_types));
|
| }
|
|
|
| +void SyncManagerImpl::SetInvalidationHandler(
|
| + const std::string& handler_name, SyncNotifierObserver* handler) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| + sync_notifier_->SetHandler(handler_name, handler);
|
| +}
|
| +
|
| void SyncManagerImpl::UpdateRegisteredInvalidationIds(
|
| - SyncNotifierObserver* handler, const ObjectIdSet& ids) {
|
| + const std::string& handler_name, const ObjectIdSet& ids) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| - sync_notifier_->UpdateRegisteredIds(handler, ids);
|
| + sync_notifier_->UpdateRegisteredIds(handler_name, ids);
|
| }
|
|
|
| void SyncManagerImpl::SetEncryptionPassphrase(
|
| @@ -1216,7 +1227,7 @@ void SyncManagerImpl::ShutdownOnSyncThread() {
|
| RemoveObserver(&debug_info_event_listener_);
|
|
|
| if (sync_notifier_.get()) {
|
| - sync_notifier_->UpdateRegisteredIds(this, ObjectIdSet());
|
| + sync_notifier_->SetHandler(kHandlerName, NULL);
|
| }
|
| sync_notifier_.reset();
|
|
|
|
|