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

Side by Side Diff: chrome/browser/invalidation/ticl_invalidation_service.cc

Issue 60733019: This is the third CL of several that will eventually replace TokenService with (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/net/gaia/gaia_oauth_fetcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/invalidation/ticl_invalidation_service.h" 5 #include "chrome/browser/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 "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/invalidation/invalidation_service_util.h" 10 #include "chrome/browser/invalidation/invalidation_service_util.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 return false; 313 return false;
314 } 314 }
315 315
316 if (signin_manager_->GetAuthenticatedUsername().empty()) { 316 if (signin_manager_->GetAuthenticatedUsername().empty()) {
317 DVLOG(2) << "Not starting TiclInvalidationService: User is not signed in."; 317 DVLOG(2) << "Not starting TiclInvalidationService: User is not signed in.";
318 return false; 318 return false;
319 } 319 }
320 320
321 if (!oauth2_token_service_) { 321 if (!oauth2_token_service_) {
322 DVLOG(2) 322 DVLOG(2)
323 << "Not starting TiclInvalidationService: TokenService unavailable."; 323 << "Not starting TiclInvalidationService: "
324 << "OAuth2TokenService unavailable.";
324 return false; 325 return false;
325 } 326 }
326 327
327 if (!oauth2_token_service_->RefreshTokenIsAvailable( 328 if (!oauth2_token_service_->RefreshTokenIsAvailable(
328 oauth2_token_service_->GetPrimaryAccountId())) { 329 oauth2_token_service_->GetPrimaryAccountId())) {
329 DVLOG(2) 330 DVLOG(2)
330 << "Not starting TiclInvalidationServce: Waiting for refresh token."; 331 << "Not starting TiclInvalidationServce: Waiting for refresh token.";
331 return false; 332 return false;
332 } 333 }
333 334
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 398 }
398 399
399 // This service always expects to have a valid invalidator storage. 400 // This service always expects to have a valid invalidator storage.
400 // So we must not only clear the old one, but also start a new one. 401 // So we must not only clear the old one, but also start a new one.
401 invalidator_storage_->Clear(); 402 invalidator_storage_->Clear();
402 invalidator_storage_.reset(new InvalidatorStorage(profile_->GetPrefs())); 403 invalidator_storage_.reset(new InvalidatorStorage(profile_->GetPrefs()));
403 invalidator_storage_->SetInvalidatorClientId(GenerateInvalidatorClientId()); 404 invalidator_storage_->SetInvalidatorClientId(GenerateInvalidatorClientId());
404 } 405 }
405 406
406 } // namespace invalidation 407 } // namespace invalidation
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/gaia/gaia_oauth_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698