| Index: trunk/src/chrome/browser/component_updater/component_updater_configurator.cc
|
| ===================================================================
|
| --- trunk/src/chrome/browser/component_updater/component_updater_configurator.cc (revision 207822)
|
| +++ trunk/src/chrome/browser/component_updater/component_updater_configurator.cc (working copy)
|
| @@ -14,39 +14,31 @@
|
| #include "base/strings/string_util.h"
|
| #include "base/win/windows_version.h"
|
| #include "build/build_config.h"
|
| -#include "chrome/browser/component_updater/component_patcher.h"
|
| #include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/omaha_query_params/omaha_query_params.h"
|
| #include "net/url_request/url_request_context_getter.h"
|
|
|
| -#if defined(OS_WIN)
|
| -#include "chrome/browser/component_updater/component_patcher_win.h"
|
| -#endif
|
| -
|
| namespace {
|
| -
|
| // Default time constants.
|
| const int kDelayOneMinute = 60;
|
| const int kDelayOneHour = kDelayOneMinute * 60;
|
|
|
| // Debug values you can pass to --component-updater-debug=value1,value2.
|
| // Speed up component checking.
|
| -const char kSwitchFastUpdate[] = "fast-update";
|
| +const char kDebugFastUpdate[] = "fast-update";
|
| // Force out-of-process-xml parsing.
|
| -const char kSwitchOutOfProcess[] = "out-of-process";
|
| +const char kDebugOutOfProcess[] = "out-of-process";
|
| // Add "testrequest=1" parameter to the update check query.
|
| -const char kSwitchRequestParam[] = "test-request";
|
| -// Disables differential updates.
|
| -const char kSwitchDisableDeltaUpdates[] = "disable-delta-updates";
|
| +const char kDebugRequestParam[] = "test-request";
|
|
|
| // The urls from which an update manifest can be fetched.
|
| const char* kUrlSources[] = {
|
| "http://clients2.google.com/service/update2/crx", // BANDAID
|
| "http://omaha.google.com/service/update2/crx", // CWS_PUBLIC
|
| - "http://omaha.sandbox.google.com/service/update2/crx", // CWS_SANDBOX
|
| + "http://omaha.sandbox.google.com/service/update2/crx" // CWS_SANDBOX
|
| };
|
|
|
| -bool HasSwitchValue(const std::vector<std::string>& vec, const char* test) {
|
| +bool HasDebugValue(const std::vector<std::string>& vec, const char* test) {
|
| if (vec.empty())
|
| return 0;
|
| return (std::find(vec.begin(), vec.end(), test) != vec.end());
|
| @@ -72,36 +64,25 @@
|
| virtual net::URLRequestContextGetter* RequestContext() OVERRIDE;
|
| virtual bool InProcess() OVERRIDE;
|
| virtual void OnEvent(Events event, int val) OVERRIDE;
|
| - virtual ComponentPatcher* CreateComponentPatcher() OVERRIDE;
|
| - virtual bool DeltasEnabled() const OVERRIDE;
|
|
|
| private:
|
| net::URLRequestContextGetter* url_request_getter_;
|
| std::string extra_info_;
|
| bool fast_update_;
|
| bool out_of_process_;
|
| - bool deltas_enabled_;
|
| };
|
|
|
| ChromeConfigurator::ChromeConfigurator(const CommandLine* cmdline,
|
| net::URLRequestContextGetter* url_request_getter)
|
| : url_request_getter_(url_request_getter),
|
| extra_info_(chrome::OmahaQueryParams::Get(
|
| - chrome::OmahaQueryParams::CHROME)),
|
| - fast_update_(false),
|
| - out_of_process_(false),
|
| - deltas_enabled_(false) {
|
| + chrome::OmahaQueryParams::CHROME)) {
|
| // Parse comma-delimited debug flags.
|
| - std::vector<std::string> switch_values;
|
| - Tokenize(cmdline->GetSwitchValueASCII(switches::kComponentUpdater),
|
| - ",", &switch_values);
|
| - fast_update_ = HasSwitchValue(switch_values, kSwitchFastUpdate);
|
| - out_of_process_ = HasSwitchValue(switch_values, kSwitchOutOfProcess);
|
| -#if defined(OS_WIN)
|
| - deltas_enabled_ = !HasSwitchValue(switch_values, kSwitchDisableDeltaUpdates);
|
| -#else
|
| - deltas_enabled_ = false;
|
| -#endif
|
| + std::vector<std::string> debug_values;
|
| + Tokenize(cmdline->GetSwitchValueASCII(switches::kComponentUpdaterDebug),
|
| + ",", &debug_values);
|
| + fast_update_ = HasDebugValue(debug_values, kDebugFastUpdate);
|
| + out_of_process_ = HasDebugValue(debug_values, kDebugOutOfProcess);
|
|
|
| // Make the extra request params, they are necessary so omaha does
|
| // not deliver components that are going to be rejected at install time.
|
| @@ -110,7 +91,7 @@
|
| base::win::OSInfo::WOW64_ENABLED)
|
| extra_info_ += "&wow64=1";
|
| #endif
|
| - if (HasSwitchValue(switch_values, kSwitchRequestParam))
|
| + if (HasDebugValue(debug_values, kDebugRequestParam))
|
| extra_info_ += "&testrequest=1";
|
| }
|
|
|
| @@ -180,18 +161,6 @@
|
| }
|
| }
|
|
|
| -ComponentPatcher* ChromeConfigurator::CreateComponentPatcher() {
|
| -#if defined(OS_WIN)
|
| - return new ComponentPatcherWin();
|
| -#else
|
| - return new ComponentPatcherCrossPlatform();
|
| -#endif
|
| -}
|
| -
|
| -bool ChromeConfigurator::DeltasEnabled() const {
|
| - return deltas_enabled_;
|
| -}
|
| -
|
| ComponentUpdateService::Configurator* MakeChromeComponentUpdaterConfigurator(
|
| const CommandLine* cmdline, net::URLRequestContextGetter* context_getter) {
|
| return new ChromeConfigurator(cmdline, context_getter);
|
|
|