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 CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ |
6 #define CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ | 6 #define CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/threading/non_thread_safe.h" | 9 #include "base/threading/non_thread_safe.h" |
10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Overrides BrowserContextKeyedService method. | 86 // Overrides BrowserContextKeyedService method. |
87 virtual void Shutdown() OVERRIDE; | 87 virtual void Shutdown() OVERRIDE; |
88 | 88 |
89 protected: | 89 protected: |
90 // Initializes with an injected invalidator. | 90 // Initializes with an injected invalidator. |
91 void InitForTest(syncer::Invalidator* invalidator); | 91 void InitForTest(syncer::Invalidator* invalidator); |
92 | 92 |
93 friend class TiclInvalidationServiceTestDelegate; | 93 friend class TiclInvalidationServiceTestDelegate; |
94 | 94 |
95 private: | 95 private: |
| 96 enum InvalidationNetworkChannel { |
| 97 PUSH_CLIENT_CHANNEL = 0, |
| 98 GCM_NETWORK_CHANNEL = 1 |
| 99 }; |
| 100 |
96 bool IsReadyToStart(); | 101 bool IsReadyToStart(); |
97 bool IsStarted(); | 102 bool IsStarted(); |
98 | 103 |
99 void StartInvalidator(); | 104 void StartInvalidator(InvalidationNetworkChannel network_channel); |
100 void UpdateInvalidatorCredentials(); | 105 void UpdateInvalidatorCredentials(); |
101 void StopInvalidator(); | 106 void StopInvalidator(); |
102 void Logout(); | 107 void Logout(); |
103 | 108 |
104 Profile *const profile_; | 109 Profile *const profile_; |
105 SigninManagerBase *const signin_manager_; | 110 SigninManagerBase *const signin_manager_; |
106 ProfileOAuth2TokenService *const oauth2_token_service_; | 111 ProfileOAuth2TokenService *const oauth2_token_service_; |
107 | 112 |
108 scoped_ptr<syncer::InvalidatorRegistrar> invalidator_registrar_; | 113 scoped_ptr<syncer::InvalidatorRegistrar> invalidator_registrar_; |
109 scoped_ptr<InvalidatorStorage> invalidator_storage_; | 114 scoped_ptr<InvalidatorStorage> invalidator_storage_; |
(...skipping 10 matching lines...) Expand all Loading... |
120 scoped_ptr<OAuth2TokenService::Request> access_token_request_; | 125 scoped_ptr<OAuth2TokenService::Request> access_token_request_; |
121 base::OneShotTimer<TiclInvalidationService> request_access_token_retry_timer_; | 126 base::OneShotTimer<TiclInvalidationService> request_access_token_retry_timer_; |
122 net::BackoffEntry request_access_token_backoff_; | 127 net::BackoffEntry request_access_token_backoff_; |
123 | 128 |
124 DISALLOW_COPY_AND_ASSIGN(TiclInvalidationService); | 129 DISALLOW_COPY_AND_ASSIGN(TiclInvalidationService); |
125 }; | 130 }; |
126 | 131 |
127 } // namespace invalidation | 132 } // namespace invalidation |
128 | 133 |
129 #endif // CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ | 134 #endif // CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ |
OLD | NEW |