| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ | 5 #ifndef COMPONENTS_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ |
| 6 #define CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ | 6 #define COMPONENTS_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/threading/non_thread_safe.h" | 14 #include "base/threading/non_thread_safe.h" |
| 15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 enum InvalidationNetworkChannel { | 53 enum InvalidationNetworkChannel { |
| 54 PUSH_CLIENT_CHANNEL = 0, | 54 PUSH_CLIENT_CHANNEL = 0, |
| 55 GCM_NETWORK_CHANNEL = 1, | 55 GCM_NETWORK_CHANNEL = 1, |
| 56 | 56 |
| 57 // This enum is used in UMA_HISTOGRAM_ENUMERATION. Insert new values above | 57 // This enum is used in UMA_HISTOGRAM_ENUMERATION. Insert new values above |
| 58 // this line. | 58 // this line. |
| 59 NETWORK_CHANNELS_COUNT = 2 | 59 NETWORK_CHANNELS_COUNT = 2 |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 TiclInvalidationService( | 62 TiclInvalidationService( |
| 63 const std::string& user_agent, |
| 63 scoped_ptr<IdentityProvider> identity_provider, | 64 scoped_ptr<IdentityProvider> identity_provider, |
| 64 scoped_ptr<TiclSettingsProvider> settings_provider, | 65 scoped_ptr<TiclSettingsProvider> settings_provider, |
| 65 gcm::GCMDriver* gcm_driver, | 66 gcm::GCMDriver* gcm_driver, |
| 66 const scoped_refptr<net::URLRequestContextGetter>& request_context); | 67 const scoped_refptr<net::URLRequestContextGetter>& request_context); |
| 67 virtual ~TiclInvalidationService(); | 68 virtual ~TiclInvalidationService(); |
| 68 | 69 |
| 69 void Init( | 70 void Init( |
| 70 scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker); | 71 scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker); |
| 71 | 72 |
| 72 // InvalidationService implementation. | 73 // InvalidationService implementation. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 friend class TiclProfileSettingsProviderTest; | 128 friend class TiclProfileSettingsProviderTest; |
| 128 | 129 |
| 129 bool IsReadyToStart(); | 130 bool IsReadyToStart(); |
| 130 bool IsStarted() const; | 131 bool IsStarted() const; |
| 131 | 132 |
| 132 void StartInvalidator(InvalidationNetworkChannel network_channel); | 133 void StartInvalidator(InvalidationNetworkChannel network_channel); |
| 133 void UpdateInvalidationNetworkChannel(); | 134 void UpdateInvalidationNetworkChannel(); |
| 134 void UpdateInvalidatorCredentials(); | 135 void UpdateInvalidatorCredentials(); |
| 135 void StopInvalidator(); | 136 void StopInvalidator(); |
| 136 | 137 |
| 138 const std::string user_agent_; |
| 139 |
| 137 scoped_ptr<IdentityProvider> identity_provider_; | 140 scoped_ptr<IdentityProvider> identity_provider_; |
| 138 scoped_ptr<TiclSettingsProvider> settings_provider_; | 141 scoped_ptr<TiclSettingsProvider> settings_provider_; |
| 139 | 142 |
| 140 scoped_ptr<syncer::InvalidatorRegistrar> invalidator_registrar_; | 143 scoped_ptr<syncer::InvalidatorRegistrar> invalidator_registrar_; |
| 141 scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker_; | 144 scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker_; |
| 142 scoped_ptr<syncer::Invalidator> invalidator_; | 145 scoped_ptr<syncer::Invalidator> invalidator_; |
| 143 | 146 |
| 144 // TiclInvalidationService needs to remember access token in order to | 147 // TiclInvalidationService needs to remember access token in order to |
| 145 // invalidate it with OAuth2TokenService. | 148 // invalidate it with OAuth2TokenService. |
| 146 std::string access_token_; | 149 std::string access_token_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 162 | 165 |
| 163 // Keep a copy of the important parameters used in network channel creation | 166 // Keep a copy of the important parameters used in network channel creation |
| 164 // for debugging. | 167 // for debugging. |
| 165 base::DictionaryValue network_channel_options_; | 168 base::DictionaryValue network_channel_options_; |
| 166 | 169 |
| 167 DISALLOW_COPY_AND_ASSIGN(TiclInvalidationService); | 170 DISALLOW_COPY_AND_ASSIGN(TiclInvalidationService); |
| 168 }; | 171 }; |
| 169 | 172 |
| 170 } // namespace invalidation | 173 } // namespace invalidation |
| 171 | 174 |
| 172 #endif // CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ | 175 #endif // COMPONENTS_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ |
| OLD | NEW |