Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / net / connection_tester.cc
index eca301c..ae905e0 100644 (file)
@@ -36,6 +36,7 @@
 #include "net/url_request/url_request.h"
 #include "net/url_request/url_request_context.h"
 #include "net/url_request/url_request_context_storage.h"
+#include "net/url_request/url_request_job_factory_impl.h"
 
 #if !defined(OS_ANDROID) && !defined(OS_IOS)
 #include "chrome/browser/net/firefox_proxy_settings.h"
@@ -58,7 +59,7 @@ class ExperimentURLRequestContext : public net::URLRequestContext {
         storage_(this),
         weak_factory_(this) {}
 
-  virtual ~ExperimentURLRequestContext() {}
+  ~ExperimentURLRequestContext() override { AssertNoURLRequests(); }
 
   // Creates a proxy config service for |experiment|. On success returns net::OK
   // and fills |config_service| with a new pointer. Otherwise returns a network
@@ -134,6 +135,9 @@ class ExperimentURLRequestContext : public net::URLRequestContext {
     // In-memory cookie store.
     storage_.set_cookie_store(
         content::CreateCookieStore(content::CookieStoreConfig()));
+    // Creating a new job factory avoids added ProtocolHandlers and
+    // layered URLRequestInterceptingJobFactories.
+    storage_.set_job_factory(new net::URLRequestJobFactoryImpl());
 
     return net::OK;
   }
@@ -189,10 +193,6 @@ class ExperimentURLRequestContext : public net::URLRequestContext {
     }
 
     net::DhcpProxyScriptFetcherFactory dhcp_factory;
-    if (CommandLine::ForCurrentProcess()->HasSwitch(
-        switches::kDisableDhcpWpad)) {
-      dhcp_factory.set_enabled(false);
-    }
 
 #if defined(OS_IOS)
     experiment_proxy_service->reset(
@@ -316,9 +316,8 @@ class ConnectionTester::TestRunner : public net::URLRequest::Delegate {
   void Run(const Experiment& experiment);
 
   // Overridden from net::URLRequest::Delegate:
-  virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE;
-  virtual void OnReadCompleted(net::URLRequest* request,
-                               int bytes_read) OVERRIDE;
+  void OnResponseStarted(net::URLRequest* request) override;
+  void OnReadCompleted(net::URLRequest* request, int bytes_read) override;
   // TODO(eroman): handle cases requiring authentication.
 
  private:
@@ -412,7 +411,7 @@ void ConnectionTester::TestRunner::ProxyConfigServiceCreated(
   }
   // Fetch a request using the experimental context.
   request_ = request_context_->CreateRequest(
-      experiment.url, net::DEFAULT_PRIORITY, this);
+      experiment.url, net::DEFAULT_PRIORITY, this, NULL);
   request_->Start();
 }