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

Unified Diff: sync/notifier/invalidation_notifier.cc

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/invalidation_notifier.h ('k') | sync/notifier/invalidation_notifier_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/invalidation_notifier.cc
diff --git a/sync/notifier/invalidation_notifier.cc b/sync/notifier/invalidation_notifier.cc
index 81a268b8fc9bac8bbdd0ad2f5501a09b88decb00..aaab3685d2d51f338f0e90eb66e0243ee56f17af 100644
--- a/sync/notifier/invalidation_notifier.cc
+++ b/sync/notifier/invalidation_notifier.cc
@@ -52,6 +52,11 @@ void InvalidationNotifier::UnregisterHandler(InvalidationHandler* handler) {
registrar_.UnregisterHandler(handler);
}
+InvalidatorState InvalidationNotifier::GetInvalidatorState() const {
+ DCHECK(CalledOnValidThread());
+ return registrar_.GetInvalidatorState();
+}
+
void InvalidationNotifier::SetUniqueId(const std::string& unique_id) {
DCHECK(CalledOnValidThread());
client_id_ = unique_id;
@@ -94,7 +99,7 @@ void InvalidationNotifier::UpdateCredentials(
invalidation_listener_.UpdateCredentials(email, token);
}
-void InvalidationNotifier::SendNotification(
+void InvalidationNotifier::SendInvalidation(
const ObjectIdStateMap& id_state_map) {
DCHECK(CalledOnValidThread());
// Do nothing.
@@ -102,18 +107,12 @@ void InvalidationNotifier::SendNotification(
void InvalidationNotifier::OnInvalidate(const ObjectIdStateMap& id_state_map) {
DCHECK(CalledOnValidThread());
- registrar_.DispatchInvalidationsToHandlers(id_state_map, REMOTE_NOTIFICATION);
-}
-
-void InvalidationNotifier::OnNotificationsEnabled() {
- DCHECK(CalledOnValidThread());
- registrar_.EmitOnNotificationsEnabled();
+ registrar_.DispatchInvalidationsToHandlers(id_state_map, REMOTE_INVALIDATION);
}
-void InvalidationNotifier::OnNotificationsDisabled(
- NotificationsDisabledReason reason) {
+void InvalidationNotifier::OnInvalidatorStateChange(InvalidatorState state) {
DCHECK(CalledOnValidThread());
- registrar_.EmitOnNotificationsDisabled(reason);
+ registrar_.UpdateInvalidatorState(state);
}
} // namespace syncer
« no previous file with comments | « sync/notifier/invalidation_notifier.h ('k') | sync/notifier/invalidation_notifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698