Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(967)

Unified Diff: chrome/browser/net/chrome_url_request_context.cc

Issue 6292017: Extended: Add "system" URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698