OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // A simple wrapper around invalidation::InvalidationClient that | 5 // A simple wrapper around invalidation::InvalidationClient that |
6 // handles all the startup/shutdown details and hookups. | 6 // handles all the startup/shutdown details and hookups. |
7 | 7 |
8 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ | 8 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ |
9 #define CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ | 9 #define CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ |
10 #pragma once | 10 #pragma once |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 void Stop(); | 77 void Stop(); |
78 | 78 |
79 // Changes the task used to |base_task|, which must still be | 79 // Changes the task used to |base_task|, which must still be |
80 // non-NULL. Must only be called between calls to Start() and | 80 // non-NULL. Must only be called between calls to Start() and |
81 // Stop(). | 81 // Stop(). |
82 void ChangeBaseTask(base::WeakPtr<buzz::XmppTaskParentInterface> base_task); | 82 void ChangeBaseTask(base::WeakPtr<buzz::XmppTaskParentInterface> base_task); |
83 | 83 |
84 // Register the sync types that we're interested in getting | 84 // Register the sync types that we're interested in getting |
85 // notifications for. May be called at any time. | 85 // notifications for. May be called at any time. |
86 void RegisterTypes(syncable::ModelEnumSet types); | 86 void RegisterTypes(syncable::ModelTypeSet types); |
87 | 87 |
88 virtual void WriteState(const std::string& state) OVERRIDE; | 88 virtual void WriteState(const std::string& state) OVERRIDE; |
89 | 89 |
90 // invalidation::InvalidationListener implementation. | 90 // invalidation::InvalidationListener implementation. |
91 virtual void Ready( | 91 virtual void Ready( |
92 invalidation::InvalidationClient* client) OVERRIDE; | 92 invalidation::InvalidationClient* client) OVERRIDE; |
93 virtual void Invalidate( | 93 virtual void Invalidate( |
94 invalidation::InvalidationClient* client, | 94 invalidation::InvalidationClient* client, |
95 const invalidation::Invalidation& invalidation, | 95 const invalidation::Invalidation& invalidation, |
96 const invalidation::AckHandle& ack_handle) OVERRIDE; | 96 const invalidation::AckHandle& ack_handle) OVERRIDE; |
(...skipping 18 matching lines...) Expand all Loading... |
115 const std::string& prefix, | 115 const std::string& prefix, |
116 int prefix_length) OVERRIDE; | 116 int prefix_length) OVERRIDE; |
117 virtual void InformError( | 117 virtual void InformError( |
118 invalidation::InvalidationClient* client, | 118 invalidation::InvalidationClient* client, |
119 const invalidation::ErrorInfo& error_info) OVERRIDE; | 119 const invalidation::ErrorInfo& error_info) OVERRIDE; |
120 | 120 |
121 private: | 121 private: |
122 friend class ChromeInvalidationClientTest; | 122 friend class ChromeInvalidationClientTest; |
123 | 123 |
124 void EmitInvalidation( | 124 void EmitInvalidation( |
125 syncable::ModelEnumSet types, const std::string& payload); | 125 syncable::ModelTypeSet types, const std::string& payload); |
126 | 126 |
127 base::NonThreadSafe non_thread_safe_; | 127 base::NonThreadSafe non_thread_safe_; |
128 ChromeSystemResources chrome_system_resources_; | 128 ChromeSystemResources chrome_system_resources_; |
129 base::ScopedCallbackFactory<ChromeInvalidationClient> | 129 base::ScopedCallbackFactory<ChromeInvalidationClient> |
130 scoped_callback_factory_; | 130 scoped_callback_factory_; |
131 InvalidationVersionMap max_invalidation_versions_; | 131 InvalidationVersionMap max_invalidation_versions_; |
132 browser_sync::WeakHandle<InvalidationVersionTracker> | 132 browser_sync::WeakHandle<InvalidationVersionTracker> |
133 invalidation_version_tracker_; | 133 invalidation_version_tracker_; |
134 Listener* listener_; | 134 Listener* listener_; |
135 StateWriter* state_writer_; | 135 StateWriter* state_writer_; |
136 scoped_ptr<invalidation::InvalidationClient> invalidation_client_; | 136 scoped_ptr<invalidation::InvalidationClient> invalidation_client_; |
137 scoped_ptr<CacheInvalidationPacketHandler> | 137 scoped_ptr<CacheInvalidationPacketHandler> |
138 cache_invalidation_packet_handler_; | 138 cache_invalidation_packet_handler_; |
139 scoped_ptr<RegistrationManager> registration_manager_; | 139 scoped_ptr<RegistrationManager> registration_manager_; |
140 // Stored to pass to |registration_manager_| on start. | 140 // Stored to pass to |registration_manager_| on start. |
141 syncable::ModelEnumSet registered_types_; | 141 syncable::ModelTypeSet registered_types_; |
142 bool ticl_ready_; | 142 bool ticl_ready_; |
143 | 143 |
144 DISALLOW_COPY_AND_ASSIGN(ChromeInvalidationClient); | 144 DISALLOW_COPY_AND_ASSIGN(ChromeInvalidationClient); |
145 }; | 145 }; |
146 | 146 |
147 } // namespace sync_notifier | 147 } // namespace sync_notifier |
148 | 148 |
149 #endif // CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ | 149 #endif // CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ |
OLD | NEW |