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

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 compile error 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
Index: sync/notifier/invalidation_notifier.cc
diff --git a/sync/notifier/invalidation_notifier.cc b/sync/notifier/invalidation_notifier.cc
index 167b0bafe06aafc8bfa5fa0edc1d1af6f923c17c..b7ce56224623023e8adb78fed42972fadcc22817 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());
invalidation_client_id_ = unique_id;
@@ -94,7 +99,7 @@ void InvalidationNotifier::UpdateCredentials(
invalidation_client_.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

Powered by Google App Engine
This is Rietveld 408576698