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

Unified Diff: chrome/browser/chromeos/boot_times_loader.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
« no previous file with comments | « chrome/browser/chromeos/boot_times_loader.h ('k') | chrome/browser/chromeos/login/background_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « chrome/browser/chromeos/boot_times_loader.h ('k') | chrome/browser/chromeos/login/background_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698