Index: sync/internal_api/sync_manager_impl.cc |
=================================================================== |
--- sync/internal_api/sync_manager_impl.cc (revision 150991) |
+++ sync/internal_api/sync_manager_impl.cc (working copy) |
@@ -396,7 +396,6 @@ |
change_delegate_ = change_delegate; |
sync_notifier_ = sync_notifier.Pass(); |
- sync_notifier_->RegisterHandler(this); |
AddObserver(&js_sync_manager_observer_); |
SetJsEventHandler(event_handler); |
@@ -734,34 +733,18 @@ |
void SyncManagerImpl::UpdateEnabledTypes( |
const ModelTypeSet& enabled_types) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
- DCHECK(initialized_); |
sync_notifier_->UpdateRegisteredIds( |
this, |
ModelTypeSetToObjectIdSet(enabled_types)); |
} |
-void SyncManagerImpl::RegisterInvalidationHandler( |
- SyncNotifierObserver* handler) { |
- DCHECK(thread_checker_.CalledOnValidThread()); |
- DCHECK(initialized_); |
- sync_notifier_->RegisterHandler(handler); |
-} |
- |
void SyncManagerImpl::UpdateRegisteredInvalidationIds( |
SyncNotifierObserver* handler, |
const ObjectIdSet& ids) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
- DCHECK(initialized_); |
sync_notifier_->UpdateRegisteredIds(handler, ids); |
} |
-void SyncManagerImpl::UnregisterInvalidationHandler( |
- SyncNotifierObserver* handler) { |
- DCHECK(thread_checker_.CalledOnValidThread()); |
- DCHECK(initialized_); |
- sync_notifier_->UnregisterHandler(handler); |
-} |
- |
void SyncManagerImpl::SetEncryptionPassphrase( |
const std::string& passphrase, |
bool is_explicit) { |
@@ -1233,17 +1216,14 @@ |
RemoveObserver(&debug_info_event_listener_); |
- // |sync_notifier_| and |connection_manager_| may end up being NULL here in |
- // tests (in synchronous initialization mode). |
- // |
- // TODO(akalin): Fix this behavior. |
- |
- if (sync_notifier_.get()) |
- sync_notifier_->UnregisterHandler(this); |
+ if (sync_notifier_.get()) { |
+ sync_notifier_->UpdateRegisteredIds(this, ObjectIdSet()); |
+ } |
sync_notifier_.reset(); |
- if (connection_manager_.get()) |
+ if (connection_manager_.get()) { |
connection_manager_->RemoveListener(this); |
+ } |
connection_manager_.reset(); |
net::NetworkChangeNotifier::RemoveIPAddressObserver(this); |