summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-03 08:16:42 +0000
committerkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-03 08:16:42 +0000
commit9c34aa24e1dd9d05b01711d746c99184c935eef8 (patch)
tree9098851439326f23c3dcb8cd5ccde7241a17b92f /chrome/browser
parent9ff54f9eca5d8fd77ee0392d9fe173c62353a058 (diff)
downloadchromium_src-9c34aa24e1dd9d05b01711d746c99184c935eef8.zip
chromium_src-9c34aa24e1dd9d05b01711d746c99184c935eef8.tar.gz
chromium_src-9c34aa24e1dd9d05b01711d746c99184c935eef8.tar.bz2
[win] Differentiate between fast and non-fast startup path UMAs.
On windows we can complete the ProcessSingleton rendesvouz before we load chrome.dll and proceed with the rest of chrome startup. If we do it is known as a fast start. This change adds fast versions of the UMAs Startup.ShowAppListWarmStart and Startup.WarmStartTimeFromRemoteProcessStart so we can compare the timings of the fast and non-fast cases. Review URL: https://chromiumcodereview.appspot.com/18150005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209914 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/chrome_browser_main.cc12
-rw-r--r--chrome/browser/chrome_process_finder_win.cc8
-rw-r--r--chrome/browser/chrome_process_finder_win.h4
-rw-r--r--chrome/browser/process_singleton_win.cc2
-rw-r--r--chrome/browser/ui/app_list/app_list_service.cc9
5 files changed, 25 insertions, 10 deletions
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 8de46fd..a959216 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -427,9 +427,15 @@ bool ProcessSingletonNotificationCallback(
command_line.GetSwitchValueASCII(switches::kOriginalProcessStartTime);
int64 remote_start_time;
if (base::StringToInt64(start_time_string, &remote_start_time)) {
- UMA_HISTOGRAM_LONG_TIMES(
- "Startup.WarmStartTimeFromRemoteProcessStart",
- base::Time::Now() - base::Time::FromInternalValue(remote_start_time));
+ base::TimeDelta elapsed =
+ base::Time::Now() - base::Time::FromInternalValue(remote_start_time);
+ if (command_line.HasSwitch(switches::kFastStart)) {
+ UMA_HISTOGRAM_LONG_TIMES(
+ "Startup.WarmStartTimeFromRemoteProcessStartFast", elapsed);
+ } else {
+ UMA_HISTOGRAM_LONG_TIMES(
+ "Startup.WarmStartTimeFromRemoteProcessStart", elapsed);
+ }
}
}
diff --git a/chrome/browser/chrome_process_finder_win.cc b/chrome/browser/chrome_process_finder_win.cc
index c7a4985..34f6761 100644
--- a/chrome/browser/chrome_process_finder_win.cc
+++ b/chrome/browser/chrome_process_finder_win.cc
@@ -93,7 +93,7 @@ std::string EscapeQueryParamValue(const std::string& text, bool use_plus) {
// END COPY from net/base/escape.cc
-}
+} // namespace
namespace chrome {
@@ -102,7 +102,8 @@ HWND FindRunningChromeWindow(const base::FilePath& user_data_dir) {
user_data_dir.value().c_str());
}
-NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window) {
+NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window,
+ bool fast_start) {
DCHECK(remote_window);
static const char kSearchUrl[] =
"http://www.google.com/search?q=%s&sourceid=chrome&ie=UTF-8";
@@ -150,6 +151,9 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window) {
base::Int64ToString(
base::CurrentProcessInfo::CreationTime()->ToInternalValue()));
+ if (fast_start)
+ command_line.AppendSwitch(switches::kFastStart);
+
// Send the command line to the remote chrome window.
// Format is "START\0<<<current directory>>>\0<<<commandline>>>".
std::wstring to_send(L"START\0", 6); // want the NULL in the string.
diff --git a/chrome/browser/chrome_process_finder_win.h b/chrome/browser/chrome_process_finder_win.h
index 46c49ed..bc5c81f 100644
--- a/chrome/browser/chrome_process_finder_win.h
+++ b/chrome/browser/chrome_process_finder_win.h
@@ -25,7 +25,9 @@ HWND FindRunningChromeWindow(const base::FilePath& user_data_dir);
// Attempts to send the current command line to an already running instance of
// Chrome via a WM_COPYDATA message.
// Returns true if a running Chrome is found and successfully notified.
-NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window);
+// |fast_start| is true when this is being called on the window fast start path.
+NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window,
+ bool fast_start);
} // namespace chrome
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
index cb4a1c3..237004a 100644
--- a/chrome/browser/process_singleton_win.cc
+++ b/chrome/browser/process_singleton_win.cc
@@ -288,7 +288,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
return PROCESS_NONE;
}
- switch (chrome::AttemptToNotifyRunningChrome(remote_window_)) {
+ switch (chrome::AttemptToNotifyRunningChrome(remote_window_, false)) {
case chrome::NOTIFY_SUCCESS:
return PROCESS_NOTIFIED;
case chrome::NOTIFY_FAILED:
diff --git a/chrome/browser/ui/app_list/app_list_service.cc b/chrome/browser/ui/app_list/app_list_service.cc
index 717e94c..8ae72eb 100644
--- a/chrome/browser/ui/app_list/app_list_service.cc
+++ b/chrome/browser/ui/app_list/app_list_service.cc
@@ -24,7 +24,7 @@ base::TimeDelta GetTimeFromOriginalProcessStart(
return base::Time::Now() - base::Time::FromInternalValue(remote_start_time);
}
-}
+} // namespace
// static
void AppListService::RegisterPrefs(PrefRegistrySimple* registry) {
@@ -41,8 +41,11 @@ void AppListService::RecordShowTimings(const CommandLine& command_line) {
// The presence of kOriginalProcessStartTime implies that another process
// has sent us its command line to handle, ie: we are already running.
if (command_line.HasSwitch(switches::kOriginalProcessStartTime)) {
- UMA_HISTOGRAM_LONG_TIMES("Startup.ShowAppListWarmStart",
- GetTimeFromOriginalProcessStart(command_line));
+ base::TimeDelta elapsed = GetTimeFromOriginalProcessStart(command_line);
+ if (command_line.HasSwitch(switches::kFastStart))
+ UMA_HISTOGRAM_LONG_TIMES("Startup.ShowAppListWarmStartFast", elapsed);
+ else
+ UMA_HISTOGRAM_LONG_TIMES("Startup.ShowAppListWarmStart", elapsed);
} else {
// base::CurrentProcessInfo::CreationTime() is only defined on win/mac.
#if defined(OS_WIN) || defined(OS_MACOSX)