summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/chrome_exe_main_win.cc6
-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
-rw-r--r--chrome/common/chrome_switches.cc5
-rw-r--r--chrome/common/chrome_switches.h1
8 files changed, 35 insertions, 12 deletions
diff --git a/chrome/app/chrome_exe_main_win.cc b/chrome/app/chrome_exe_main_win.cc
index abba672..bffca3b 100644
--- a/chrome/app/chrome_exe_main_win.cc
+++ b/chrome/app/chrome_exe_main_win.cc
@@ -83,8 +83,10 @@ bool AttemptFastNotify(const CommandLine& command_line) {
policy::path_parser::CheckUserDataDirPolicy(&user_data_dir);
HWND chrome = chrome::FindRunningChromeWindow(user_data_dir);
- return chrome &&
- chrome::AttemptToNotifyRunningChrome(chrome) == chrome::NOTIFY_SUCCESS;
+ if (!chrome)
+ return false;
+ return chrome::AttemptToNotifyRunningChrome(chrome, true) ==
+ chrome::NOTIFY_SUCCESS;
}
} // namespace
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)
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 57c7c57..3d0e582 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -750,6 +750,11 @@ const char kExtraSearchQueryParams[] = "extra-search-query-params";
// is UNKNOWN.
const char kFakeVariationsChannel[] = "fake-variations-channel";
+// If this flag is present then this command line is being delegated to an
+// already running chrome process via the fast path, ie: before chrome.dll is
+// loaded. It is useful to tell the difference for tracking purposes.
+const char kFastStart[] = "fast-start";
+
// These two flags are added around the switches about:flags adds to the
// command line. This is useful to see which switches were added by about:flags
// on about:version. They don't have any effect.
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 4c2aa46..b142607 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -210,6 +210,7 @@ extern const char kExtensionProcess[];
extern const char kExtensionsUpdateFrequency[];
extern const char kExtraSearchQueryParams[];
extern const char kFakeVariationsChannel[];
+extern const char kFastStart[];
extern const char kFlagSwitchesBegin[];
extern const char kFlagSwitchesEnd[];
extern const char kFeedbackServer[];