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

Side by Side Diff: components/invalidation/ticl_invalidation_service.cc

Issue 899353002: Unregister GCMInvalidationBridge from GCMDriver when user signs out. (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 | « components/invalidation/gcm_invalidation_bridge.cc ('k') | 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 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/ticl_invalidation_service.h" 5 #include "components/invalidation/ticl_invalidation_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "components/gcm_driver/gcm_driver.h" 9 #include "components/gcm_driver/gcm_driver.h"
10 #include "components/invalidation/gcm_invalidation_bridge.h" 10 #include "components/invalidation/gcm_invalidation_bridge.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 const std::string& account_id) { 255 const std::string& account_id) {
256 access_token_.clear(); 256 access_token_.clear();
257 if (IsStarted()) 257 if (IsStarted())
258 UpdateInvalidatorCredentials(); 258 UpdateInvalidatorCredentials();
259 } 259 }
260 260
261 void TiclInvalidationService::OnActiveAccountLogout() { 261 void TiclInvalidationService::OnActiveAccountLogout() {
262 access_token_request_.reset(); 262 access_token_request_.reset();
263 request_access_token_retry_timer_.Stop(); 263 request_access_token_retry_timer_.Stop();
264 264
265 if (gcm_invalidation_bridge_)
266 gcm_invalidation_bridge_->Unregister();
267
265 if (IsStarted()) { 268 if (IsStarted()) {
266 StopInvalidator(); 269 StopInvalidator();
267 } 270 }
268 271
269 // This service always expects to have a valid invalidation state. Thus, we 272 // This service always expects to have a valid invalidation state. Thus, we
270 // must generate a new client ID to replace the existing one. Setting a new 273 // must generate a new client ID to replace the existing one. Setting a new
271 // client ID also clears all other state. 274 // client ID also clears all other state.
272 invalidation_state_tracker_-> 275 invalidation_state_tracker_->
273 ClearAndSetNewClientId(GenerateInvalidatorClientId()); 276 ClearAndSetNewClientId(GenerateInvalidatorClientId());
274 } 277 }
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 } 430 }
428 431
429 void TiclInvalidationService::StopInvalidator() { 432 void TiclInvalidationService::StopInvalidator() {
430 DCHECK(invalidator_); 433 DCHECK(invalidator_);
431 gcm_invalidation_bridge_.reset(); 434 gcm_invalidation_bridge_.reset();
432 invalidator_->UnregisterHandler(this); 435 invalidator_->UnregisterHandler(this);
433 invalidator_.reset(); 436 invalidator_.reset();
434 } 437 }
435 438
436 } // namespace invalidation 439 } // namespace invalidation
OLDNEW
« no previous file with comments | « components/invalidation/gcm_invalidation_bridge.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698