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

Side by Side Diff: chrome/browser/chromeos/boot_times_recorder.cc

Issue 1036723003: favor DCHECK_CURRENTLY_ON for better logs in chrome/browser/chromeos/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/boot_times_recorder.h" 5 #include "chrome/browser/chromeos/boot_times_recorder.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 since_prev.InSecondsF(), 303 since_prev.InSecondsF(),
304 name.data()); 304 name.data());
305 prev = tm.time(); 305 prev = tm.time();
306 } 306 }
307 output += '\n'; 307 output += '\n';
308 308
309 base::WriteFile(log_path.Append(base_name), output.data(), output.size()); 309 base::WriteFile(log_path.Append(base_name), output.data(), output.size());
310 } 310 }
311 311
312 void BootTimesRecorder::LoginDone(bool is_user_new) { 312 void BootTimesRecorder::LoginDone(bool is_user_new) {
313 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 313 DCHECK_CURRENTLY_ON(BrowserThread::UI);
314 if (login_done_) 314 if (login_done_)
315 return; 315 return;
316 316
317 login_done_ = true; 317 login_done_ = true;
318 AddLoginTimeMarker("LoginDone", false); 318 AddLoginTimeMarker("LoginDone", false);
319 RecordCurrentStats(kChromeFirstRender); 319 RecordCurrentStats(kChromeFirstRender);
320 if (have_registered_) { 320 if (have_registered_) {
321 registrar_.Remove(this, 321 registrar_.Remove(this,
322 content::NOTIFICATION_LOAD_START, 322 content::NOTIFICATION_LOAD_START,
323 content::NotificationService::AllSources()); 323 content::NotificationService::AllSources());
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 410
411 void BootTimesRecorder::SaveChromeMainStats() { 411 void BootTimesRecorder::SaveChromeMainStats() {
412 chrome_main_stats_ = Stats::GetCurrentStats(); 412 chrome_main_stats_ = Stats::GetCurrentStats();
413 } 413 }
414 414
415 void BootTimesRecorder::RecordChromeMainStats() { 415 void BootTimesRecorder::RecordChromeMainStats() {
416 chrome_main_stats_.RecordStats(kChromeMain); 416 chrome_main_stats_.RecordStats(kChromeMain);
417 } 417 }
418 418
419 void BootTimesRecorder::RecordLoginAttempted() { 419 void BootTimesRecorder::RecordLoginAttempted() {
420 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 420 DCHECK_CURRENTLY_ON(BrowserThread::UI);
421 if (login_done_) 421 if (login_done_)
422 return; 422 return;
423 423
424 login_time_markers_.clear(); 424 login_time_markers_.clear();
425 AddLoginTimeMarker("LoginStarted", false); 425 AddLoginTimeMarker("LoginStarted", false);
426 if (!have_registered_) { 426 if (!have_registered_) {
427 have_registered_ = true; 427 have_registered_ = true;
428 registrar_.Add(this, content::NOTIFICATION_LOAD_START, 428 registrar_.Add(this, content::NOTIFICATION_LOAD_START,
429 content::NotificationService::AllSources()); 429 content::NotificationService::AllSources());
430 registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, 430 registrar_.Add(this, content::NOTIFICATION_LOAD_STOP,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 GetRenderWidgetHost(&web_contents->GetController()); 516 GetRenderWidgetHost(&web_contents->GetController());
517 render_widget_hosts_loading_.erase(render_widget_host); 517 render_widget_hosts_loading_.erase(render_widget_host);
518 break; 518 break;
519 } 519 }
520 default: 520 default:
521 break; 521 break;
522 } 522 }
523 } 523 }
524 524
525 } // namespace chromeos 525 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc ('k') | chrome/browser/chromeos/camera_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698