| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // InvalidationService implementation. | 48 // InvalidationService implementation. |
| 49 // It is an error to have registered handlers when Shutdown() is called. | 49 // It is an error to have registered handlers when Shutdown() is called. |
| 50 virtual void RegisterInvalidationHandler( | 50 virtual void RegisterInvalidationHandler( |
| 51 syncer::InvalidationHandler* handler) OVERRIDE; | 51 syncer::InvalidationHandler* handler) OVERRIDE; |
| 52 virtual void UpdateRegisteredInvalidationIds( | 52 virtual void UpdateRegisteredInvalidationIds( |
| 53 syncer::InvalidationHandler* handler, | 53 syncer::InvalidationHandler* handler, |
| 54 const syncer::ObjectIdSet& ids) OVERRIDE; | 54 const syncer::ObjectIdSet& ids) OVERRIDE; |
| 55 virtual void UnregisterInvalidationHandler( | 55 virtual void UnregisterInvalidationHandler( |
| 56 syncer::InvalidationHandler* handler) OVERRIDE; | 56 syncer::InvalidationHandler* handler) OVERRIDE; |
| 57 virtual void AcknowledgeInvalidation( | |
| 58 const invalidation::ObjectId& id, | |
| 59 const syncer::AckHandle& ack_handle) OVERRIDE; | |
| 60 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; | 57 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; |
| 61 virtual std::string GetInvalidatorClientId() const OVERRIDE; | 58 virtual std::string GetInvalidatorClientId() const OVERRIDE; |
| 62 | 59 |
| 63 // content::NotificationObserver implementation. | 60 // content::NotificationObserver implementation. |
| 64 virtual void Observe(int type, | 61 virtual void Observe(int type, |
| 65 const content::NotificationSource& source, | 62 const content::NotificationSource& source, |
| 66 const content::NotificationDetails& details) OVERRIDE; | 63 const content::NotificationDetails& details) OVERRIDE; |
| 67 | 64 |
| 68 void RequestAccessToken(); | 65 void RequestAccessToken(); |
| 69 | 66 |
| 70 // OAuth2TokenService::Consumer implementation | 67 // OAuth2TokenService::Consumer implementation |
| 71 virtual void OnGetTokenSuccess( | 68 virtual void OnGetTokenSuccess( |
| 72 const OAuth2TokenService::Request* request, | 69 const OAuth2TokenService::Request* request, |
| 73 const std::string& access_token, | 70 const std::string& access_token, |
| 74 const base::Time& expiration_time) OVERRIDE; | 71 const base::Time& expiration_time) OVERRIDE; |
| 75 virtual void OnGetTokenFailure( | 72 virtual void OnGetTokenFailure( |
| 76 const OAuth2TokenService::Request* request, | 73 const OAuth2TokenService::Request* request, |
| 77 const GoogleServiceAuthError& error) OVERRIDE; | 74 const GoogleServiceAuthError& error) OVERRIDE; |
| 78 | 75 |
| 79 // syncer::InvalidationHandler implementation. | 76 // syncer::InvalidationHandler implementation. |
| 80 virtual void OnInvalidatorStateChange( | 77 virtual void OnInvalidatorStateChange( |
| 81 syncer::InvalidatorState state) OVERRIDE; | 78 syncer::InvalidatorState state) OVERRIDE; |
| 82 virtual void OnIncomingInvalidation( | 79 virtual void OnIncomingInvalidation( |
| 83 const syncer::ObjectIdInvalidationMap& invalidation_map) OVERRIDE; | 80 const syncer::ObjectIdInvalidationMap& invalidations) OVERRIDE; |
| 84 | 81 |
| 85 // Overrides BrowserContextKeyedService method. | 82 // Overrides BrowserContextKeyedService method. |
| 86 virtual void Shutdown() OVERRIDE; | 83 virtual void Shutdown() OVERRIDE; |
| 87 | 84 |
| 88 protected: | 85 protected: |
| 89 // Initializes with an injected invalidator. | 86 // Initializes with an injected invalidator. |
| 90 void InitForTest(syncer::Invalidator* invalidator); | 87 void InitForTest(syncer::Invalidator* invalidator); |
| 91 | 88 |
| 92 friend class TiclInvalidationServiceTestDelegate; | 89 friend class TiclInvalidationServiceTestDelegate; |
| 93 | 90 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 120 scoped_ptr<OAuth2TokenService::Request> access_token_request_; | 117 scoped_ptr<OAuth2TokenService::Request> access_token_request_; |
| 121 base::OneShotTimer<TiclInvalidationService> request_access_token_retry_timer_; | 118 base::OneShotTimer<TiclInvalidationService> request_access_token_retry_timer_; |
| 122 net::BackoffEntry request_access_token_backoff_; | 119 net::BackoffEntry request_access_token_backoff_; |
| 123 | 120 |
| 124 DISALLOW_COPY_AND_ASSIGN(TiclInvalidationService); | 121 DISALLOW_COPY_AND_ASSIGN(TiclInvalidationService); |
| 125 }; | 122 }; |
| 126 | 123 |
| 127 } // namespace invalidation | 124 } // namespace invalidation |
| 128 | 125 |
| 129 #endif // CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ | 126 #endif // CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ |
| OLD | NEW |