summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_tab.cc
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-18 17:56:54 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-18 17:56:54 +0000
commit7fc3e692468c2974201ebad17ce3d091dac17560 (patch)
tree4fe518207e66a05023c92e994d8b737a44aeda28 /chrome_frame/chrome_tab.cc
parent4bc5050cff918be02204d27a26c333283e94b16e (diff)
downloadchromium_src-7fc3e692468c2974201ebad17ce3d091dac17560.zip
chromium_src-7fc3e692468c2974201ebad17ce3d091dac17560.tar.gz
chromium_src-7fc3e692468c2974201ebad17ce3d091dac17560.tar.bz2
Enable boot-time prefetching for Chrome Frame for all dev and CEEE channels on XP only (where there's no superfetch).
BUG=None TEST=None Review URL: http://codereview.chromium.org/5138003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66639 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_tab.cc')
-rw-r--r--chrome_frame/chrome_tab.cc53
1 files changed, 33 insertions, 20 deletions
diff --git a/chrome_frame/chrome_tab.cc b/chrome_frame/chrome_tab.cc
index c31e8ec..0b1ae30 100644
--- a/chrome_frame/chrome_tab.cc
+++ b/chrome_frame/chrome_tab.cc
@@ -301,32 +301,45 @@ HRESULT RefreshElevationPolicy() {
// The idea here is to try this out on chrome frame dev channel
// and see if it produces a significant drift in startup numbers.
HRESULT SetupRunOnce() {
- if (base::win::GetVersion() >= base::win::VERSION_VISTA)
- return S_OK;
+ HRESULT result = E_FAIL;
std::wstring channel_name;
- if (!GoogleUpdateSettings::GetChromeChannel(true, &channel_name) ||
- (0 != lstrcmpiW(L"dev", channel_name.c_str()))) {
- return S_OK;
- }
-
- HKEY hive = HKEY_CURRENT_USER;
- if (IsSystemProcess()) {
- // For system installs, our updates will be running as SYSTEM which
- // makes writing to a RunOnce key under HKCU not so terribly useful.
- hive = HKEY_LOCAL_MACHINE;
- }
+ if (base::win::GetVersion() < base::win::VERSION_VISTA &&
+ GoogleUpdateSettings::GetChromeChannel(true, &channel_name)) {
+ std::transform(channel_name.begin(), channel_name.end(),
+ channel_name.begin(), tolower);
+ // Use this only for the dev channel and CEEE channels.
+ if (channel_name.find(L"dev") != std::wstring::npos ||
+ channel_name.find(L"ceee") != std::wstring::npos) {
+
+ HKEY hive = HKEY_CURRENT_USER;
+ if (IsSystemProcess()) {
+ // For system installs, our updates will be running as SYSTEM which
+ // makes writing to a RunOnce key under HKCU not so terribly useful.
+ hive = HKEY_LOCAL_MACHINE;
+ }
- RegKey run_once;
- if (run_once.Create(hive, kRunOnce, KEY_READ | KEY_WRITE)) {
- CommandLine run_once_command(chrome_launcher::GetChromeExecutablePath());
- run_once_command.AppendSwitchASCII(switches::kAutomationClientChannelID,
+ RegKey run_once;
+ if (run_once.Create(hive, kRunOnce, KEY_READ | KEY_WRITE)) {
+ CommandLine run_once_cmd(chrome_launcher::GetChromeExecutablePath());
+ run_once_cmd.AppendSwitchASCII(switches::kAutomationClientChannelID,
"0");
- run_once_command.AppendSwitch(switches::kChromeFrame);
- run_once.WriteValue(L"A", run_once_command.command_line_string().c_str());
+ run_once_cmd.AppendSwitch(switches::kChromeFrame);
+ if (run_once.WriteValue(L"A",
+ run_once_cmd.command_line_string().c_str())) {
+ result = S_OK;
+ }
+ }
+ } else {
+ result = S_FALSE;
+ }
+ } else {
+ // We're on a non-XP version of Windows or on a stable channel. Nothing
+ // needs doing.
+ result = S_FALSE;
}
- return S_OK;
+ return result;
}
// Helper method called for user-level installs where we don't have admin