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

Side by Side Diff: chrome/browser/sync/profile_sync_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
« no previous file with comments | « chrome/browser/signin/signin_ui_util.cc ('k') | google_apis/gaia/oauth2_access_token_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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/sync/profile_sync_service.h" 5 #include "chrome/browser/sync/profile_sync_service.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 case GoogleServiceAuthError::SERVICE_UNAVAILABLE: { 663 case GoogleServiceAuthError::SERVICE_UNAVAILABLE: {
664 // Transient error. Retry after some time. 664 // Transient error. Retry after some time.
665 request_access_token_backoff_.InformOfRequest(false); 665 request_access_token_backoff_.InformOfRequest(false);
666 request_access_token_retry_timer_.Start( 666 request_access_token_retry_timer_.Start(
667 FROM_HERE, 667 FROM_HERE,
668 request_access_token_backoff_.GetTimeUntilRelease(), 668 request_access_token_backoff_.GetTimeUntilRelease(),
669 base::Bind(&ProfileSyncService::RequestAccessToken, 669 base::Bind(&ProfileSyncService::RequestAccessToken,
670 weak_factory_.GetWeakPtr())); 670 weak_factory_.GetWeakPtr()));
671 break; 671 break;
672 } 672 }
673 case GoogleServiceAuthError::SERVICE_ERROR:
673 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: { 674 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: {
674 // Report time since token was issued for invalid credentials error. 675 // Report time since token was issued for invalid credentials error.
675 base::Time auth_token_time = 676 base::Time auth_token_time =
676 AboutSigninInternalsFactory::GetForProfile(profile_)-> 677 AboutSigninInternalsFactory::GetForProfile(profile_)->
677 GetTokenTime(GaiaConstants::kGaiaOAuth2LoginRefreshToken); 678 GetTokenTime(GaiaConstants::kGaiaOAuth2LoginRefreshToken);
678 if (!auth_token_time.is_null()) { 679 if (!auth_token_time.is_null()) {
679 base::TimeDelta age = base::Time::Now() - auth_token_time; 680 base::TimeDelta age = base::Time::Now() - auth_token_time;
680 if (age < base::TimeDelta::FromHours(1)) { 681 if (age < base::TimeDelta::FromHours(1)) {
681 UMA_HISTOGRAM_CUSTOM_TIMES("Sync.AuthServerRejectedTokenAgeShort", 682 UMA_HISTOGRAM_CUSTOM_TIMES("Sync.AuthServerRejectedTokenAgeShort",
682 age, 683 age,
(...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after
2134 NOTREACHED(); 2135 NOTREACHED();
2135 #endif 2136 #endif
2136 } 2137 }
2137 2138
2138 return signin_->GetAuthenticatedUsername(); 2139 return signin_->GetAuthenticatedUsername();
2139 } 2140 }
2140 2141
2141 WeakHandle<syncer::JsEventHandler> ProfileSyncService::GetJsEventHandler() { 2142 WeakHandle<syncer::JsEventHandler> ProfileSyncService::GetJsEventHandler() {
2142 return MakeWeakHandle(sync_js_controller_.AsWeakPtr()); 2143 return MakeWeakHandle(sync_js_controller_.AsWeakPtr());
2143 } 2144 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_ui_util.cc ('k') | google_apis/gaia/oauth2_access_token_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698