OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // An implementation of Invalidator that wraps an invalidation | 5 // An implementation of Invalidator that wraps an invalidation |
6 // client. Handles the details of connecting to XMPP and hooking it | 6 // client. Handles the details of connecting to XMPP and hooking it |
7 // up to the invalidation client. | 7 // up to the invalidation client. |
8 // | 8 // |
9 // You probably don't want to use this directly; use | 9 // You probably don't want to use this directly; use |
10 // NonBlockingInvalidationNotifier. | 10 // NonBlockingInvalidationNotifier. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 invalidation_state_tracker, | 47 invalidation_state_tracker, |
48 const std::string& client_info); | 48 const std::string& client_info); |
49 | 49 |
50 virtual ~InvalidationNotifier(); | 50 virtual ~InvalidationNotifier(); |
51 | 51 |
52 // Invalidator implementation. | 52 // Invalidator implementation. |
53 virtual void RegisterHandler(InvalidationHandler* handler) OVERRIDE; | 53 virtual void RegisterHandler(InvalidationHandler* handler) OVERRIDE; |
54 virtual void UpdateRegisteredIds(InvalidationHandler* handler, | 54 virtual void UpdateRegisteredIds(InvalidationHandler* handler, |
55 const ObjectIdSet& ids) OVERRIDE; | 55 const ObjectIdSet& ids) OVERRIDE; |
56 virtual void UnregisterHandler(InvalidationHandler* handler) OVERRIDE; | 56 virtual void UnregisterHandler(InvalidationHandler* handler) OVERRIDE; |
| 57 virtual InvalidatorState GetInvalidatorState() const OVERRIDE; |
57 virtual void SetUniqueId(const std::string& unique_id) OVERRIDE; | 58 virtual void SetUniqueId(const std::string& unique_id) OVERRIDE; |
58 virtual void SetStateDeprecated(const std::string& state) OVERRIDE; | 59 virtual void SetStateDeprecated(const std::string& state) OVERRIDE; |
59 virtual void UpdateCredentials( | 60 virtual void UpdateCredentials( |
60 const std::string& email, const std::string& token) OVERRIDE; | 61 const std::string& email, const std::string& token) OVERRIDE; |
61 virtual void SendNotification(const ObjectIdStateMap& id_state_map) OVERRIDE; | 62 virtual void SendInvalidation(const ObjectIdStateMap& id_state_map) OVERRIDE; |
62 | 63 |
63 // SyncInvalidationListener::Delegate implementation. | 64 // SyncInvalidationListener::Delegate implementation. |
64 virtual void OnInvalidate(const ObjectIdStateMap& id_state_map) OVERRIDE; | 65 virtual void OnInvalidate(const ObjectIdStateMap& id_state_map) OVERRIDE; |
65 virtual void OnNotificationsEnabled() OVERRIDE; | 66 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE; |
66 virtual void OnNotificationsDisabled( | |
67 NotificationsDisabledReason reason) OVERRIDE; | |
68 | 67 |
69 private: | 68 private: |
70 // We start off in the STOPPED state. When we get our initial | 69 // We start off in the STOPPED state. When we get our initial |
71 // credentials, we connect and move to the CONNECTING state. When | 70 // credentials, we connect and move to the CONNECTING state. When |
72 // we're connected we start the invalidation client and move to the | 71 // we're connected we start the invalidation client and move to the |
73 // STARTED state. We never go back to a previous state. | 72 // STARTED state. We never go back to a previous state. |
74 enum State { | 73 enum State { |
75 STOPPED, | 74 STOPPED, |
76 CONNECTING, | 75 CONNECTING, |
77 STARTED | 76 STARTED |
(...skipping 22 matching lines...) Expand all Loading... |
100 | 99 |
101 // The invalidation listener. | 100 // The invalidation listener. |
102 SyncInvalidationListener invalidation_listener_; | 101 SyncInvalidationListener invalidation_listener_; |
103 | 102 |
104 DISALLOW_COPY_AND_ASSIGN(InvalidationNotifier); | 103 DISALLOW_COPY_AND_ASSIGN(InvalidationNotifier); |
105 }; | 104 }; |
106 | 105 |
107 } // namespace syncer | 106 } // namespace syncer |
108 | 107 |
109 #endif // SYNC_NOTIFIER_INVALIDATION_NOTIFIER_H_ | 108 #endif // SYNC_NOTIFIER_INVALIDATION_NOTIFIER_H_ |
OLD | NEW |