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

Unified Diff: sync/notifier/invalidator_registrar.h

Issue 10916131: [Invalidations] Add GetInvalidatorState() to Invalidator{,Frontend} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android Created 8 years, 3 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/notifier/invalidator_factory_unittest.cc ('k') | sync/notifier/invalidator_registrar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/invalidator_registrar.h
diff --git a/sync/notifier/invalidator_registrar.h b/sync/notifier/invalidator_registrar.h
index 485b73e309238b2f08474f3e7b4acb44cf857388..1589c5c1bdef61d985acbc926afbcee45b9053c8 100644
--- a/sync/notifier/invalidator_registrar.h
+++ b/sync/notifier/invalidator_registrar.h
@@ -55,11 +55,17 @@ class InvalidatorRegistrar {
// Invalidations for IDs with no corresponding handler are dropped, as are
// invalidations for handlers that are not added.
void DispatchInvalidationsToHandlers(const ObjectIdStateMap& id_state_map,
- IncomingNotificationSource source);
+ IncomingInvalidationSource source);
- // Calls the given handler method for each handler that has registered IDs.
- void EmitOnNotificationsEnabled();
- void EmitOnNotificationsDisabled(NotificationsDisabledReason reason);
+ // Updates the invalidator state to the given one and then notifies
+ // all handlers. Note that the order is important; handlers that
+ // call GetInvalidatorState() when notified will see the new state.
+ void UpdateInvalidatorState(InvalidatorState state);
+
+ // Returns the current invalidator state. When called from within
+ // InvalidationHandler::OnInvalidatorStateChange(), this returns the
+ // updated state.
+ InvalidatorState GetInvalidatorState() const;
bool IsHandlerRegisteredForTest(InvalidationHandler* handler) const;
@@ -76,6 +82,7 @@ class InvalidatorRegistrar {
base::ThreadChecker thread_checker_;
ObserverList<InvalidationHandler> handlers_;
IdHandlerMap id_to_handler_map_;
+ InvalidatorState state_;
DISALLOW_COPY_AND_ASSIGN(InvalidatorRegistrar);
};
« no previous file with comments | « sync/notifier/invalidator_factory_unittest.cc ('k') | sync/notifier/invalidator_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698