| 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" |
| 11 #include "chrome/browser/invalidation/invalidation_logger.h" | 11 #include "chrome/browser/invalidation/invalidation_logger.h" |
| 12 #include "chrome/browser/invalidation/invalidation_service.h" | 12 #include "chrome/browser/invalidation/invalidation_service.h" |
| 13 #include "chrome/browser/invalidation/invalidator_storage.h" | 13 #include "chrome/browser/invalidation/invalidator_storage.h" |
| 14 #include "chrome/browser/signin/profile_oauth2_token_service.h" | 14 #include "chrome/browser/signin/profile_oauth2_token_service.h" |
| 15 #include "chrome/browser/signin/signin_manager.h" | 15 #include "chrome/browser/signin/signin_manager.h" |
| 16 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 16 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
| 17 #include "google_apis/gaia/oauth2_token_service.h" | 17 #include "google_apis/gaia/oauth2_token_service.h" |
| 18 #include "net/base/backoff_entry.h" | 18 #include "net/base/backoff_entry.h" |
| 19 #include "sync/notifier/invalidation_handler.h" | 19 #include "sync/notifier/invalidation_handler.h" |
| 20 #include "sync/notifier/invalidator_registrar.h" | 20 #include "sync/notifier/invalidator_registrar.h" |
| 21 | 21 |
| 22 class Profile; | 22 class Profile; |
| 23 | 23 |
| 24 namespace syncer { | 24 namespace syncer { |
| 25 class Invalidator; | 25 class Invalidator; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace invalidation { | 28 namespace invalidation { |
| 29 class GCMInvalidationBridge; |
| 29 | 30 |
| 30 // This InvalidationService wraps the C++ Invalidation Client (TICL) library. | 31 // This InvalidationService wraps the C++ Invalidation Client (TICL) library. |
| 31 // It provides invalidations for desktop platforms (Win, Mac, Linux). | 32 // It provides invalidations for desktop platforms (Win, Mac, Linux). |
| 32 class TiclInvalidationService : public base::NonThreadSafe, | 33 class TiclInvalidationService : public base::NonThreadSafe, |
| 33 public InvalidationService, | 34 public InvalidationService, |
| 34 public OAuth2TokenService::Consumer, | 35 public OAuth2TokenService::Consumer, |
| 35 public OAuth2TokenService::Observer, | 36 public OAuth2TokenService::Observer, |
| 36 public SigninManagerBase::Observer, | 37 public SigninManagerBase::Observer, |
| 37 public syncer::InvalidationHandler { | 38 public syncer::InvalidationHandler { |
| 38 public: | 39 public: |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // TiclInvalidationService needs to remember access token in order to | 116 // TiclInvalidationService needs to remember access token in order to |
| 116 // invalidate it with OAuth2TokenService. | 117 // invalidate it with OAuth2TokenService. |
| 117 std::string access_token_; | 118 std::string access_token_; |
| 118 | 119 |
| 119 // TiclInvalidationService needs to hold reference to access_token_request_ | 120 // TiclInvalidationService needs to hold reference to access_token_request_ |
| 120 // for the duration of request in order to receive callbacks. | 121 // for the duration of request in order to receive callbacks. |
| 121 scoped_ptr<OAuth2TokenService::Request> access_token_request_; | 122 scoped_ptr<OAuth2TokenService::Request> access_token_request_; |
| 122 base::OneShotTimer<TiclInvalidationService> request_access_token_retry_timer_; | 123 base::OneShotTimer<TiclInvalidationService> request_access_token_retry_timer_; |
| 123 net::BackoffEntry request_access_token_backoff_; | 124 net::BackoffEntry request_access_token_backoff_; |
| 124 | 125 |
| 126 scoped_ptr<GCMInvalidationBridge> gcm_invalidation_bridge_; |
| 127 |
| 125 // The invalidation logger object we use to record state changes | 128 // The invalidation logger object we use to record state changes |
| 126 // and invalidations. | 129 // and invalidations. |
| 127 InvalidationLogger logger_; | 130 InvalidationLogger logger_; |
| 128 | 131 |
| 129 DISALLOW_COPY_AND_ASSIGN(TiclInvalidationService); | 132 DISALLOW_COPY_AND_ASSIGN(TiclInvalidationService); |
| 130 }; | 133 }; |
| 131 | 134 |
| 132 } // namespace invalidation | 135 } // namespace invalidation |
| 133 | 136 |
| 134 #endif // CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ | 137 #endif // CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ |
| OLD | NEW |