Commit 35cad3d3 authored by grt@chromium.org's avatar grt@chromium.org

Remove support for specifying version on command line.

This was added for the sake of Chrome Frame and is now no longer needed.

BUG=316496
R=cpu@chromium.org

Review URL: https://codereview.chromium.org/129003003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244197 0039d316-1c4b-4281-b951-d872f2087c98
parent beaf6cdc
...@@ -219,10 +219,7 @@ MainDllLoader::~MainDllLoader() { ...@@ -219,10 +219,7 @@ MainDllLoader::~MainDllLoader() {
// Loading chrome is an interesting affair. First we try loading from the // Loading chrome is an interesting affair. First we try loading from the
// current directory to support run-what-you-compile and other development // current directory to support run-what-you-compile and other development
// scenarios. // scenarios.
// If that fails then we look at the --chrome-version command line flag to // If that fails then we look at the version resource in the current
// determine if we should stick with an older dll version even if a new one is
// available to support upgrade-in-place scenarios.
// If that fails then finally we look at the version resource in the current
// module. This is the expected path for chrome.exe browser instances in an // module. This is the expected path for chrome.exe browser instances in an
// installed build. // installed build.
HMODULE MainDllLoader::Load(base::string16* out_version, HMODULE MainDllLoader::Load(base::string16* out_version,
...@@ -232,24 +229,9 @@ HMODULE MainDllLoader::Load(base::string16* out_version, ...@@ -232,24 +229,9 @@ HMODULE MainDllLoader::Load(base::string16* out_version,
*out_file = dir; *out_file = dir;
HMODULE dll = LoadChromeWithDirectory(out_file); HMODULE dll = LoadChromeWithDirectory(out_file);
if (!dll) { if (!dll) {
// Loading from same directory (for developers) failed. // Loading from same directory (for developers) failed. Look at the version
base::string16 version_string; // resource in the current module and try loading that.
if (cmd_line.HasSwitch(switches::kChromeVersion)) { base::string16 version_string(GetCurrentModuleVersion());
// This is used to support Chrome Frame, see http://crbug.com/88589.
version_string = cmd_line.GetSwitchValueNative(switches::kChromeVersion);
if (!Version(WideToASCII(version_string)).IsValid()) {
// If a bogus command line flag was given, then abort.
LOG(ERROR) << "Invalid command line version: " << version_string;
return NULL;
}
}
// If no version on the command line, then look at the version resource in
// the current module and try loading that.
if (version_string.empty())
version_string = GetCurrentModuleVersion();
if (version_string.empty()) { if (version_string.empty()) {
LOG(ERROR) << "No valid Chrome version found"; LOG(ERROR) << "No valid Chrome version found";
return NULL; return NULL;
......
...@@ -225,29 +225,6 @@ bool SwapNewChromeExeIfPresent() { ...@@ -225,29 +225,6 @@ bool SwapNewChromeExeIfPresent() {
base::win::RegKey key; base::win::RegKey key;
if (key.Open(reg_root, dist->GetVersionKey().c_str(), if (key.Open(reg_root, dist->GetVersionKey().c_str(),
KEY_QUERY_VALUE) == ERROR_SUCCESS) { KEY_QUERY_VALUE) == ERROR_SUCCESS) {
// Having just ascertained that we can swap, now check that we should: if
// we are given an explicit --chrome-version flag, don't rename unless the
// specified version matches the "pv" value. In practice, this is used to
// defer Chrome Frame updates until the current version of the Chrome Frame
// DLL component is loaded.
const CommandLine& cmd_line = *CommandLine::ForCurrentProcess();
if (cmd_line.HasSwitch(switches::kChromeVersion)) {
std::string version_string =
cmd_line.GetSwitchValueASCII(switches::kChromeVersion);
Version cmd_version(version_string);
std::wstring pv_value;
if (key.ReadValue(google_update::kRegVersionField,
&pv_value) == ERROR_SUCCESS) {
Version pv_version(WideToASCII(pv_value));
if (cmd_version.IsValid() && pv_version.IsValid() &&
!cmd_version.Equals(pv_version)) {
return false;
}
}
}
// First try to rename exe by launching rename command ourselves. // First try to rename exe by launching rename command ourselves.
std::wstring rename_cmd; std::wstring rename_cmd;
if (key.ReadValue(google_update::kRegRenameCmdField, if (key.ReadValue(google_update::kRegRenameCmdField,
......
...@@ -166,10 +166,6 @@ const char kCheckForUpdateIntervalSec[] = "check-for-update-interval"; ...@@ -166,10 +166,6 @@ const char kCheckForUpdateIntervalSec[] = "check-for-update-interval";
const char kCheckCloudPrintConnectorPolicy[] = const char kCheckCloudPrintConnectorPolicy[] =
"check-cloud-print-connector-policy"; "check-cloud-print-connector-policy";
// Tells chrome to load the specified version of chrome.dll on Windows. If this
// version cannot be loaded, Chrome will exit.
const char kChromeVersion[] = "chrome-version";
// Comma-separated list of SSL cipher suites to disable. // Comma-separated list of SSL cipher suites to disable.
const char kCipherSuiteBlacklist[] = "cipher-suite-blacklist"; const char kCipherSuiteBlacklist[] = "cipher-suite-blacklist";
......
...@@ -59,7 +59,6 @@ extern const char kCancelFirstRun[]; ...@@ -59,7 +59,6 @@ extern const char kCancelFirstRun[];
extern const char kCertificateTransparencyLog[]; extern const char kCertificateTransparencyLog[];
extern const char kCheckForUpdateIntervalSec[]; extern const char kCheckForUpdateIntervalSec[];
extern const char kCheckCloudPrintConnectorPolicy[]; extern const char kCheckCloudPrintConnectorPolicy[];
extern const char kChromeVersion[];
extern const char kCipherSuiteBlacklist[]; extern const char kCipherSuiteBlacklist[];
extern const char kClearTokenService[]; extern const char kClearTokenService[];
extern const char kCloudPrintDeleteFile[]; extern const char kCloudPrintDeleteFile[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment