| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide
r_impl.h" | 5 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide
r_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 invalidation_service_ = nullptr; | 202 invalidation_service_ = nullptr; |
| 203 DestroyDeviceInvalidationService(); | 203 DestroyDeviceInvalidationService(); |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 | 206 |
| 207 void AffiliatedInvalidationServiceProviderImpl::Shutdown() { | 207 void AffiliatedInvalidationServiceProviderImpl::Shutdown() { |
| 208 is_shut_down_ = true; | 208 is_shut_down_ = true; |
| 209 | 209 |
| 210 registrar_.RemoveAll(); | 210 registrar_.RemoveAll(); |
| 211 profile_invalidation_service_observers_.clear(); | 211 profile_invalidation_service_observers_.clear(); |
| 212 DestroyDeviceInvalidationService(); | 212 device_invalidation_service_observer_.reset(); |
| 213 | 213 |
| 214 if (invalidation_service_) { | 214 if (invalidation_service_) { |
| 215 invalidation_service_ = nullptr; | 215 invalidation_service_ = nullptr; |
| 216 // Explicitly notify consumers that the invalidation service they were using | 216 // Explicitly notify consumers that the invalidation service they were using |
| 217 // is no longer available. | 217 // is no longer available. |
| 218 SetInvalidationService(nullptr); | 218 SetInvalidationService(nullptr); |
| 219 } | 219 } |
| 220 |
| 221 DestroyDeviceInvalidationService(); |
| 220 } | 222 } |
| 221 | 223 |
| 222 invalidation::TiclInvalidationService* | 224 invalidation::TiclInvalidationService* |
| 223 AffiliatedInvalidationServiceProviderImpl:: | 225 AffiliatedInvalidationServiceProviderImpl:: |
| 224 GetDeviceInvalidationServiceForTest() const { | 226 GetDeviceInvalidationServiceForTest() const { |
| 225 return device_invalidation_service_.get(); | 227 return device_invalidation_service_.get(); |
| 226 } | 228 } |
| 227 | 229 |
| 228 void AffiliatedInvalidationServiceProviderImpl::OnInvalidationServiceConnected( | 230 void AffiliatedInvalidationServiceProviderImpl::OnInvalidationServiceConnected( |
| 229 invalidation::InvalidationService* invalidation_service) { | 231 invalidation::InvalidationService* invalidation_service) { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 OnInvalidationServiceSet(invalidation_service_)); | 341 OnInvalidationServiceSet(invalidation_service_)); |
| 340 } | 342 } |
| 341 | 343 |
| 342 void | 344 void |
| 343 AffiliatedInvalidationServiceProviderImpl::DestroyDeviceInvalidationService() { | 345 AffiliatedInvalidationServiceProviderImpl::DestroyDeviceInvalidationService() { |
| 344 device_invalidation_service_observer_.reset(); | 346 device_invalidation_service_observer_.reset(); |
| 345 device_invalidation_service_.reset(); | 347 device_invalidation_service_.reset(); |
| 346 } | 348 } |
| 347 | 349 |
| 348 } // namespace policy | 350 } // namespace policy |
| OLD | NEW |