Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / net / proxy_service_factory.cc
index 66180e6..0d2be36 100644 (file)
@@ -11,6 +11,7 @@
 #include "chrome/browser/io_thread.h"
 #include "chrome/browser/net/pref_proxy_config_tracker_impl.h"
 #include "chrome/common/chrome_switches.h"
+#include "chrome/common/pref_names.h"
 #include "content/public/browser/browser_thread.h"
 #include "net/base/net_log.h"
 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h"
@@ -25,8 +26,8 @@
 #include "chromeos/network/dhcp_proxy_script_fetcher_chromeos.h"
 #endif  // defined(OS_CHROMEOS)
 
-#if defined(OS_WIN)
-#include "win8/util/win8_util.h"
+#if !defined(OS_IOS)
+#include "net/proxy/proxy_resolver_v8.h"
 #endif
 
 using content::BrowserThread;
@@ -53,8 +54,8 @@ net::ProxyConfigService* ProxyServiceFactory::CreateProxyConfigService(
   // that code be moved to chrome/browser instead of being in net, so that it
   // can use BrowserThread instead of raw MessageLoop pointers? See bug 25354.
   base_service.reset(net::ProxyService::CreateSystemProxyConfigService(
-      BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(),
-      BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE)));
+      BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
+      BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)));
 #endif  // !defined(OS_CHROMEOS)
 
   return tracker->CreateTrackingProxyConfigService(base_service.Pass())
@@ -90,7 +91,8 @@ net::ProxyService* ProxyServiceFactory::CreateProxyService(
     net::URLRequestContext* context,
     net::NetworkDelegate* network_delegate,
     net::ProxyConfigService* proxy_config_service,
-    const CommandLine& command_line) {
+    const CommandLine& command_line,
+    bool quick_check_enabled) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
 
 #if defined(OS_IOS)
@@ -105,12 +107,6 @@ net::ProxyService* ProxyServiceFactory::CreateProxyService(
   }
 #endif  // defined(OS_IOS)
 
-#if defined(OS_WIN)
-  // Crashes. http://crbug.com/266838
-  if (use_v8 && win8::IsSingleWindowMetroMode())
-    use_v8 = false;
-#endif
-
   size_t num_pac_threads = 0u;  // Use default number of threads.
 
   // Check the command line for an override on the number of proxy resolver
@@ -132,14 +128,14 @@ net::ProxyService* ProxyServiceFactory::CreateProxyService(
 #if defined(OS_IOS)
     NOTREACHED();
 #else
+    net::ProxyResolverV8::EnsureIsolateCreated();
+
     net::DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher;
 #if defined(OS_CHROMEOS)
     dhcp_proxy_script_fetcher =
         new chromeos::DhcpProxyScriptFetcherChromeos(context);
 #else
     net::DhcpProxyScriptFetcherFactory dhcp_factory;
-    if (command_line.HasSwitch(switches::kDisableDhcpWpad))
-      dhcp_factory.set_enabled(false);
     dhcp_proxy_script_fetcher = dhcp_factory.Create(context);
 #endif
 
@@ -158,5 +154,7 @@ net::ProxyService* ProxyServiceFactory::CreateProxyService(
         net_log);
   }
 
+  proxy_service->set_quick_check_enabled(quick_check_enabled);
+
   return proxy_service;
 }