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

Unified Diff: components/signin/core/browser/gaia_cookie_manager_service.cc

Issue 2704403002: Avoid re-starting a ExternalCCResultFetcher if a previous has finished or timed out. (Closed)
Patch Set: Do not start the externalt CC result fetcher if it already finished. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ios/chrome/browser/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/signin/core/browser/gaia_cookie_manager_service.cc
diff --git a/components/signin/core/browser/gaia_cookie_manager_service.cc b/components/signin/core/browser/gaia_cookie_manager_service.cc
index 28f30f1d2ffab1aa02322776bfcc0253688d930f..5bbba03ae204fb0d1c7433719d3bba7adc369a9c 100644
--- a/components/signin/core/browser/gaia_cookie_manager_service.cc
+++ b/components/signin/core/browser/gaia_cookie_manager_service.cc
@@ -130,6 +130,14 @@ GaiaCookieManagerService::ExternalCcResultFetcher::GetExternalCcResult() {
}
void GaiaCookieManagerService::ExternalCcResultFetcher::Start() {
+ if (helper_->external_cc_result_fetched_) {
+ // Avoid starting a net fetcher if the the external CC result was already
+ // marked as fetched.
+ // This matches the case when |timer_| has already fired and the external CC
+ // result was already marked as fetched.
+ return;
+ }
+
Roger Tawa OOO till Jul 10th 2017/02/23 19:00:00 This method is only called at one place, line 568
msarda 2017/02/24 12:53:40 I've added this DCHECK and it fires. Here is the l
m_external_cc_result_start_time_ = base::Time::Now();
CleanupTransientState();
@@ -195,6 +203,12 @@ void GaiaCookieManagerService::ExternalCcResultFetcher::
void GaiaCookieManagerService::ExternalCcResultFetcher::
OnGetCheckConnectionInfoError(const GoogleServiceAuthError& error) {
+ if (helper_->external_cc_result_fetched_) {
+ // Nothing else to do if the timer has already fired and the external CC
+ // result was already marked as fetched.
+ return;
+ }
+
Roger Tawa OOO till Jul 10th 2017/02/23 19:00:00 If the timer already fired, CleanupTransientState(
msarda 2017/02/24 12:53:40 See comment above.
if (++helper_->fetcher_retries_ < kMaxFetcherRetries &&
error.IsTransientError()) {
helper_->fetcher_backoff_.InformOfRequest(false);
@@ -280,10 +294,6 @@ void GaiaCookieManagerService::ExternalCcResultFetcher::
time_to_check_connections);
helper_->external_cc_result_fetched_ = true;
- // Since the ExternalCCResultFetcher is only Started in place of calling
- // StartFetchingMergeSession, we can assume we need to call
- // StartFetchingMergeSession. If this assumption becomes invalid, a Callback
- // will need to be passed to Start() and Run() here.
Roger Tawa OOO till Jul 10th 2017/02/23 19:00:00 I think this comment is still valid. Is there a r
msarda 2017/02/24 12:53:40 Fixed.
helper_->StartFetchingMergeSession();
}
« no previous file with comments | « no previous file | ios/chrome/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698