summaryrefslogtreecommitdiffstats
path: root/net/proxy/proxy_service.cc
diff options
context:
space:
mode:
authormdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-28 23:13:43 +0000
committermdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-28 23:13:43 +0000
commitd7395e73bc35be3247bdcf5c68fd2fff7497a78c (patch)
tree7bb0daf83b0675100a6b974e2342be68fdf1028e /net/proxy/proxy_service.cc
parentf9bcd26a1e7bbe4d4f4bbbc72ba40e59d3be1fbb (diff)
downloadchromium_src-d7395e73bc35be3247bdcf5c68fd2fff7497a78c.zip
chromium_src-d7395e73bc35be3247bdcf5c68fd2fff7497a78c.tar.gz
chromium_src-d7395e73bc35be3247bdcf5c68fd2fff7497a78c.tar.bz2
Linux: get GNOME or KDE proxy settings.
BUG=17363, 20407 TEST=none Review URL: http://codereview.chromium.org/174327 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_service.cc')
-rw-r--r--net/proxy/proxy_service.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index cc08e53..975b7df 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -217,11 +217,11 @@ ProxyService* ProxyService::Create(
const ProxyConfig* pc,
bool use_v8_resolver,
URLRequestContext* url_request_context,
- MessageLoop* io_loop) {
+ MessageLoop* io_loop, MessageLoop* file_loop) {
// Choose the system configuration service appropriate for each platform.
ProxyConfigService* proxy_config_service = pc ?
new ProxyConfigServiceFixed(*pc) :
- CreateSystemProxyConfigService(io_loop);
+ CreateSystemProxyConfigService(io_loop, file_loop);
ProxyResolver* proxy_resolver;
@@ -255,7 +255,7 @@ ProxyService* ProxyService::Create(
// static
ProxyService* ProxyService::CreateFixed(const ProxyConfig& pc) {
- return Create(&pc, false, NULL, NULL);
+ return Create(&pc, false, NULL, NULL, NULL);
}
// static
@@ -537,7 +537,7 @@ void ProxyService::DidCompletePacRequest(int config_id, int result_code) {
// static
ProxyConfigService* ProxyService::CreateSystemProxyConfigService(
- MessageLoop* io_loop) {
+ MessageLoop* io_loop, MessageLoop* file_loop) {
#if defined(OS_WIN)
return new ProxyConfigServiceWin();
#elif defined(OS_MACOSX)
@@ -551,11 +551,15 @@ ProxyConfigService* ProxyService::CreateSystemProxyConfigService(
// running gconf calls from.
MessageLoop* glib_default_loop = MessageLoopForUI::current();
+ // The file loop should be a MessageLoopForIO on Linux.
+ DCHECK_EQ(MessageLoop::TYPE_IO, file_loop->type());
+
// Synchronously fetch the current proxy config (since we are
- // running on glib_default_loop). Additionally register for gconf
- // notifications (delivered in |glib_default_loop|) to keep us
- // updated on when the proxy config has changed.
- linux_config_service->SetupAndFetchInitialConfig(glib_default_loop, io_loop);
+ // running on glib_default_loop). Additionally register for
+ // notifications (delivered in either |glib_default_loop| or
+ // |file_loop|) to keep us updated when the proxy config changes.
+ linux_config_service->SetupAndFetchInitialConfig(glib_default_loop, io_loop,
+ static_cast<MessageLoopForIO*>(file_loop));
return linux_config_service;
#else