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

Side by Side Diff: chrome/browser/chromeos/login/signin/token_handle_util.cc

Issue 2172023002: chrome/browser/chromeos: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
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/chromeos/login/signin/token_handle_util.h" 5 #include "chrome/browser/chromeos/login/signin/token_handle_util.h"
6 6
7 #include "base/memory/weak_ptr.h" 7 #include "base/memory/weak_ptr.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/chromeos/profiles/profile_helper.h" 10 #include "chrome/browser/chromeos/profiles/profile_helper.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 if (!user_manager::known_user::FindPrefs(account_id, &dict)) { 79 if (!user_manager::known_user::FindPrefs(account_id, &dict)) {
80 callback.Run(account_id, UNKNOWN); 80 callback.Run(account_id, UNKNOWN);
81 return; 81 return;
82 } 82 }
83 if (!dict->GetString(kTokenHandlePref, &token)) { 83 if (!dict->GetString(kTokenHandlePref, &token)) {
84 callback.Run(account_id, UNKNOWN); 84 callback.Run(account_id, UNKNOWN);
85 return; 85 return;
86 } 86 }
87 87
88 if (!gaia_client_.get()) { 88 if (!gaia_client_.get()) {
89 auto request_context = 89 auto* request_context =
90 chromeos::ProfileHelper::Get()->GetSigninProfile()->GetRequestContext(); 90 chromeos::ProfileHelper::Get()->GetSigninProfile()->GetRequestContext();
91 gaia_client_.reset(new gaia::GaiaOAuthClient(request_context)); 91 gaia_client_.reset(new gaia::GaiaOAuthClient(request_context));
92 } 92 }
93 93
94 validation_delegates_.set( 94 validation_delegates_.set(
95 token, std::unique_ptr<TokenDelegate>(new TokenDelegate( 95 token, std::unique_ptr<TokenDelegate>(new TokenDelegate(
96 weak_factory_.GetWeakPtr(), account_id, token, callback))); 96 weak_factory_.GetWeakPtr(), account_id, token, callback)));
97 gaia_client_->GetTokenHandleInfo(token, kMaxRetries, 97 gaia_client_->GetTokenHandleInfo(token, kMaxRetries,
98 validation_delegates_.get(token)); 98 validation_delegates_.get(token));
99 } 99 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 if (token_info->GetInteger("expires_in", &expires_in)) 151 if (token_info->GetInteger("expires_in", &expires_in))
152 outcome = (expires_in < 0) ? INVALID : VALID; 152 outcome = (expires_in < 0) ? INVALID : VALID;
153 } 153 }
154 154
155 const base::TimeDelta duration = 155 const base::TimeDelta duration =
156 base::TimeTicks::Now() - tokeninfo_response_start_time_; 156 base::TimeTicks::Now() - tokeninfo_response_start_time_;
157 UMA_HISTOGRAM_TIMES("Login.TokenCheckResponseTime", duration); 157 UMA_HISTOGRAM_TIMES("Login.TokenCheckResponseTime", duration);
158 callback_.Run(account_id_, outcome); 158 callback_.Run(account_id_, outcome);
159 NotifyDone(); 159 NotifyDone();
160 } 160 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698