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

Unified Diff: sync/internal_api/sync_manager_impl.cc

Issue 10824252: Revert 150990 - [Sync] Avoid unregistering object IDs on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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/internal_api/sync_manager_impl.h ('k') | sync/internal_api/sync_manager_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « sync/internal_api/sync_manager_impl.h ('k') | sync/internal_api/sync_manager_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698