| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/signin/mutable_profile_oauth2_token_service_delegate.h" | 5 #include "chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.h" |
| 6 | 6 |
| 7 #include "base/profiler/scoped_tracker.h" | 7 #include "base/profiler/scoped_tracker.h" |
| 8 #include "components/signin/core/browser/signin_client.h" | 8 #include "components/signin/core/browser/signin_client.h" |
| 9 #include "components/signin/core/browser/signin_metrics.h" | 9 #include "components/signin/core/browser/signin_metrics.h" |
| 10 #include "components/signin/core/browser/webdata/token_web_data.h" | 10 #include "components/signin/core/browser/webdata/token_web_data.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 std::string RemoveAccountIdPrefix(const std::string& prefixed_account_id) { | 37 std::string RemoveAccountIdPrefix(const std::string& prefixed_account_id) { |
| 38 return prefixed_account_id.substr(kAccountIdPrefixLength); | 38 return prefixed_account_id.substr(kAccountIdPrefixLength); |
| 39 } | 39 } |
| 40 | 40 |
| 41 } // namespace | 41 } // namespace |
| 42 | 42 |
| 43 // This class sends a request to GAIA to revoke the given refresh token from | 43 // This class sends a request to GAIA to revoke the given refresh token from |
| 44 // the server. This is a best effort attempt only. This class deletes itself | 44 // the server. This is a best effort attempt only. This class deletes itself |
| 45 // when done sucessfully or otherwise. | 45 // when done successfully or otherwise. |
| 46 class MutableProfileOAuth2TokenServiceDelegate::RevokeServerRefreshToken | 46 class MutableProfileOAuth2TokenServiceDelegate::RevokeServerRefreshToken |
| 47 : public GaiaAuthConsumer { | 47 : public GaiaAuthConsumer { |
| 48 public: | 48 public: |
| 49 RevokeServerRefreshToken( | 49 RevokeServerRefreshToken( |
| 50 MutableProfileOAuth2TokenServiceDelegate* token_service_delegate, | 50 MutableProfileOAuth2TokenServiceDelegate* token_service_delegate, |
| 51 const std::string& account_id); | 51 const std::string& account_id); |
| 52 ~RevokeServerRefreshToken() override; | 52 ~RevokeServerRefreshToken() override; |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 // GaiaAuthConsumer overrides: | 55 // GaiaAuthConsumer overrides: |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 CancelWebTokenFetch(); | 512 CancelWebTokenFetch(); |
| 513 refresh_tokens_.clear(); | 513 refresh_tokens_.clear(); |
| 514 } | 514 } |
| 515 | 515 |
| 516 void MutableProfileOAuth2TokenServiceDelegate::OnNetworkChanged( | 516 void MutableProfileOAuth2TokenServiceDelegate::OnNetworkChanged( |
| 517 net::NetworkChangeNotifier::ConnectionType type) { | 517 net::NetworkChangeNotifier::ConnectionType type) { |
| 518 // If our network has changed, reset the backoff timer so that errors caused | 518 // If our network has changed, reset the backoff timer so that errors caused |
| 519 // by a previous lack of network connectivity don't prevent new requests. | 519 // by a previous lack of network connectivity don't prevent new requests. |
| 520 backoff_entry_.Reset(); | 520 backoff_entry_.Reset(); |
| 521 } | 521 } |
| OLD | NEW |