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

Side by Side Diff: google_apis/gaia/account_tracker.cc

Issue 472773002: Avoid using an empty scopes set when requesting an OAuth2 access token. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/stl_util.h" 9 #include "base/stl_util.h"
10 #include "net/url_request/url_request_context_getter.h" 10 #include "net/url_request/url_request_context_getter.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 account_key_(account_key) { 267 account_key_(account_key) {
268 TRACE_EVENT_ASYNC_BEGIN1( 268 TRACE_EVENT_ASYNC_BEGIN1(
269 "identity", "AccountIdFetcher", this, "account_key", account_key); 269 "identity", "AccountIdFetcher", this, "account_key", account_key);
270 } 270 }
271 271
272 AccountIdFetcher::~AccountIdFetcher() { 272 AccountIdFetcher::~AccountIdFetcher() {
273 TRACE_EVENT_ASYNC_END0("identity", "AccountIdFetcher", this); 273 TRACE_EVENT_ASYNC_END0("identity", "AccountIdFetcher", this);
274 } 274 }
275 275
276 void AccountIdFetcher::Start() { 276 void AccountIdFetcher::Start() {
277 OAuth2TokenService::ScopeSet scopes;
278 scopes.insert("https://www.googleapis.com/auth/userinfo.profile");
277 login_token_request_ = token_service_->StartRequest( 279 login_token_request_ = token_service_->StartRequest(
278 account_key_, OAuth2TokenService::ScopeSet(), this); 280 account_key_, scopes, this);
279 } 281 }
280 282
281 void AccountIdFetcher::OnGetTokenSuccess( 283 void AccountIdFetcher::OnGetTokenSuccess(
282 const OAuth2TokenService::Request* request, 284 const OAuth2TokenService::Request* request,
283 const std::string& access_token, 285 const std::string& access_token,
284 const base::Time& expiration_time) { 286 const base::Time& expiration_time) {
285 TRACE_EVENT_ASYNC_STEP_PAST0( 287 TRACE_EVENT_ASYNC_STEP_PAST0(
286 "identity", "AccountIdFetcher", this, "OnGetTokenSuccess"); 288 "identity", "AccountIdFetcher", this, "OnGetTokenSuccess");
287 DCHECK_EQ(request, login_token_request_.get()); 289 DCHECK_EQ(request, login_token_request_.get());
288 290
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 "AccountIdFetcher", 330 "AccountIdFetcher",
329 this, 331 this,
330 "OnNetworkError", 332 "OnNetworkError",
331 "response_code", 333 "response_code",
332 response_code); 334 response_code);
333 LOG(ERROR) << "OnNetworkError " << response_code; 335 LOG(ERROR) << "OnNetworkError " << response_code;
334 tracker_->OnUserInfoFetchFailure(this); 336 tracker_->OnUserInfoFetchFailure(this);
335 } 337 }
336 338
337 } // namespace gaia 339 } // namespace gaia
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698