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

Unified Diff: components/browser_sync/profile_sync_service.cc

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Chromeos fix Created 3 years, 11 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
Index: components/browser_sync/profile_sync_service.cc
diff --git a/components/browser_sync/profile_sync_service.cc b/components/browser_sync/profile_sync_service.cc
index 2f050adc20575e9e135b53d271bab19afd530db9..3eaafb86852dac7bf0108d3179ef693cbdb4bf24 100644
--- a/components/browser_sync/profile_sync_service.cc
+++ b/components/browser_sync/profile_sync_service.cc
@@ -676,6 +676,7 @@ void ProfileSyncService::Shutdown() {
UnregisterAuthNotifications();
ShutdownImpl(syncer::BROWSER_SHUTDOWN);
+ NotifyShutdown();
if (sync_error_controller_) {
// Destroy the SyncErrorController when the service shuts down for good.
RemoveObserver(sync_error_controller_.get());
@@ -797,12 +798,17 @@ void ProfileSyncService::UpdateLastSyncedTime() {
void ProfileSyncService::NotifySyncCycleCompleted() {
for (auto& observer : observers_)
- observer.OnSyncCycleCompleted();
+ observer.OnSyncCycleCompleted(this);
}
void ProfileSyncService::NotifyForeignSessionUpdated() {
for (auto& observer : observers_)
- observer.OnForeignSessionUpdated();
+ observer.OnForeignSessionUpdated(this);
+}
+
+void ProfileSyncService::NotifyShutdown() {
+ for (auto& observer : observers_)
+ observer.OnSyncShutdown(this);
}
void ProfileSyncService::ClearStaleErrors() {
@@ -1219,7 +1225,7 @@ void ProfileSyncService::OnConfigureDone(
// Notify listeners that configuration is done.
for (auto& observer : observers_)
- observer.OnSyncConfigurationCompleted();
+ observer.OnSyncConfigurationCompleted(this);
DVLOG(1) << "PSS OnConfigureDone called with status: " << configure_status_;
// The possible status values:
« no previous file with comments | « components/browser_sync/profile_sync_service.h ('k') | components/browser_sync/profile_sync_service_startup_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698