| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/signin/core/browser/gaia_cookie_manager_service.h" | 5 #include "components/signin/core/browser/gaia_cookie_manager_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <queue> | 9 #include <queue> |
| 10 | 10 |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 OnGaiaAccountsInCookieUpdated( | 659 OnGaiaAccountsInCookieUpdated( |
| 660 listed_accounts_, signed_out_accounts_, error)); | 660 listed_accounts_, signed_out_accounts_, error)); |
| 661 HandleNextRequest(); | 661 HandleNextRequest(); |
| 662 } | 662 } |
| 663 | 663 |
| 664 void GaiaCookieManagerService::OnLogOutSuccess() { | 664 void GaiaCookieManagerService::OnLogOutSuccess() { |
| 665 DCHECK(requests_.front().request_type() == GaiaCookieRequestType::LOG_OUT); | 665 DCHECK(requests_.front().request_type() == GaiaCookieRequestType::LOG_OUT); |
| 666 VLOG(1) << "GaiaCookieManagerService::OnLogOutSuccess"; | 666 VLOG(1) << "GaiaCookieManagerService::OnLogOutSuccess"; |
| 667 | 667 |
| 668 list_accounts_stale_ = true; | 668 list_accounts_stale_ = true; |
| 669 | |
| 670 fetcher_backoff_.InformOfRequest(true); | 669 fetcher_backoff_.InformOfRequest(true); |
| 670 FOR_EACH_OBSERVER(Observer, observer_list_, |
| 671 OnLogOutAccountsFromCookieCompleted( |
| 672 GoogleServiceAuthError(GoogleServiceAuthError::NONE))); |
| 671 HandleNextRequest(); | 673 HandleNextRequest(); |
| 672 } | 674 } |
| 673 | 675 |
| 674 void GaiaCookieManagerService::OnLogOutFailure( | 676 void GaiaCookieManagerService::OnLogOutFailure( |
| 675 const GoogleServiceAuthError& error) { | 677 const GoogleServiceAuthError& error) { |
| 676 DCHECK(requests_.front().request_type() == GaiaCookieRequestType::LOG_OUT); | 678 DCHECK(requests_.front().request_type() == GaiaCookieRequestType::LOG_OUT); |
| 677 VLOG(1) << "GaiaCookieManagerService::OnLogOutFailure"; | 679 VLOG(1) << "GaiaCookieManagerService::OnLogOutFailure"; |
| 678 | 680 |
| 679 if (++fetcher_retries_ < kMaxFetcherRetries) { | 681 if (++fetcher_retries_ < kMaxFetcherRetries) { |
| 680 fetcher_backoff_.InformOfRequest(false); | 682 fetcher_backoff_.InformOfRequest(false); |
| 681 fetcher_timer_.Start( | 683 fetcher_timer_.Start( |
| 682 FROM_HERE, fetcher_backoff_.GetTimeUntilRelease(), | 684 FROM_HERE, fetcher_backoff_.GetTimeUntilRelease(), |
| 683 base::Bind(&SigninClient::DelayNetworkCall, | 685 base::Bind(&SigninClient::DelayNetworkCall, |
| 684 base::Unretained(signin_client_), | 686 base::Unretained(signin_client_), |
| 685 base::Bind(&GaiaCookieManagerService::StartFetchingLogOut, | 687 base::Bind(&GaiaCookieManagerService::StartFetchingLogOut, |
| 686 base::Unretained(this)))); | 688 base::Unretained(this)))); |
| 687 return; | 689 return; |
| 688 } | 690 } |
| 689 | 691 |
| 692 FOR_EACH_OBSERVER(Observer, observer_list_, |
| 693 OnLogOutAccountsFromCookieCompleted(error)); |
| 690 HandleNextRequest(); | 694 HandleNextRequest(); |
| 691 } | 695 } |
| 692 | 696 |
| 693 void GaiaCookieManagerService::StartFetchingUbertoken() { | 697 void GaiaCookieManagerService::StartFetchingUbertoken() { |
| 694 VLOG(1) << "GaiaCookieManagerService::StartFetchingUbertoken account_id=" | 698 VLOG(1) << "GaiaCookieManagerService::StartFetchingUbertoken account_id=" |
| 695 << requests_.front().account_id(); | 699 << requests_.front().account_id(); |
| 696 uber_token_fetcher_.reset(new UbertokenFetcher( | 700 uber_token_fetcher_.reset(new UbertokenFetcher( |
| 697 token_service_, this, source_, signin_client_->GetURLRequestContext(), | 701 token_service_, this, source_, signin_client_->GetURLRequestContext(), |
| 698 base::Bind(&SigninClient::CreateGaiaAuthFetcher, | 702 base::Bind(&SigninClient::CreateGaiaAuthFetcher, |
| 699 base::Unretained(signin_client_)))); | 703 base::Unretained(signin_client_)))); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 break; | 770 break; |
| 767 case GaiaCookieRequestType::LIST_ACCOUNTS: | 771 case GaiaCookieRequestType::LIST_ACCOUNTS: |
| 768 uber_token_fetcher_.reset(); | 772 uber_token_fetcher_.reset(); |
| 769 signin_client_->DelayNetworkCall( | 773 signin_client_->DelayNetworkCall( |
| 770 base::Bind(&GaiaCookieManagerService::StartFetchingListAccounts, | 774 base::Bind(&GaiaCookieManagerService::StartFetchingListAccounts, |
| 771 base::Unretained(this))); | 775 base::Unretained(this))); |
| 772 break; | 776 break; |
| 773 } | 777 } |
| 774 } | 778 } |
| 775 } | 779 } |
| OLD | NEW |