summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util/google_chrome_distribution.cc
diff options
context:
space:
mode:
authorcpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-23 19:43:00 +0000
committercpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-23 19:43:00 +0000
commitd2cf63114443ab592bee4acaa04a431356a23cd8 (patch)
tree59ea6950dafc151d359d585b5243abf0eae1233d /chrome/installer/util/google_chrome_distribution.cc
parent89c3317ba1adf8d974fc3b649ea6ac00ef6c0dae (diff)
downloadchromium_src-d2cf63114443ab592bee4acaa04a431356a23cd8.zip
chromium_src-d2cf63114443ab592bee4acaa04a431356a23cd8.tar.gz
chromium_src-d2cf63114443ab592bee4acaa04a431356a23cd8.tar.bz2
Toast experiment: I need to re-laucnh chrome because google_update likes setup to finish fast.
- Added new cmd line flag to setup.exe: --inactive-user-toast BUG= b/1484308 TEST = see the bug Review URL: http://codereview.chromium.org/144015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19044 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/google_chrome_distribution.cc')
-rw-r--r--chrome/installer/util/google_chrome_distribution.cc24
1 files changed, 19 insertions, 5 deletions
diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc
index c75e475..359c7c7 100644
--- a/chrome/installer/util/google_chrome_distribution.cc
+++ b/chrome/installer/util/google_chrome_distribution.cc
@@ -92,6 +92,15 @@ int GetDirectoryWriteAgeInHours(const wchar_t* path) {
return (now_time - dir_time);
}
+// Launches again this same process with a single switch --|flag|. Does not
+// wait for the process to terminate.
+bool RelaunchSetup(const std::wstring& flag) {
+ CommandLine cmd_line(CommandLine::ForCurrentProcess()->program());
+ cmd_line.AppendSwitch(flag);
+ return base::LaunchApp(InstallUtil::GetChromeUninstallCmd(false),
+ false, false, NULL);
+}
+
} // namespace
bool GoogleChromeDistribution::BuildUninstallMetricsString(
@@ -423,6 +432,13 @@ void GoogleChromeDistribution::LaunchUserExperiment(
if (dir_age_hours < kNinetyDays)
return;
}
+ LOG(INFO) << "User qualified for toast experiment";
+ // The experiment needs to be performed in a different process because
+ // google_update expects the upgrade process to be quick and nimble.
+ RelaunchSetup(installer_util::switches::kInactiveUserToast);
+}
+
+void GoogleChromeDistribution::InactiveUserToastExperiment() {
// User qualifies for the experiment. Launch chrome with --try-chrome. Before
// that we need to change the client so we can track the progress.
if (!GoogleUpdateSettings::SetClient(kToastExpBaseGroup))
@@ -450,11 +466,9 @@ void GoogleChromeDistribution::LaunchUserExperiment(
GoogleUpdateSettings::SetClient(outcome);
if (outcome != kToastExpUninstallGroup)
return;
- // The user wants to uninstall. This is a best effort operation. While this
- // seems it could be a race (after all we are in the upgrade process) in
- // practice the user will be faced with a dialog which gives us plenty of
- // time to exit.
+ // The user wants to uninstall. This is a best effort operation. Note that
+ // we waited for chrome to exit so the uninstall would not detect chrome
+ // running.
base::LaunchApp(InstallUtil::GetChromeUninstallCmd(false),
false, false, NULL);
}
-