| 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 // A class that manages the registration of types for server-issued | 5 // A class that manages the registration of types for server-issued |
| 6 // notifications. | 6 // notifications. |
| 7 | 7 |
| 8 #ifndef SYNC_NOTIFIER_REGISTRATION_MANAGER_H_ | 8 #ifndef SYNC_NOTIFIER_REGISTRATION_MANAGER_H_ |
| 9 #define SYNC_NOTIFIER_REGISTRATION_MANAGER_H_ | 9 #define SYNC_NOTIFIER_REGISTRATION_MANAGER_H_ |
| 10 #pragma once | 10 #pragma once |
| 11 | 11 |
| 12 #include <map> | 12 #include <map> |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/threading/non_thread_safe.h" | 15 #include "base/threading/non_thread_safe.h" |
| 16 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
| 17 #include "base/time.h" | 17 #include "base/time.h" |
| 18 #include "base/timer.h" | 18 #include "base/timer.h" |
| 19 #include "sync/internal_api/public/syncable/model_type.h" | 19 #include "sync/internal_api/public/syncable/model_type.h" |
| 20 // For invalidation::InvalidationListener::RegistrationState. | 20 // For invalidation::InvalidationListener::RegistrationState. |
| 21 #include "google/cacheinvalidation/include/invalidation-listener.h" | 21 #include "google/cacheinvalidation/include/invalidation-listener.h" |
| 22 | 22 |
| 23 namespace csync { | 23 namespace syncer { |
| 24 | 24 |
| 25 using ::invalidation::InvalidationListener; | 25 using ::invalidation::InvalidationListener; |
| 26 | 26 |
| 27 // Manages the details of registering types for invalidation. | 27 // Manages the details of registering types for invalidation. |
| 28 // Implements exponential backoff for repeated registration attempts | 28 // Implements exponential backoff for repeated registration attempts |
| 29 // to the invalidation client. | 29 // to the invalidation client. |
| 30 // | 30 // |
| 31 // TODO(akalin): Consolidate exponential backoff code. Other | 31 // TODO(akalin): Consolidate exponential backoff code. Other |
| 32 // implementations include the syncer thread (both versions) and XMPP | 32 // implementations include the syncer thread (both versions) and XMPP |
| 33 // retries. The most sophisticated one is URLRequestThrottler; making | 33 // retries. The most sophisticated one is URLRequestThrottler; making |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // Returns true iff the given type, which must be valid, is registered. | 164 // Returns true iff the given type, which must be valid, is registered. |
| 165 bool IsTypeRegistered(syncable::ModelType model_type) const; | 165 bool IsTypeRegistered(syncable::ModelType model_type) const; |
| 166 | 166 |
| 167 RegistrationStatus registration_statuses_[syncable::MODEL_TYPE_COUNT]; | 167 RegistrationStatus registration_statuses_[syncable::MODEL_TYPE_COUNT]; |
| 168 // Weak pointer. | 168 // Weak pointer. |
| 169 invalidation::InvalidationClient* invalidation_client_; | 169 invalidation::InvalidationClient* invalidation_client_; |
| 170 | 170 |
| 171 DISALLOW_COPY_AND_ASSIGN(RegistrationManager); | 171 DISALLOW_COPY_AND_ASSIGN(RegistrationManager); |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 } // namespace csync | 174 } // namespace syncer |
| 175 | 175 |
| 176 #endif // SYNC_NOTIFIER_REGISTRATION_MANAGER_H_ | 176 #endif // SYNC_NOTIFIER_REGISTRATION_MANAGER_H_ |
| OLD | NEW |