| 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.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" |
| 11 #include "chrome/browser/browser_process_platform_part_chromeos.h" | 11 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
| 12 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
| 13 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 13 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 14 #include "chrome/browser/chromeos/policy/ticl_device_settings_provider.h" | 14 #include "chrome/browser/chromeos/policy/ticl_device_settings_provider.h" |
| 15 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 15 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 28 #include "components/invalidation/ticl_invalidation_service.h" | 28 #include "components/invalidation/ticl_invalidation_service.h" |
| 29 #include "components/invalidation/ticl_settings_provider.h" | 29 #include "components/invalidation/ticl_settings_provider.h" |
| 30 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 30 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 31 #include "components/user_manager/user.h" | 31 #include "components/user_manager/user.h" |
| 32 #include "content/public/browser/notification_details.h" | 32 #include "content/public/browser/notification_details.h" |
| 33 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
| 34 #include "google_apis/gaia/identity_provider.h" | 34 #include "google_apis/gaia/identity_provider.h" |
| 35 | 35 |
| 36 namespace policy { | 36 namespace policy { |
| 37 | 37 |
| 38 AffiliatedInvalidationServiceProvider::Consumer::~Consumer() { | 38 class AffiliatedInvalidationServiceProviderImpl::InvalidationServiceObserver |
| 39 } | |
| 40 | |
| 41 class AffiliatedInvalidationServiceProvider::InvalidationServiceObserver | |
| 42 : public syncer::InvalidationHandler { | 39 : public syncer::InvalidationHandler { |
| 43 public: | 40 public: |
| 44 explicit InvalidationServiceObserver( | 41 explicit InvalidationServiceObserver( |
| 45 AffiliatedInvalidationServiceProvider* parent, | 42 AffiliatedInvalidationServiceProviderImpl* parent, |
| 46 invalidation::InvalidationService* invalidation_service); | 43 invalidation::InvalidationService* invalidation_service); |
| 47 ~InvalidationServiceObserver() override; | 44 ~InvalidationServiceObserver() override; |
| 48 | 45 |
| 49 invalidation::InvalidationService* GetInvalidationService(); | 46 invalidation::InvalidationService* GetInvalidationService(); |
| 50 bool IsServiceConnected() const; | 47 bool IsServiceConnected() const; |
| 51 | 48 |
| 52 // public syncer::InvalidationHandler: | 49 // public syncer::InvalidationHandler: |
| 53 void OnInvalidatorStateChange(syncer::InvalidatorState state) override; | 50 void OnInvalidatorStateChange(syncer::InvalidatorState state) override; |
| 54 void OnIncomingInvalidation( | 51 void OnIncomingInvalidation( |
| 55 const syncer::ObjectIdInvalidationMap& invalidation_map) override; | 52 const syncer::ObjectIdInvalidationMap& invalidation_map) override; |
| 56 std::string GetOwnerName() const override; | 53 std::string GetOwnerName() const override; |
| 57 | 54 |
| 58 private: | 55 private: |
| 59 AffiliatedInvalidationServiceProvider* parent_; | 56 AffiliatedInvalidationServiceProviderImpl* parent_; |
| 60 invalidation::InvalidationService* invalidation_service_; | 57 invalidation::InvalidationService* invalidation_service_; |
| 61 bool is_service_connected_; | 58 bool is_service_connected_; |
| 62 bool is_observer_ready_; | 59 bool is_observer_ready_; |
| 63 | 60 |
| 64 DISALLOW_COPY_AND_ASSIGN(InvalidationServiceObserver); | 61 DISALLOW_COPY_AND_ASSIGN(InvalidationServiceObserver); |
| 65 }; | 62 }; |
| 66 | 63 |
| 67 AffiliatedInvalidationServiceProvider::InvalidationServiceObserver:: | 64 AffiliatedInvalidationServiceProviderImpl::InvalidationServiceObserver:: |
| 68 InvalidationServiceObserver( | 65 InvalidationServiceObserver( |
| 69 AffiliatedInvalidationServiceProvider* parent, | 66 AffiliatedInvalidationServiceProviderImpl* parent, |
| 70 invalidation::InvalidationService* invalidation_service) | 67 invalidation::InvalidationService* invalidation_service) |
| 71 : parent_(parent), | 68 : parent_(parent), |
| 72 invalidation_service_(invalidation_service), | 69 invalidation_service_(invalidation_service), |
| 73 is_service_connected_(false), | 70 is_service_connected_(false), |
| 74 is_observer_ready_(false) { | 71 is_observer_ready_(false) { |
| 75 invalidation_service_->RegisterInvalidationHandler(this); | 72 invalidation_service_->RegisterInvalidationHandler(this); |
| 76 is_service_connected_ = invalidation_service->GetInvalidatorState() == | 73 is_service_connected_ = invalidation_service->GetInvalidatorState() == |
| 77 syncer::INVALIDATIONS_ENABLED; | 74 syncer::INVALIDATIONS_ENABLED; |
| 78 is_observer_ready_ = true; | 75 is_observer_ready_ = true; |
| 79 } | 76 } |
| 80 | 77 |
| 81 AffiliatedInvalidationServiceProvider::InvalidationServiceObserver:: | 78 AffiliatedInvalidationServiceProviderImpl::InvalidationServiceObserver:: |
| 82 ~InvalidationServiceObserver() { | 79 ~InvalidationServiceObserver() { |
| 83 is_observer_ready_ = false; | 80 is_observer_ready_ = false; |
| 84 invalidation_service_->UnregisterInvalidationHandler(this); | 81 invalidation_service_->UnregisterInvalidationHandler(this); |
| 85 } | 82 } |
| 86 | 83 |
| 87 invalidation::InvalidationService* | 84 invalidation::InvalidationService* |
| 88 AffiliatedInvalidationServiceProvider::InvalidationServiceObserver:: | 85 AffiliatedInvalidationServiceProviderImpl::InvalidationServiceObserver:: |
| 89 GetInvalidationService() { | 86 GetInvalidationService() { |
| 90 return invalidation_service_; | 87 return invalidation_service_; |
| 91 } | 88 } |
| 92 | 89 |
| 93 bool AffiliatedInvalidationServiceProvider::InvalidationServiceObserver:: | 90 bool AffiliatedInvalidationServiceProviderImpl::InvalidationServiceObserver:: |
| 94 IsServiceConnected() const { | 91 IsServiceConnected() const { |
| 95 return is_service_connected_; | 92 return is_service_connected_; |
| 96 } | 93 } |
| 97 | 94 |
| 98 void AffiliatedInvalidationServiceProvider::InvalidationServiceObserver:: | 95 void AffiliatedInvalidationServiceProviderImpl::InvalidationServiceObserver:: |
| 99 OnInvalidatorStateChange(syncer::InvalidatorState state) { | 96 OnInvalidatorStateChange(syncer::InvalidatorState state) { |
| 100 if (!is_observer_ready_) | 97 if (!is_observer_ready_) |
| 101 return; | 98 return; |
| 102 | 99 |
| 103 const bool is_service_connected = (state == syncer::INVALIDATIONS_ENABLED); | 100 const bool is_service_connected = (state == syncer::INVALIDATIONS_ENABLED); |
| 104 if (is_service_connected == is_service_connected_) | 101 if (is_service_connected == is_service_connected_) |
| 105 return; | 102 return; |
| 106 | 103 |
| 107 is_service_connected_ = is_service_connected; | 104 is_service_connected_ = is_service_connected; |
| 108 if (is_service_connected_) | 105 if (is_service_connected_) |
| 109 parent_->OnInvalidationServiceConnected(invalidation_service_); | 106 parent_->OnInvalidationServiceConnected(invalidation_service_); |
| 110 else | 107 else |
| 111 parent_->OnInvalidationServiceDisconnected(invalidation_service_); | 108 parent_->OnInvalidationServiceDisconnected(invalidation_service_); |
| 112 } | 109 } |
| 113 | 110 |
| 114 void AffiliatedInvalidationServiceProvider::InvalidationServiceObserver:: | 111 void AffiliatedInvalidationServiceProviderImpl::InvalidationServiceObserver:: |
| 115 OnIncomingInvalidation( | 112 OnIncomingInvalidation( |
| 116 const syncer::ObjectIdInvalidationMap& invalidation_map) { | 113 const syncer::ObjectIdInvalidationMap& invalidation_map) { |
| 117 } | 114 } |
| 118 | 115 |
| 119 std::string AffiliatedInvalidationServiceProvider::InvalidationServiceObserver:: | 116 std::string |
| 117 AffiliatedInvalidationServiceProviderImpl::InvalidationServiceObserver:: |
| 120 GetOwnerName() const { | 118 GetOwnerName() const { |
| 121 return "AffiliatedInvalidationService"; | 119 return "AffiliatedInvalidationService"; |
| 122 } | 120 } |
| 123 | 121 |
| 124 AffiliatedInvalidationServiceProvider::AffiliatedInvalidationServiceProvider() | 122 AffiliatedInvalidationServiceProviderImpl:: |
| 123 AffiliatedInvalidationServiceProviderImpl() |
| 125 : invalidation_service_(nullptr), | 124 : invalidation_service_(nullptr), |
| 126 consumer_count_(0), | 125 consumer_count_(0), |
| 127 is_shut_down_(false) { | 126 is_shut_down_(false) { |
| 128 // The AffiliatedInvalidationServiceProvider should be created before any user | 127 // The AffiliatedInvalidationServiceProviderImpl should be created before any |
| 129 // Profiles. | 128 // user Profiles. |
| 130 DCHECK(g_browser_process->profile_manager()->GetLoadedProfiles().empty()); | 129 DCHECK(g_browser_process->profile_manager()->GetLoadedProfiles().empty()); |
| 131 | 130 |
| 132 // Subscribe to notification about new user profiles becoming available. | 131 // Subscribe to notification about new user profiles becoming available. |
| 133 registrar_.Add(this, | 132 registrar_.Add(this, |
| 134 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 133 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 135 content::NotificationService::AllSources()); | 134 content::NotificationService::AllSources()); |
| 136 } | 135 } |
| 137 | 136 |
| 138 AffiliatedInvalidationServiceProvider:: | 137 AffiliatedInvalidationServiceProviderImpl:: |
| 139 ~AffiliatedInvalidationServiceProvider() { | 138 ~AffiliatedInvalidationServiceProviderImpl() { |
| 140 // Verify that the provider was shut down first. | 139 // Verify that the provider was shut down first. |
| 141 DCHECK(is_shut_down_); | 140 DCHECK(is_shut_down_); |
| 142 } | 141 } |
| 143 | 142 |
| 144 void AffiliatedInvalidationServiceProvider::Observe( | 143 void AffiliatedInvalidationServiceProviderImpl::Observe( |
| 145 int type, | 144 int type, |
| 146 const content::NotificationSource& source, | 145 const content::NotificationSource& source, |
| 147 const content::NotificationDetails& details) { | 146 const content::NotificationDetails& details) { |
| 148 DCHECK_EQ(chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, type); | 147 DCHECK_EQ(chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, type); |
| 149 DCHECK(!is_shut_down_); | 148 DCHECK(!is_shut_down_); |
| 150 Profile* profile = content::Details<Profile>(details).ptr(); | 149 Profile* profile = content::Details<Profile>(details).ptr(); |
| 151 invalidation::ProfileInvalidationProvider* invalidation_provider = | 150 invalidation::ProfileInvalidationProvider* invalidation_provider = |
| 152 invalidation::ProfileInvalidationProviderFactory::GetForProfile(profile); | 151 invalidation::ProfileInvalidationProviderFactory::GetForProfile(profile); |
| 153 if (!invalidation_provider) { | 152 if (!invalidation_provider) { |
| 154 // If the Profile does not support invalidation (e.g. guest, incognito), | 153 // If the Profile does not support invalidation (e.g. guest, incognito), |
| (...skipping 15 matching lines...) Expand all Loading... |
| 170 invalidation_provider->GetInvalidationService(); | 169 invalidation_provider->GetInvalidationService(); |
| 171 profile_invalidation_service_observers_.push_back( | 170 profile_invalidation_service_observers_.push_back( |
| 172 new InvalidationServiceObserver(this, invalidation_service)); | 171 new InvalidationServiceObserver(this, invalidation_service)); |
| 173 | 172 |
| 174 if (profile_invalidation_service_observers_.back()->IsServiceConnected()) { | 173 if (profile_invalidation_service_observers_.back()->IsServiceConnected()) { |
| 175 // If the invalidation service is connected, check whether to switch to it. | 174 // If the invalidation service is connected, check whether to switch to it. |
| 176 OnInvalidationServiceConnected(invalidation_service); | 175 OnInvalidationServiceConnected(invalidation_service); |
| 177 } | 176 } |
| 178 } | 177 } |
| 179 | 178 |
| 180 void AffiliatedInvalidationServiceProvider::RegisterConsumer( | 179 void AffiliatedInvalidationServiceProviderImpl::RegisterConsumer( |
| 181 Consumer* consumer) { | 180 Consumer* consumer) { |
| 182 if (consumers_.HasObserver(consumer) || is_shut_down_) | 181 if (consumers_.HasObserver(consumer) || is_shut_down_) |
| 183 return; | 182 return; |
| 184 | 183 |
| 185 consumers_.AddObserver(consumer); | 184 consumers_.AddObserver(consumer); |
| 186 ++consumer_count_; | 185 ++consumer_count_; |
| 187 | 186 |
| 188 if (invalidation_service_) | 187 if (invalidation_service_) |
| 189 consumer->OnInvalidationServiceSet(invalidation_service_); | 188 consumer->OnInvalidationServiceSet(invalidation_service_); |
| 190 else if (consumer_count_ == 1) | 189 else if (consumer_count_ == 1) |
| 191 FindConnectedInvalidationService(); | 190 FindConnectedInvalidationService(); |
| 192 } | 191 } |
| 193 | 192 |
| 194 void AffiliatedInvalidationServiceProvider::UnregisterConsumer( | 193 void AffiliatedInvalidationServiceProviderImpl::UnregisterConsumer( |
| 195 Consumer* consumer) { | 194 Consumer* consumer) { |
| 196 if (!consumers_.HasObserver(consumer)) | 195 if (!consumers_.HasObserver(consumer)) |
| 197 return; | 196 return; |
| 198 | 197 |
| 199 consumers_.RemoveObserver(consumer); | 198 consumers_.RemoveObserver(consumer); |
| 200 --consumer_count_; | 199 --consumer_count_; |
| 201 | 200 |
| 202 if (invalidation_service_ && consumer_count_ == 0) { | 201 if (invalidation_service_ && consumer_count_ == 0) { |
| 203 invalidation_service_ = nullptr; | 202 invalidation_service_ = nullptr; |
| 204 DestroyDeviceInvalidationService(); | 203 DestroyDeviceInvalidationService(); |
| 205 } | 204 } |
| 206 } | 205 } |
| 207 | 206 |
| 208 void AffiliatedInvalidationServiceProvider::Shutdown() { | 207 void AffiliatedInvalidationServiceProviderImpl::Shutdown() { |
| 209 is_shut_down_ = true; | 208 is_shut_down_ = true; |
| 210 | 209 |
| 211 registrar_.RemoveAll(); | 210 registrar_.RemoveAll(); |
| 212 profile_invalidation_service_observers_.clear(); | 211 profile_invalidation_service_observers_.clear(); |
| 213 DestroyDeviceInvalidationService(); | 212 DestroyDeviceInvalidationService(); |
| 214 | 213 |
| 215 if (invalidation_service_) { | 214 if (invalidation_service_) { |
| 216 invalidation_service_ = nullptr; | 215 invalidation_service_ = nullptr; |
| 217 // Explicitly notify consumers that the invalidation service they were using | 216 // Explicitly notify consumers that the invalidation service they were using |
| 218 // is no longer available. | 217 // is no longer available. |
| 219 SetInvalidationService(nullptr); | 218 SetInvalidationService(nullptr); |
| 220 } | 219 } |
| 221 } | 220 } |
| 222 | 221 |
| 223 invalidation::TiclInvalidationService* | 222 invalidation::TiclInvalidationService* |
| 224 AffiliatedInvalidationServiceProvider:: | 223 AffiliatedInvalidationServiceProviderImpl:: |
| 225 GetDeviceInvalidationServiceForTest() const { | 224 GetDeviceInvalidationServiceForTest() const { |
| 226 return device_invalidation_service_.get(); | 225 return device_invalidation_service_.get(); |
| 227 } | 226 } |
| 228 | 227 |
| 229 void AffiliatedInvalidationServiceProvider::OnInvalidationServiceConnected( | 228 void AffiliatedInvalidationServiceProviderImpl::OnInvalidationServiceConnected( |
| 230 invalidation::InvalidationService* invalidation_service) { | 229 invalidation::InvalidationService* invalidation_service) { |
| 231 DCHECK(!is_shut_down_); | 230 DCHECK(!is_shut_down_); |
| 232 | 231 |
| 233 if (consumer_count_ == 0) { | 232 if (consumer_count_ == 0) { |
| 234 // If there are no consumers, no invalidation service is required. | 233 // If there are no consumers, no invalidation service is required. |
| 235 return; | 234 return; |
| 236 } | 235 } |
| 237 | 236 |
| 238 if (!device_invalidation_service_) { | 237 if (!device_invalidation_service_) { |
| 239 // The lack of a device-global invalidation service implies that another | 238 // The lack of a device-global invalidation service implies that another |
| 240 // connected invalidation service is being made available to consumers | 239 // connected invalidation service is being made available to consumers |
| 241 // already. There is no need to switch from that to the service which just | 240 // already. There is no need to switch from that to the service which just |
| 242 // connected. | 241 // connected. |
| 243 return; | 242 return; |
| 244 } | 243 } |
| 245 | 244 |
| 246 if (invalidation_service != device_invalidation_service_.get()) { | 245 if (invalidation_service != device_invalidation_service_.get()) { |
| 247 // If an invalidation service other than the device-global one connected, | 246 // If an invalidation service other than the device-global one connected, |
| 248 // destroy the device-global service. | 247 // destroy the device-global service. |
| 249 invalidation_service_ = nullptr; | 248 invalidation_service_ = nullptr; |
| 250 DestroyDeviceInvalidationService(); | 249 DestroyDeviceInvalidationService(); |
| 251 } | 250 } |
| 252 | 251 |
| 253 // Make the invalidation service that just connected available to consumers. | 252 // Make the invalidation service that just connected available to consumers. |
| 254 SetInvalidationService(invalidation_service); | 253 SetInvalidationService(invalidation_service); |
| 255 } | 254 } |
| 256 | 255 |
| 257 void AffiliatedInvalidationServiceProvider::OnInvalidationServiceDisconnected( | 256 void |
| 257 AffiliatedInvalidationServiceProviderImpl::OnInvalidationServiceDisconnected( |
| 258 invalidation::InvalidationService* invalidation_service) { | 258 invalidation::InvalidationService* invalidation_service) { |
| 259 DCHECK(!is_shut_down_); | 259 DCHECK(!is_shut_down_); |
| 260 | 260 |
| 261 if (invalidation_service != invalidation_service_) { | 261 if (invalidation_service != invalidation_service_) { |
| 262 // If the invalidation service which disconnected was not being made | 262 // If the invalidation service which disconnected was not being made |
| 263 // available to consumers, return. | 263 // available to consumers, return. |
| 264 return; | 264 return; |
| 265 } | 265 } |
| 266 | 266 |
| 267 // The invalidation service which disconnected was being made available to | 267 // The invalidation service which disconnected was being made available to |
| 268 // consumers. Stop making it available. | 268 // consumers. Stop making it available. |
| 269 DCHECK(consumer_count_); | 269 DCHECK(consumer_count_); |
| 270 invalidation_service_ = nullptr; | 270 invalidation_service_ = nullptr; |
| 271 | 271 |
| 272 // Try to make another invalidation service available to consumers. | 272 // Try to make another invalidation service available to consumers. |
| 273 FindConnectedInvalidationService(); | 273 FindConnectedInvalidationService(); |
| 274 | 274 |
| 275 // If no other connected invalidation service was found, explicitly notify | 275 // If no other connected invalidation service was found, explicitly notify |
| 276 // consumers that the invalidation service they were using is no longer | 276 // consumers that the invalidation service they were using is no longer |
| 277 // available. | 277 // available. |
| 278 if (!invalidation_service_) | 278 if (!invalidation_service_) |
| 279 SetInvalidationService(nullptr); | 279 SetInvalidationService(nullptr); |
| 280 } | 280 } |
| 281 | 281 |
| 282 void AffiliatedInvalidationServiceProvider::FindConnectedInvalidationService() { | 282 void |
| 283 AffiliatedInvalidationServiceProviderImpl::FindConnectedInvalidationService() { |
| 283 DCHECK(!invalidation_service_); | 284 DCHECK(!invalidation_service_); |
| 284 DCHECK(consumer_count_); | 285 DCHECK(consumer_count_); |
| 285 DCHECK(!is_shut_down_); | 286 DCHECK(!is_shut_down_); |
| 286 | 287 |
| 287 for (ScopedVector<InvalidationServiceObserver>::const_iterator it = | 288 for (ScopedVector<InvalidationServiceObserver>::const_iterator it = |
| 288 profile_invalidation_service_observers_.begin(); | 289 profile_invalidation_service_observers_.begin(); |
| 289 it != profile_invalidation_service_observers_.end(); ++it) { | 290 it != profile_invalidation_service_observers_.end(); ++it) { |
| 290 if ((*it)->IsServiceConnected()) { | 291 if ((*it)->IsServiceConnected()) { |
| 291 // If a connected invalidation service belonging to an affiliated | 292 // If a connected invalidation service belonging to an affiliated |
| 292 // logged-in user is found, make it available to consumers. | 293 // logged-in user is found, make it available to consumers. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 319 } | 320 } |
| 320 | 321 |
| 321 if (device_invalidation_service_observer_->IsServiceConnected()) { | 322 if (device_invalidation_service_observer_->IsServiceConnected()) { |
| 322 // If the device-global invalidation service is connected already, make it | 323 // If the device-global invalidation service is connected already, make it |
| 323 // available to consumers immediately. Otherwise, the invalidation service | 324 // available to consumers immediately. Otherwise, the invalidation service |
| 324 // will be made available to clients when it successfully connects. | 325 // will be made available to clients when it successfully connects. |
| 325 OnInvalidationServiceConnected(device_invalidation_service_.get()); | 326 OnInvalidationServiceConnected(device_invalidation_service_.get()); |
| 326 } | 327 } |
| 327 } | 328 } |
| 328 | 329 |
| 329 void AffiliatedInvalidationServiceProvider::SetInvalidationService( | 330 void AffiliatedInvalidationServiceProviderImpl::SetInvalidationService( |
| 330 invalidation::InvalidationService* invalidation_service) { | 331 invalidation::InvalidationService* invalidation_service) { |
| 331 DCHECK(!invalidation_service_); | 332 DCHECK(!invalidation_service_); |
| 332 invalidation_service_ = invalidation_service; | 333 invalidation_service_ = invalidation_service; |
| 333 FOR_EACH_OBSERVER(Consumer, | 334 FOR_EACH_OBSERVER(Consumer, |
| 334 consumers_, | 335 consumers_, |
| 335 OnInvalidationServiceSet(invalidation_service_)); | 336 OnInvalidationServiceSet(invalidation_service_)); |
| 336 } | 337 } |
| 337 | 338 |
| 338 void AffiliatedInvalidationServiceProvider::DestroyDeviceInvalidationService() { | 339 void |
| 340 AffiliatedInvalidationServiceProviderImpl::DestroyDeviceInvalidationService() { |
| 339 device_invalidation_service_observer_.reset(); | 341 device_invalidation_service_observer_.reset(); |
| 340 device_invalidation_service_.reset(); | 342 device_invalidation_service_.reset(); |
| 341 } | 343 } |
| 342 | 344 |
| 343 } // namespace policy | 345 } // namespace policy |
| OLD | NEW |