Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / component_updater / component_updater_configurator.cc
index 87046bf..269dea1 100644 (file)
 #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 {
@@ -44,18 +40,19 @@ extern const char kSwitchDisablePings[] = "disable-pings";
 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)
@@ -76,8 +73,8 @@ std::string GetSwitchArgument(const std::vector<std::string>& vec,
   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) {
@@ -109,7 +106,6 @@ class ChromeConfigurator : public ComponentUpdateService::Configurator {
   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;
 
@@ -123,25 +119,27 @@ class ChromeConfigurator : public ComponentUpdateService::Configurator {
   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
 
@@ -202,14 +200,6 @@ bool ChromeConfigurator::InProcess() {
   return false;
 }
 
-ComponentPatcher* ChromeConfigurator::CreateComponentPatcher() {
-#if defined(OS_WIN)
-  return new ComponentPatcherWin();
-#else
-  return new ComponentPatcherCrossPlatform();
-#endif
-}
-
 bool ChromeConfigurator::DeltasEnabled() const {
   return deltas_enabled_;
 }
@@ -219,7 +209,8 @@ bool ChromeConfigurator::UseBackgroundDownloader() const {
 }
 
 ComponentUpdateService::Configurator* MakeChromeComponentUpdaterConfigurator(
-    const CommandLine* cmdline, net::URLRequestContextGetter* context_getter) {
+    const CommandLine* cmdline,
+    net::URLRequestContextGetter* context_getter) {
   return new ChromeConfigurator(cmdline, context_getter);
 }