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

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

Issue 57993006: signin: record http response codes and net errors in OAuth2AccessTokenFetcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: eof 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
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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 case GoogleServiceAuthError::SERVICE_UNAVAILABLE: { 215 case GoogleServiceAuthError::SERVICE_UNAVAILABLE: {
216 // Transient error. Retry after some time. 216 // Transient error. Retry after some time.
217 request_access_token_backoff_.InformOfRequest(false); 217 request_access_token_backoff_.InformOfRequest(false);
218 request_access_token_retry_timer_.Start( 218 request_access_token_retry_timer_.Start(
219 FROM_HERE, 219 FROM_HERE,
220 request_access_token_backoff_.GetTimeUntilRelease(), 220 request_access_token_backoff_.GetTimeUntilRelease(),
221 base::Bind(&TiclInvalidationService::RequestAccessToken, 221 base::Bind(&TiclInvalidationService::RequestAccessToken,
222 base::Unretained(this))); 222 base::Unretained(this)));
223 break; 223 break;
224 } 224 }
225 case GoogleServiceAuthError::SERVICE_ERROR:
225 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: { 226 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: {
226 // This is a real auth error. 227 // This is a real auth error.
227 // Report time since token was issued for invalid credentials error. 228 // Report time since token was issued for invalid credentials error.
228 base::Time auth_token_time = 229 base::Time auth_token_time =
229 AboutSigninInternalsFactory::GetForProfile(profile_)-> 230 AboutSigninInternalsFactory::GetForProfile(profile_)->
230 GetTokenTime(GaiaConstants::kGaiaOAuth2LoginRefreshToken); 231 GetTokenTime(GaiaConstants::kGaiaOAuth2LoginRefreshToken);
231 if (!auth_token_time.is_null()) { 232 if (!auth_token_time.is_null()) {
232 base::TimeDelta age = base::Time::Now() - auth_token_time; 233 base::TimeDelta age = base::Time::Now() - auth_token_time;
233 if (age < base::TimeDelta::FromHours(1)) { 234 if (age < base::TimeDelta::FromHours(1)) {
234 UMA_HISTOGRAM_CUSTOM_TIMES( 235 UMA_HISTOGRAM_CUSTOM_TIMES(
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 } 397 }
397 398
398 // This service always expects to have a valid invalidator storage. 399 // This service always expects to have a valid invalidator storage.
399 // So we must not only clear the old one, but also start a new one. 400 // So we must not only clear the old one, but also start a new one.
400 invalidator_storage_->Clear(); 401 invalidator_storage_->Clear();
401 invalidator_storage_.reset(new InvalidatorStorage(profile_->GetPrefs())); 402 invalidator_storage_.reset(new InvalidatorStorage(profile_->GetPrefs()));
402 invalidator_storage_->SetInvalidatorClientId(GenerateInvalidatorClientId()); 403 invalidator_storage_->SetInvalidatorClientId(GenerateInvalidatorClientId());
403 } 404 }
404 405
405 } // namespace invalidation 406 } // namespace invalidation
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/identity/identity_api.cc ('k') | chrome/browser/signin/signin_global_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698