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

Unified Diff: components/sync/driver/sync_service_observer.h

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Use parameter 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/sync/driver/sync_service_observer.h
diff --git a/components/sync/driver/sync_service_observer.h b/components/sync/driver/sync_service_observer.h
index 0c6e68e361054231d818009a91ea21f3a0b89c91..fac494a41d0a41a180da47b9769521a4cc15adac 100644
--- a/components/sync/driver/sync_service_observer.h
+++ b/components/sync/driver/sync_service_observer.h
@@ -7,6 +7,8 @@
namespace syncer {
+class SyncService;
+
// Various UI components such as the New Tab page can be driven by observing
// the SyncService through this interface.
class SyncServiceObserver {
@@ -20,18 +22,22 @@ class SyncServiceObserver {
// - Sync shut down.
// - Sync errors (passphrase, auth, unrecoverable, actionable, etc.).
// - Encryption changes.
- virtual void OnStateChanged() = 0;
+ virtual void OnStateChanged(SyncService* sync) {}
// If a client wishes to handle sync cycle completed events in a special way,
// they can use this function. By default, it re-routes to OnStateChanged().
- virtual void OnSyncCycleCompleted();
+ virtual void OnSyncCycleCompleted(SyncService* sync);
// Called when the sync service has finished the datatype configuration
// process.
- virtual void OnSyncConfigurationCompleted() {}
+ virtual void OnSyncConfigurationCompleted(SyncService* sync) {}
// Called when a foreign session has been updated.
- virtual void OnForeignSessionUpdated() {}
+ virtual void OnForeignSessionUpdated(SyncService* sync) {}
+
+ // Called when the sync service is being shutdown permanently, so that
+ // longer-lived observers can drop references to it.
+ virtual void OnSyncShutdown(SyncService* sync) {}
protected:
virtual ~SyncServiceObserver() {}

Powered by Google App Engine
This is Rietveld 408576698