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

Side by Side Diff: chrome/browser/chromeos/login/oauth2_login_manager.cc

Issue 23444077: Started measuring time for session restore process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/oauth2_login_manager.h" 5 #include "chrome/browser/chromeos/login/oauth2_login_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 if (token_service->AreCredentialsValid()) 209 if (token_service->AreCredentialsValid())
210 token_service->StartFetchingTokens(); 210 token_service->StartFetchingTokens();
211 } 211 }
212 212
213 void OAuth2LoginManager::SetSessionRestoreState( 213 void OAuth2LoginManager::SetSessionRestoreState(
214 OAuth2LoginManager::SessionRestoreState state) { 214 OAuth2LoginManager::SessionRestoreState state) {
215 if (state_ == state) 215 if (state_ == state)
216 return; 216 return;
217 217
218 state_ = state; 218 state_ = state;
219 if (state == OAuth2LoginManager::SESSION_RESTORE_FAILED) {
220 UMA_HISTOGRAM_TIMES("OAuth2Login.SessionRestoreTimeToFailure",
221 base::Time::Now() - session_restore_start_);
222 } else if (state == OAuth2LoginManager::SESSION_RESTORE_DONE) {
223 UMA_HISTOGRAM_TIMES("OAuth2Login.SessionRestoreTimeToSuccess",
224 base::Time::Now() - session_restore_start_);
225 }
226
219 FOR_EACH_OBSERVER(Observer, observer_list_, 227 FOR_EACH_OBSERVER(Observer, observer_list_,
220 OnSessionRestoreStateChanged(user_profile_, state_)); 228 OnSessionRestoreStateChanged(user_profile_, state_));
221 } 229 }
222 230
223 void OAuth2LoginManager::SetSessionRestoreStartForTesting( 231 void OAuth2LoginManager::SetSessionRestoreStartForTesting(
224 const base::Time& time) { 232 const base::Time& time) {
225 session_restore_start_ = time; 233 session_restore_start_ = time;
226 } 234 }
227 235
228 } // namespace chromeos 236 } // namespace chromeos
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