Chromium Code Reviews| 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(); |
| } |