Index: chrome/browser/net/chrome_url_request_context.cc |
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc |
index 573ffdc65856223aa68bc5de4d6cd83edda5b824..87a9881641ef5cc85e17daafa18fbe0081d2bd9f 100644 |
--- a/chrome/browser/net/chrome_url_request_context.cc |
+++ b/chrome/browser/net/chrome_url_request_context.cc |
@@ -21,6 +21,7 @@ |
#include "chrome/browser/net/sqlite_persistent_cookie_store.h" |
#include "chrome/browser/net/predictor_api.h" |
#include "chrome/browser/net/pref_proxy_config_service.h" |
+#include "chrome/browser/net/proxy_service_factory.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/profiles/profile_io_data.h" |
#include "chrome/common/chrome_constants.h" |
@@ -69,29 +70,10 @@ void CheckCurrentlyOnMainThread() { |
// ---------------------------------------------------------------------------- |
net::ProxyConfigService* CreateProxyConfigService(Profile* profile) { |
- // The linux gconf-based proxy settings getter relies on being initialized |
- // from the UI thread. |
- CheckCurrentlyOnMainThread(); |
- |
- // Create a baseline service that provides proxy configuration in case nothing |
- // is configured through prefs (Note: prefs include command line and |
- // configuration policy). |
- net::ProxyConfigService* base_service = NULL; |
- |
- // TODO(port): the IO and FILE message loops are only used by Linux. Can |
- // 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. |
-#if defined(OS_CHROMEOS) |
- base_service = new chromeos::ProxyConfigService( |
- profile->GetChromeOSProxyConfigServiceImpl()); |
-#else |
- base_service = net::ProxyService::CreateSystemProxyConfigService( |
+ return ProxyServiceFactory::CreateProxyConfigService( |
g_browser_process->io_thread()->message_loop(), |
- g_browser_process->file_thread()->message_loop()); |
-#endif // defined(OS_CHROMEOS) |
- |
- return new PrefProxyConfigService(profile->GetProxyConfigTracker(), |
- base_service); |
+ g_browser_process->file_thread()->message_loop(), |
+ profile->GetProxyConfigTracker()); |
} |
// Create a proxy service according to the options on command line. |
@@ -275,10 +257,11 @@ scoped_refptr<ChromeURLRequestContext> FactoryForOriginal::Create() { |
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
context->set_proxy_service( |
- CreateProxyService(io_thread()->net_log(), |
- io_thread_globals->proxy_script_fetcher_context.get(), |
- proxy_config_service_.release(), |
- command_line)); |
+ ProxyServiceFactory::CreateProxyService( |
+ io_thread()->net_log(), |
+ io_thread_globals->proxy_script_fetcher_context.get(), |
+ proxy_config_service_.release(), |
+ command_line)); |
net::HttpCache::DefaultBackend* backend = new net::HttpCache::DefaultBackend( |
net::DISK_CACHE, params.cache_path, params.cache_max_size, |
@@ -414,10 +397,11 @@ scoped_refptr<ChromeURLRequestContext> FactoryForOffTheRecord::Create() { |
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
context->set_proxy_service( |
- CreateProxyService(io_thread()->net_log(), |
- io_thread_globals->proxy_script_fetcher_context.get(), |
- proxy_config_service_.release(), |
- command_line)); |
+ ProxyServiceFactory::CreateProxyService( |
+ io_thread()->net_log(), |
+ io_thread_globals->proxy_script_fetcher_context.get(), |
+ proxy_config_service_.release(), |
+ command_line)); |
net::HttpCache::BackendFactory* backend = |
net::HttpCache::DefaultBackend::InMemory(0); |