| 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 "google_apis/gaia/account_tracker.h" | 5 #include "google_apis/gaia/account_tracker.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/profiler/scoped_profile.h" |
| 9 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 10 #include "net/url_request/url_request_context_getter.h" | 11 #include "net/url_request/url_request_context_getter.h" |
| 11 | 12 |
| 12 namespace gaia { | 13 namespace gaia { |
| 13 | 14 |
| 14 AccountTracker::AccountTracker( | 15 AccountTracker::AccountTracker( |
| 15 IdentityProvider* identity_provider, | 16 IdentityProvider* identity_provider, |
| 16 net::URLRequestContextGetter* request_context_getter) | 17 net::URLRequestContextGetter* request_context_getter) |
| 17 : identity_provider_(identity_provider), | 18 : identity_provider_(identity_provider), |
| 18 request_context_getter_(request_context_getter), | 19 request_context_getter_(request_context_getter), |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 const AccountState& state = it->second; | 78 const AccountState& state = it->second; |
| 78 if (state.ids.gaia == gaia_id) { | 79 if (state.ids.gaia == gaia_id) { |
| 79 return state.ids; | 80 return state.ids; |
| 80 } | 81 } |
| 81 } | 82 } |
| 82 | 83 |
| 83 return AccountIds(); | 84 return AccountIds(); |
| 84 } | 85 } |
| 85 | 86 |
| 86 void AccountTracker::OnRefreshTokenAvailable(const std::string& account_id) { | 87 void AccountTracker::OnRefreshTokenAvailable(const std::string& account_id) { |
| 88 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422460 is fixed. |
| 89 tracked_objects::ScopedProfile tracking_profile( |
| 90 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 91 "422460 AccountTracker::OnRefreshTokenAvailable")); |
| 92 |
| 87 TRACE_EVENT1("identity", | 93 TRACE_EVENT1("identity", |
| 88 "AccountTracker::OnRefreshTokenAvailable", | 94 "AccountTracker::OnRefreshTokenAvailable", |
| 89 "account_key", | 95 "account_key", |
| 90 account_id); | 96 account_id); |
| 91 | 97 |
| 92 // Ignore refresh tokens if there is no active account ID at all. | 98 // Ignore refresh tokens if there is no active account ID at all. |
| 93 if (identity_provider_->GetActiveAccountId().empty()) | 99 if (identity_provider_->GetActiveAccountId().empty()) |
| 94 return; | 100 return; |
| 95 | 101 |
| 96 DVLOG(1) << "AVAILABLE " << account_id; | 102 DVLOG(1) << "AVAILABLE " << account_id; |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 "AccountIdFetcher", | 336 "AccountIdFetcher", |
| 331 this, | 337 this, |
| 332 "OnNetworkError", | 338 "OnNetworkError", |
| 333 "response_code", | 339 "response_code", |
| 334 response_code); | 340 response_code); |
| 335 LOG(ERROR) << "OnNetworkError " << response_code; | 341 LOG(ERROR) << "OnNetworkError " << response_code; |
| 336 tracker_->OnUserInfoFetchFailure(this); | 342 tracker_->OnUserInfoFetchFailure(this); |
| 337 } | 343 } |
| 338 | 344 |
| 339 } // namespace gaia | 345 } // namespace gaia |
| OLD | NEW |