| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 if (db_tokens.count(ApplyAccountIdPrefix(canon_account_id)) == 0) | 376 if (db_tokens.count(ApplyAccountIdPrefix(canon_account_id)) == 0) |
| 377 PersistCredentials(canon_account_id, refresh_token); | 377 PersistCredentials(canon_account_id, refresh_token); |
| 378 } | 378 } |
| 379 | 379 |
| 380 account_id = canon_account_id; | 380 account_id = canon_account_id; |
| 381 } | 381 } |
| 382 | 382 |
| 383 // Only load secondary accounts when account consistency is enabled. | 383 // Only load secondary accounts when account consistency is enabled. |
| 384 if (switches::IsEnableAccountConsistency() || | 384 if (switches::IsEnableAccountConsistency() || |
| 385 account_id == loading_primary_account_id_) { | 385 account_id == loading_primary_account_id_) { |
| 386 refresh_tokens_[account_id].reset(new AccountStatus( | 386 refresh_tokens_[account_id].reset(new AccountStatus( |
| 387 signin_error_controller_, account_id, refresh_token)); | 387 signin_error_controller_, account_id, refresh_token)); |
| 388 FireRefreshTokenAvailable(account_id); | 388 FireRefreshTokenAvailable(account_id); |
| 389 } else { | 389 } else { |
| 390 RevokeCredentialsOnServer(refresh_token); | 390 RevokeCredentialsOnServer(refresh_token); |
| 391 ClearPersistedCredentials(account_id); | 391 ClearPersistedCredentials(account_id); |
| 392 FireRefreshTokenRevoked(account_id); | 392 FireRefreshTokenRevoked(account_id); |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 } | 395 } |
| 396 | 396 |
| 397 if (!old_login_token.empty()) { | 397 if (!old_login_token.empty()) { |
| 398 DCHECK(!loading_primary_account_id_.empty()); | 398 DCHECK(!loading_primary_account_id_.empty()); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 net::NetworkChangeNotifier::ConnectionType type) { | 525 net::NetworkChangeNotifier::ConnectionType type) { |
| 526 // If our network has changed, reset the backoff timer so that errors caused | 526 // If our network has changed, reset the backoff timer so that errors caused |
| 527 // by a previous lack of network connectivity don't prevent new requests. | 527 // by a previous lack of network connectivity don't prevent new requests. |
| 528 backoff_entry_.Reset(); | 528 backoff_entry_.Reset(); |
| 529 } | 529 } |
| 530 | 530 |
| 531 const net::BackoffEntry* | 531 const net::BackoffEntry* |
| 532 MutableProfileOAuth2TokenServiceDelegate::BackoffEntry() const { | 532 MutableProfileOAuth2TokenServiceDelegate::BackoffEntry() const { |
| 533 return &backoff_entry_; | 533 return &backoff_entry_; |
| 534 } | 534 } |
| OLD | NEW |