#include "chrome/common/chrome_switches.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 component_updater {
namespace {
const char kSwitchUrlSource[] = "url-source";
#define COMPONENT_UPDATER_SERVICE_ENDPOINT \
- "//clients2.google.com/service/update2"
+ "//clients2.google.com/service/update2"
// The default url for the v3 protocol service endpoint. Can be
// overridden with --component-updater=url-source=someurl.
const char kDefaultUrlSource[] = "https:" COMPONENT_UPDATER_SERVICE_ENDPOINT;
// The url to send the pings to.
-const char kPingUrl[] = "http:" COMPONENT_UPDATER_SERVICE_ENDPOINT;
+const char kPingUrl[] = "https:" COMPONENT_UPDATER_SERVICE_ENDPOINT;
-#if defined(OS_WIN)
// Disables differential updates.
const char kSwitchDisableDeltaUpdates[] = "disable-delta-updates";
+
+#if defined(OS_WIN)
// Disables background downloads.
const char kSwitchDisableBackgroundDownloads[] = "disable-background-downloads";
#endif // defined(OS_WIN)
if (vec.empty())
return std::string();
for (std::vector<std::string>::const_iterator it = vec.begin();
- it != vec.end();
- ++it) {
+ it != vec.end();
+ ++it) {
const std::size_t found = it->find("=");
if (found != std::string::npos) {
if (it->substr(0, found) == test) {
virtual size_t UrlSizeLimit() OVERRIDE;
virtual net::URLRequestContextGetter* RequestContext() OVERRIDE;
virtual bool InProcess() OVERRIDE;
- virtual ComponentPatcher* CreateComponentPatcher() OVERRIDE;
virtual bool DeltasEnabled() const OVERRIDE;
virtual bool UseBackgroundDownloader() const OVERRIDE;
bool background_downloads_enabled_;
};
-ChromeConfigurator::ChromeConfigurator(const CommandLine* cmdline,
+ChromeConfigurator::ChromeConfigurator(
+ const CommandLine* cmdline,
net::URLRequestContextGetter* url_request_getter)
- : url_request_getter_(url_request_getter),
- fast_update_(false),
- pings_enabled_(false),
- deltas_enabled_(false),
- background_downloads_enabled_(false) {
+ : url_request_getter_(url_request_getter),
+ fast_update_(false),
+ pings_enabled_(false),
+ deltas_enabled_(false),
+ background_downloads_enabled_(false) {
// Parse comma-delimited debug flags.
std::vector<std::string> switch_values;
Tokenize(cmdline->GetSwitchValueASCII(switches::kComponentUpdater),
- ",", &switch_values);
+ ",",
+ &switch_values);
fast_update_ = HasSwitchValue(switch_values, kSwitchFastUpdate);
pings_enabled_ = !HasSwitchValue(switch_values, kSwitchDisablePings);
-#if defined(OS_WIN)
deltas_enabled_ = !HasSwitchValue(switch_values, kSwitchDisableDeltaUpdates);
+
+#if defined(OS_WIN)
background_downloads_enabled_ =
!HasSwitchValue(switch_values, kSwitchDisableBackgroundDownloads);
#else
- deltas_enabled_ = false;
background_downloads_enabled_ = false;
#endif
return false;
}
-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) {
+ const CommandLine* cmdline,
+ net::URLRequestContextGetter* context_getter) {
return new ChromeConfigurator(cmdline, context_getter);
}