Index: sync/notifier/non_blocking_invalidator.h |
diff --git a/sync/notifier/non_blocking_invalidation_notifier.h b/sync/notifier/non_blocking_invalidator.h |
similarity index 61% |
rename from sync/notifier/non_blocking_invalidation_notifier.h |
rename to sync/notifier/non_blocking_invalidator.h |
index 849c981371451978b5bdb999bb41d16a9ee6362d..cd98fe5f2b86105eae4f28faa89e0be280767de9 100644 |
--- a/sync/notifier/non_blocking_invalidation_notifier.h |
+++ b/sync/notifier/non_blocking_invalidator.h |
@@ -5,8 +5,8 @@ |
// An implementation of SyncNotifier that wraps InvalidationNotifier |
// on its own thread. |
-#ifndef SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ |
-#define SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ |
+#ifndef SYNC_NOTIFIER_NON_BLOCKING_INVALIDATOR_H_ |
+#define SYNC_NOTIFIER_NON_BLOCKING_INVALIDATOR_H_ |
#include <string> |
@@ -16,10 +16,10 @@ |
#include "base/memory/weak_ptr.h" |
#include "jingle/notifier/base/notifier_options.h" |
#include "sync/internal_api/public/util/weak_handle.h" |
+#include "sync/notifier/invalidation_handler.h" |
#include "sync/notifier/invalidation_state_tracker.h" |
-#include "sync/notifier/sync_notifier.h" |
-#include "sync/notifier/sync_notifier_observer.h" |
-#include "sync/notifier/sync_notifier_registrar.h" |
+#include "sync/notifier/invalidator.h" |
+#include "sync/notifier/invalidator_registrar.h" |
namespace base { |
class SingleThreadTaskRunner; |
@@ -27,15 +27,15 @@ class SingleThreadTaskRunner; |
namespace syncer { |
-// TODO(akalin): Generalize to NonBlockingSyncNotifier |
+// TODO(akalin): Generalize the interface so it can use any Invalidator. |
// (http://crbug.com/140409). |
-class NonBlockingInvalidationNotifier |
- : public SyncNotifier, |
- // SyncNotifierObserver to "observe" our Core via WeakHandle. |
- public SyncNotifierObserver { |
+class NonBlockingInvalidator |
+ : public Invalidator, |
+ // InvalidationHandler to "observe" our Core via WeakHandle. |
+ public InvalidationHandler { |
public: |
// |invalidation_state_tracker| must be initialized. |
- NonBlockingInvalidationNotifier( |
+ NonBlockingInvalidator( |
const notifier::NotifierOptions& notifier_options, |
const InvalidationVersionMap& initial_max_invalidation_versions, |
const std::string& initial_invalidation_state, |
@@ -43,20 +43,20 @@ class NonBlockingInvalidationNotifier |
invalidation_state_tracker, |
const std::string& client_info); |
- virtual ~NonBlockingInvalidationNotifier(); |
+ virtual ~NonBlockingInvalidator(); |
- // SyncNotifier implementation. |
- virtual void RegisterHandler(SyncNotifierObserver* handler) OVERRIDE; |
- virtual void UpdateRegisteredIds(SyncNotifierObserver* handler, |
+ // Invalidator implementation. |
+ virtual void RegisterHandler(InvalidationHandler* handler) OVERRIDE; |
+ virtual void UpdateRegisteredIds(InvalidationHandler* handler, |
const ObjectIdSet& ids) OVERRIDE; |
- virtual void UnregisterHandler(SyncNotifierObserver* handler) OVERRIDE; |
+ virtual void UnregisterHandler(InvalidationHandler* handler) OVERRIDE; |
virtual void SetUniqueId(const std::string& unique_id) OVERRIDE; |
virtual void SetStateDeprecated(const std::string& state) OVERRIDE; |
virtual void UpdateCredentials( |
const std::string& email, const std::string& token) OVERRIDE; |
virtual void SendNotification(ModelTypeSet changed_types) OVERRIDE; |
- // SyncNotifierObserver implementation. |
+ // InvalidationHandler implementation. |
virtual void OnNotificationsEnabled() OVERRIDE; |
virtual void OnNotificationsDisabled( |
NotificationsDisabledReason reason) OVERRIDE; |
@@ -67,19 +67,19 @@ class NonBlockingInvalidationNotifier |
private: |
class Core; |
- base::WeakPtrFactory<NonBlockingInvalidationNotifier> weak_ptr_factory_; |
+ base::WeakPtrFactory<NonBlockingInvalidator> weak_ptr_factory_; |
- SyncNotifierRegistrar registrar_; |
+ InvalidatorRegistrar registrar_; |
- // The real guts of NonBlockingInvalidationNotifier, which allows |
- // this class to live completely on the parent thread. |
+ // The real guts of NonBlockingInvalidator, which allows this class to live |
+ // completely on the parent thread. |
scoped_refptr<Core> core_; |
scoped_refptr<base::SingleThreadTaskRunner> parent_task_runner_; |
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
- DISALLOW_COPY_AND_ASSIGN(NonBlockingInvalidationNotifier); |
+ DISALLOW_COPY_AND_ASSIGN(NonBlockingInvalidator); |
}; |
} // namespace syncer |
-#endif // SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ |
+#endif // SYNC_NOTIFIER_NON_BLOCKING_INVALIDATOR_H_ |