| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "components/invalidation/impl/ticl_invalidation_service.h" | 5 #include "components/invalidation/impl/ticl_invalidation_service.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "components/gcm_driver/gcm_driver.h" | 9 #include "components/gcm_driver/gcm_driver.h" |
| 10 #include "components/invalidation/impl/gcm_invalidation_bridge.h" | 10 #include "components/invalidation/impl/gcm_invalidation_bridge.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 settings_provider_(settings_provider.Pass()), | 63 settings_provider_(settings_provider.Pass()), |
| 64 invalidator_registrar_(new syncer::InvalidatorRegistrar()), | 64 invalidator_registrar_(new syncer::InvalidatorRegistrar()), |
| 65 request_access_token_backoff_(&kRequestAccessTokenBackoffPolicy), | 65 request_access_token_backoff_(&kRequestAccessTokenBackoffPolicy), |
| 66 network_channel_type_(GCM_NETWORK_CHANNEL), | 66 network_channel_type_(GCM_NETWORK_CHANNEL), |
| 67 gcm_driver_(gcm_driver), | 67 gcm_driver_(gcm_driver), |
| 68 request_context_(request_context), | 68 request_context_(request_context), |
| 69 logger_() {} | 69 logger_() {} |
| 70 | 70 |
| 71 TiclInvalidationService::~TiclInvalidationService() { | 71 TiclInvalidationService::~TiclInvalidationService() { |
| 72 DCHECK(CalledOnValidThread()); | 72 DCHECK(CalledOnValidThread()); |
| 73 invalidator_registrar_->UpdateInvalidatorState( |
| 74 syncer::INVALIDATOR_SHUTTING_DOWN); |
| 73 settings_provider_->RemoveObserver(this); | 75 settings_provider_->RemoveObserver(this); |
| 74 identity_provider_->RemoveActiveAccountRefreshTokenObserver(this); | 76 identity_provider_->RemoveActiveAccountRefreshTokenObserver(this); |
| 75 identity_provider_->RemoveObserver(this); | 77 identity_provider_->RemoveObserver(this); |
| 76 if (IsStarted()) { | 78 if (IsStarted()) { |
| 77 StopInvalidator(); | 79 StopInvalidator(); |
| 78 } | 80 } |
| 79 } | 81 } |
| 80 | 82 |
| 81 void TiclInvalidationService::Init( | 83 void TiclInvalidationService::Init( |
| 82 scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker) { | 84 scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker) { |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 } | 431 } |
| 430 | 432 |
| 431 void TiclInvalidationService::StopInvalidator() { | 433 void TiclInvalidationService::StopInvalidator() { |
| 432 DCHECK(invalidator_); | 434 DCHECK(invalidator_); |
| 433 gcm_invalidation_bridge_.reset(); | 435 gcm_invalidation_bridge_.reset(); |
| 434 invalidator_->UnregisterHandler(this); | 436 invalidator_->UnregisterHandler(this); |
| 435 invalidator_.reset(); | 437 invalidator_.reset(); |
| 436 } | 438 } |
| 437 | 439 |
| 438 } // namespace invalidation | 440 } // namespace invalidation |
| OLD | NEW |