diff options
author | grt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-25 20:26:59 +0000 |
---|---|---|
committer | grt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-25 20:26:59 +0000 |
commit | 53a6c1eff8bedf9638d4d4c3f2c23898b4587bcc (patch) | |
tree | f29900a88e44ee5d2e0518f48cb158141dee9fed /chrome/installer/util | |
parent | c13db2d19b2a335a115f9532b4b5a60f6cb2d669 (diff) | |
download | chromium_src-53a6c1eff8bedf9638d4d4c3f2c23898b4587bcc.zip chromium_src-53a6c1eff8bedf9638d4d4c3f2c23898b4587bcc.tar.gz chromium_src-53a6c1eff8bedf9638d4d4c3f2c23898b4587bcc.tar.bz2 |
Remove some dead app host code.
app_host.exe was removed in r220555. This change removes some dead code
that was left behind. Specifically:
- chrome_launcher_support no longer exposes any methods related to the
AppHost.
- Chrome's uninstall prompt no longer has a special case to handle
suppressing the "delete your profile" checkbox.
- Chrome and its installer no longer have a dependency on
launcher_support.
- The installer no longer supports installing items from the webstore.
- GetUntrustedDataValue no longer has consumers and is gone.
BUG=297647
R=benwells@chromium.org,huangs@chromium.org,gab@chromium.org
Review URL: https://codereview.chromium.org/422453004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285661 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util')
-rw-r--r-- | chrome/installer/util/chrome_app_host_distribution.cc | 8 | ||||
-rw-r--r-- | chrome/installer/util/google_update_util.cc | 100 | ||||
-rw-r--r-- | chrome/installer/util/google_update_util.h | 14 | ||||
-rw-r--r-- | chrome/installer/util/util_constants.cc | 1 | ||||
-rw-r--r-- | chrome/installer/util/util_constants.h | 1 |
5 files changed, 3 insertions, 121 deletions
diff --git a/chrome/installer/util/chrome_app_host_distribution.cc b/chrome/installer/util/chrome_app_host_distribution.cc index 85e50d5..6e831e5 100644 --- a/chrome/installer/util/chrome_app_host_distribution.cc +++ b/chrome/installer/util/chrome_app_host_distribution.cc @@ -21,17 +21,11 @@ #include "installer_util_strings.h" // NOLINT -namespace { - -const wchar_t kChromeAppHostGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}"; - -} // namespace - ChromeAppHostDistribution::ChromeAppHostDistribution() : BrowserDistribution( CHROME_APP_HOST, scoped_ptr<AppRegistrationData>( - new UpdatingAppRegistrationData(kChromeAppHostGuid))) { + new UpdatingAppRegistrationData(installer::kAppLauncherGuid))) { } base::string16 ChromeAppHostDistribution::GetBaseAppName() { diff --git a/chrome/installer/util/google_update_util.cc b/chrome/installer/util/google_update_util.cc index c7de7a5..d3013ba 100644 --- a/chrome/installer/util/google_update_util.cc +++ b/chrome/installer/util/google_update_util.cc @@ -4,28 +4,19 @@ #include "chrome/installer/util/google_update_util.h" -#include <algorithm> -#include <map> -#include <utility> -#include <vector> - #include "base/command_line.h" -#include "base/environment.h" #include "base/file_util.h" #include "base/files/file_path.h" #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/process/kill.h" #include "base/process/launch.h" #include "base/strings/string16.h" -#include "base/strings/string_split.h" #include "base/time/time.h" #include "base/win/registry.h" #include "base/win/scoped_handle.h" #include "base/win/win_util.h" #include "base/win/windows_version.h" -#include "chrome/installer/launcher_support/chrome_launcher_support.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/google_update_constants.h" #include "chrome/installer/util/google_update_settings.h" @@ -41,9 +32,6 @@ namespace { const int kGoogleUpdateTimeoutMs = 20 * 1000; -const char kEnvVariableUntrustedData[] = "GoogleUpdateUntrustedData"; -const int kUntrustedDataMaxLength = 4096; - // Returns true if Google Update is present at the given level. bool IsGoogleUpdatePresent(bool system_install) { // Using the existence of version key in the registry to decide. @@ -120,73 +108,6 @@ bool LaunchProcessAndWaitWithTimeout(const base::string16& cmd_string, return success; } -bool IsNotPrintable(unsigned char c) { - return c < 32 || c >= 127; -} - -// Returns whether or not |s| consists of printable characters. -bool IsStringPrintable(const std::string& s) { - return std::find_if(s.begin(), s.end(), IsNotPrintable) == s.end(); -} - -bool IsIllegalUntrustedDataKeyChar(unsigned char c) { - return !(c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || - c >= '0' && c <= '9' || c == '-' || c == '_' || c == '$'); -} - -// Returns true if |key| from untrusted data is valid. -bool IsUntrustedDataKeyValid(const std::string& key) { - return std::find_if(key.begin(), key.end(), IsIllegalUntrustedDataKeyChar) - == key.end(); -} - -// Parses |data_string| as key-value pairs and overwrites |untrusted_data| with -// the result. Returns true if the data could be parsed. -bool ParseUntrustedData( - const std::string& data_string, - std::map<std::string, std::string>* untrusted_data) { - DCHECK(untrusted_data); - if (data_string.length() > kUntrustedDataMaxLength || - !IsStringPrintable(data_string)) { - LOG(ERROR) << "Invalid value in untrusted data string."; - return false; - } - - VLOG(1) << "Untrusted data string: " << data_string; - - std::vector<std::pair<std::string, std::string> > kv_pairs; - if (!base::SplitStringIntoKeyValuePairs(data_string, '=', '&', &kv_pairs)) { - LOG(ERROR) << "Failed to parse untrusted data: " << data_string; - return false; - } - - untrusted_data->clear(); - std::vector<std::pair<std::string, std::string> >::const_iterator it; - for (it = kv_pairs.begin(); it != kv_pairs.end(); ++it) { - const std::string& key(it->first); - // TODO(huangs): URL unescape |value|. - const std::string& value(it->second); - if (IsUntrustedDataKeyValid(key) && IsStringPrintable(value)) - (*untrusted_data)[key] = value; - else - LOG(ERROR) << "Illegal character found in untrusted data."; - } - return true; -} - -// Reads and parses untrusted data passed from Google Update as key-value -// pairs, then overwrites |untrusted_data_map| with the result. -// Returns true if data are successfully read. -bool GetGoogleUpdateUntrustedData( - std::map<std::string, std::string>* untrusted_data) { - scoped_ptr<base::Environment> env(base::Environment::Create()); - std::string data_string; - if (!env || !env->GetVar(kEnvVariableUntrustedData, &data_string)) - return false; - - return ParseUntrustedData(data_string, untrusted_data); -} - } // namespace bool EnsureUserLevelGoogleUpdatePresent() { @@ -266,25 +187,4 @@ void ElevateIfNeededToReenableUpdates() { } } -std::string GetUntrustedDataValue(const std::string& key) { - std::map<std::string, std::string> untrusted_data; - if (GetGoogleUpdateUntrustedData(&untrusted_data)) { - std::map<std::string, std::string>::const_iterator data_it( - untrusted_data.find(key)); - if (data_it != untrusted_data.end()) - return data_it->second; - } - - return std::string(); -} - -std::string GetUntrustedDataValueFromTag(const std::string& tag, - const std::string& key) { - std::map<std::string, std::string> untrusted_data; - if (ParseUntrustedData(tag, &untrusted_data)) - return untrusted_data[key]; - - return std::string(); -} - } // namespace google_update diff --git a/chrome/installer/util/google_update_util.h b/chrome/installer/util/google_update_util.h index 4f240af..97edfad 100644 --- a/chrome/installer/util/google_update_util.h +++ b/chrome/installer/util/google_update_util.h @@ -5,8 +5,6 @@ #ifndef CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_UTIL_H_ #define CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_UTIL_H_ -#include <string> - namespace google_update { // If user-level Google Update is absent, calls the system-level @@ -27,18 +25,6 @@ bool UninstallGoogleUpdate(bool system_install); // GoogleUpdateSettings::ReenableAutoupdatesForApp() to do the work. void ElevateIfNeededToReenableUpdates(); -// Returns the value corresponding to |key| in untrusted data passed from -// Google Update. Returns an empty string if |key| is absent or if its value -// contains non-printable characters. -std::string GetUntrustedDataValue(const std::string& key); - -// Returns the value corresponding to |key| in untrusted data passed from -// |tag|. |tag| should be a printable list of key-value pairs, e.g. -// "key1=value1&key2=value2". Returns an empty string if |key| is absent or if -// its value contains non-printable characters. -std::string GetUntrustedDataValueFromTag(const std::string& tag, - const std::string& key); - } // namespace google_update #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_UTIL_H_ diff --git a/chrome/installer/util/util_constants.cc b/chrome/installer/util/util_constants.cc index 8800c5c..67df18e 100644 --- a/chrome/installer/util/util_constants.cc +++ b/chrome/installer/util/util_constants.cc @@ -212,6 +212,7 @@ const char kOutputFile[] = "output-file"; // TODO(gab): Rename setup.exe itself altogether and use the same binary for // Active Setup. const wchar_t kActiveSetupExe[] = L"chrmstp.exe"; +const wchar_t kAppLauncherGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}"; const wchar_t kChromeAppHostExe[] = L"app_host.exe"; const wchar_t kChromeDll[] = L"chrome.dll"; const wchar_t kChromeChildDll[] = L"chrome_child.dll"; diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h index d2f648a..da54a38 100644 --- a/chrome/installer/util/util_constants.h +++ b/chrome/installer/util/util_constants.h @@ -201,6 +201,7 @@ extern const char kOutputFile[]; } // namespace switches extern const wchar_t kActiveSetupExe[]; +extern const wchar_t kAppLauncherGuid[]; extern const wchar_t kChromeAppHostExe[]; extern const wchar_t kChromeDll[]; extern const wchar_t kChromeChildDll[]; |