Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: chrome/browser/chromeos/policy/affiliated_invalidation_service_provider_impl.cc

Issue 942463002: Fix crash when shutting down affiliated invalidation service provider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698