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

Unified Diff: chrome/browser/chromeos/login/background_view.cc

Issue 2003001: Add time for when chrome's main() is called. (Closed)
Patch Set: Created 10 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/background_view.cc
diff --git a/chrome/browser/chromeos/login/background_view.cc b/chrome/browser/chromeos/login/background_view.cc
index 6e4e54a2b744667296fd4f9dc3faf849bb008475..e57c4d75c510fdf2590c2aa0970af91878a71f7d 100644
--- a/chrome/browser/chromeos/login/background_view.cc
+++ b/chrome/browser/chromeos/login/background_view.cc
@@ -198,14 +198,31 @@ void BackgroundView::OnBootTimes(
BootTimesLoader::Handle handle, BootTimesLoader::BootTimes boot_times) {
// TODO(davemoore) if we decide to keep these times visible we will need
// to localize the strings.
- std::string boot_times_text =
- StringPrintf(
- "Boot took %.2f seconds "
- "(firmware %.2fs, kernel %.2fs, user %.2fs)",
- boot_times.firmware + boot_times.login_prompt_ready,
- boot_times.firmware,
- boot_times.pre_startup,
- boot_times.login_prompt_ready - boot_times.pre_startup);
+ const char* kBootTimesNoChromeExec =
+ "Boot took %.2f seconds (firmware %.2fs, kernel %.2fs, system %.2fs)";
+ const char* kBootTimesChromeExec =
+ "Boot took %.2f seconds "
+ "(firmware %.2fs, kernel %.2fs, system %.2fs, chrome %.2fs)";
+ std::string boot_times_text;
+
+ if (boot_times.chrome_exec > 0) {
+ boot_times_text =
+ StringPrintf(
+ kBootTimesChromeExec,
+ boot_times.firmware + boot_times.login_prompt_ready,
+ boot_times.firmware,
+ boot_times.pre_startup,
+ boot_times.chrome_exec - boot_times.pre_startup,
+ boot_times.login_prompt_ready - boot_times.chrome_exec);
+ } else {
+ boot_times_text =
+ StringPrintf(
+ kBootTimesNoChromeExec,
+ boot_times.firmware + boot_times.login_prompt_ready,
+ boot_times.firmware,
+ boot_times.pre_startup,
+ boot_times.login_prompt_ready - boot_times.pre_startup);
+ }
boot_times_label_->SetText(ASCIIToWide(boot_times_text));
}
« chrome/browser/chromeos/boot_times_loader.cc ('K') | « chrome/browser/chromeos/boot_times_loader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698