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

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

Issue 1380103004: Delay fetching account info until OnRefreshTokensLoaded(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix iOs Created 5 years, 2 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
Index: components/signin/core/browser/child_account_info_fetcher_impl.cc
diff --git a/components/signin/core/browser/child_account_info_fetcher_impl.cc b/components/signin/core/browser/child_account_info_fetcher_impl.cc
index 8d4d49c9b67fa1284b534076a0acf47a497647de..22b904859a30a9a5f15d4582b04ca92826295635 100644
--- a/components/signin/core/browser/child_account_info_fetcher_impl.cc
+++ b/components/signin/core/browser/child_account_info_fetcher_impl.cc
@@ -74,7 +74,7 @@ ChildAccountInfoFetcherImpl::ChildAccountInfoFetcherImpl(
ChildAccountInfoFetcherImpl::~ChildAccountInfoFetcherImpl() {
TRACE_EVENT_ASYNC_END0("AccountFetcherService", kFetcherId, this);
if (invalidation_service_)
- invalidation_service_->UnregisterInvalidationHandler(this);
+ UnregisterInvalidationHandler();
}
void ChildAccountInfoFetcherImpl::FetchIfNotInProgress() {
@@ -137,8 +137,7 @@ void ChildAccountInfoFetcherImpl::OnGetUserInfoSuccess(
invalidation_service_->UpdateRegisteredInvalidationIds(
this, syncer::ObjectIdSet());
DCHECK(insert_success);
- invalidation_service_->UnregisterInvalidationHandler(this);
- invalidation_service_ = nullptr;
+ UnregisterInvalidationHandler();
}
fetcher_service_->SetIsChildAccount(account_id_, is_child_account);
} else {
@@ -160,8 +159,15 @@ void ChildAccountInfoFetcherImpl::HandleFailure() {
&ChildAccountInfoFetcherImpl::FetchIfNotInProgress);
}
+void ChildAccountInfoFetcherImpl::UnregisterInvalidationHandler() {
+ invalidation_service_->UnregisterInvalidationHandler(this);
+ invalidation_service_ = nullptr;
+}
+
void ChildAccountInfoFetcherImpl::OnInvalidatorStateChange(
syncer::InvalidatorState state) {
+ if (state == syncer::INVALIDATOR_SHUTTING_DOWN)
+ UnregisterInvalidationHandler();
}
void ChildAccountInfoFetcherImpl::OnIncomingInvalidation(
« no previous file with comments | « components/signin/core/browser/child_account_info_fetcher_impl.h ('k') | components/signin/core/browser/signin_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698