OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |