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

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

Issue 686963002: Switching profiler instrumentations from ScopedProfile to ScopedTracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « google_apis/gaia/identity_provider.cc ('k') | google_apis/gaia/oauth2_api_call_flow.cc » ('j') | 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/oauth2_access_token_fetcher_impl.h" 5 #include "google_apis/gaia/oauth2_access_token_fetcher_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/json/json_reader.h" 11 #include "base/json/json_reader.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/metrics/sparse_histogram.h" 13 #include "base/metrics/sparse_histogram.h"
14 #include "base/profiler/scoped_profile.h" 14 #include "base/profiler/scoped_tracker.h"
15 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "base/time/time.h" 17 #include "base/time/time.h"
18 #include "base/values.h" 18 #include "base/values.h"
19 #include "google_apis/gaia/gaia_urls.h" 19 #include "google_apis/gaia/gaia_urls.h"
20 #include "google_apis/gaia/google_service_auth_error.h" 20 #include "google_apis/gaia/google_service_auth_error.h"
21 #include "net/base/escape.h" 21 #include "net/base/escape.h"
22 #include "net/base/load_flags.h" 22 #include "net/base/load_flags.h"
23 #include "net/http/http_status_code.h" 23 #include "net/http/http_status_code.h"
24 #include "net/url_request/url_fetcher.h" 24 #include "net/url_request/url_fetcher.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 252 }
253 253
254 void OAuth2AccessTokenFetcherImpl::OnGetTokenFailure( 254 void OAuth2AccessTokenFetcherImpl::OnGetTokenFailure(
255 const GoogleServiceAuthError& error) { 255 const GoogleServiceAuthError& error) {
256 state_ = ERROR_STATE; 256 state_ = ERROR_STATE;
257 FireOnGetTokenFailure(error); 257 FireOnGetTokenFailure(error);
258 } 258 }
259 259
260 void OAuth2AccessTokenFetcherImpl::OnURLFetchComplete( 260 void OAuth2AccessTokenFetcherImpl::OnURLFetchComplete(
261 const net::URLFetcher* source) { 261 const net::URLFetcher* source) {
262 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422577 is fixed. 262 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422577 is fixed.
263 tracked_objects::ScopedProfile tracking_profile( 263 tracked_objects::ScopedTracker tracking_profile(
264 FROM_HERE_WITH_EXPLICIT_FUNCTION( 264 FROM_HERE_WITH_EXPLICIT_FUNCTION(
265 "422577 OAuth2AccessTokenFetcherImpl::OnURLFetchComplete")); 265 "422577 OAuth2AccessTokenFetcherImpl::OnURLFetchComplete"));
266 266
267 CHECK(source); 267 CHECK(source);
268 CHECK(state_ == GET_ACCESS_TOKEN_STARTED); 268 CHECK(state_ == GET_ACCESS_TOKEN_STARTED);
269 EndGetAccessToken(source); 269 EndGetAccessToken(source);
270 } 270 }
271 271
272 // static 272 // static
273 GURL OAuth2AccessTokenFetcherImpl::MakeGetAccessTokenUrl() { 273 GURL OAuth2AccessTokenFetcherImpl::MakeGetAccessTokenUrl() {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 // static 318 // static
319 bool OAuth2AccessTokenFetcherImpl::ParseGetAccessTokenFailureResponse( 319 bool OAuth2AccessTokenFetcherImpl::ParseGetAccessTokenFailureResponse(
320 const net::URLFetcher* source, 320 const net::URLFetcher* source,
321 std::string* error) { 321 std::string* error) {
322 CHECK(error); 322 CHECK(error);
323 scoped_ptr<base::DictionaryValue> value = ParseGetAccessTokenResponse(source); 323 scoped_ptr<base::DictionaryValue> value = ParseGetAccessTokenResponse(source);
324 if (value.get() == NULL) 324 if (value.get() == NULL)
325 return false; 325 return false;
326 return value->GetString(kErrorKey, error); 326 return value->GetString(kErrorKey, error);
327 } 327 }
OLDNEW
« no previous file with comments | « google_apis/gaia/identity_provider.cc ('k') | google_apis/gaia/oauth2_api_call_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698