Chromium Code Reviews| Index: chrome/browser/chromeos/boot_times_loader.cc |
| diff --git a/chrome/browser/chromeos/boot_times_loader.cc b/chrome/browser/chromeos/boot_times_loader.cc |
| index 86354ae5e3b2079cf75027a81f33a01a906c9285..d213bff9b085b0f6742bc072d32dfd6d5c476d3d 100644 |
| --- a/chrome/browser/chromeos/boot_times_loader.cc |
| +++ b/chrome/browser/chromeos/boot_times_loader.cc |
| @@ -10,6 +10,7 @@ |
| #include "base/file_path.h" |
| #include "base/file_util.h" |
| #include "base/message_loop.h" |
| +#include "base/file_util.h" |
|
sky
2010/05/05 23:32:22
before message_loop.
|
| #include "base/process_util.h" |
| #include "base/string_util.h" |
| #include "base/thread.h" |
| @@ -100,12 +101,21 @@ void BootTimesLoader::Backend::GetBootTimes( |
| const char* kClockSpeedCommand = "dmesg | grep -e 'Detected.*processor'"; |
| const char* kClockSpeedPrefix = "Detected "; |
| const char* kPreStartup = "uptime-pre-startup"; |
| + const char* kChromeExec = "uptime-chrome-exec"; |
| + const char* kChromeMain = "uptime-chrome-main"; |
| const char* kXStarted = "uptime-x-started"; |
| const char* kLoginPromptReady = "uptime-login-prompt-ready"; |
| if (request->canceled()) |
| return; |
| + // Wait until login_prompt_ready is output. |
| + FilePath log_dir(kLogPath); |
| + FilePath log_file = log_dir.Append(kLoginPromptReady); |
| + while (!file_util::PathExists(log_file)) { |
| + usleep(500000); |
| + } |
| + |
| BootTimes boot_times; |
| std::string tsc_value = ExecuteInShell(kInitialTSCCommand, kInitialTSCPrefix); |
| std::string speed_value = |
| @@ -122,6 +132,8 @@ void BootTimesLoader::Backend::GetBootTimes( |
| } |
| GetUptime(kPreStartup, &boot_times.pre_startup); |
| GetUptime(kXStarted, &boot_times.x_started); |
| + GetUptime(kChromeExec, &boot_times.chrome_exec); |
| + GetUptime(kChromeMain, &boot_times.chrome_main); |
| GetUptime(kLoginPromptReady, &boot_times.login_prompt_ready); |
| request->ForwardResult( |