| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/net/proxy_service_factory.h" | 5 #include "chrome/browser/net/proxy_service_factory.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 bool wait_for_first_update) { | 31 bool wait_for_first_update) { |
| 32 // The linux gconf-based proxy settings getter relies on being initialized | 32 // The linux gconf-based proxy settings getter relies on being initialized |
| 33 // from the UI thread. | 33 // from the UI thread. |
| 34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 35 | 35 |
| 36 net::ProxyConfigService* base_service = NULL; | 36 net::ProxyConfigService* base_service = NULL; |
| 37 | 37 |
| 38 #if !defined(OS_CHROMEOS) | 38 #if !defined(OS_CHROMEOS) |
| 39 // On ChromeOS, base service is NULL; chromeos::ProxyConfigServiceImpl | 39 // On ChromeOS, base service is NULL; chromeos::ProxyConfigServiceImpl |
| 40 // determines the effective proxy config to take effect in the network layer, | 40 // determines the effective proxy config to take effect in the network layer, |
| 41 // be it from prefs or system (which is network flimflam on chromeos). | 41 // be it from prefs or system (which is network shill on chromeos). |
| 42 | 42 |
| 43 // For other platforms, create a baseline service that provides proxy | 43 // For other platforms, create a baseline service that provides proxy |
| 44 // configuration in case nothing is configured through prefs (Note: prefs | 44 // configuration in case nothing is configured through prefs (Note: prefs |
| 45 // include command line and configuration policy). | 45 // include command line and configuration policy). |
| 46 | 46 |
| 47 // TODO(port): the IO and FILE message loops are only used by Linux. Can | 47 // TODO(port): the IO and FILE message loops are only used by Linux. Can |
| 48 // that code be moved to chrome/browser instead of being in net, so that it | 48 // that code be moved to chrome/browser instead of being in net, so that it |
| 49 // can use BrowserThread instead of raw MessageLoop pointers? See bug 25354. | 49 // can use BrowserThread instead of raw MessageLoop pointers? See bug 25354. |
| 50 base_service = net::ProxyService::CreateSystemProxyConfigService( | 50 base_service = net::ProxyService::CreateSystemProxyConfigService( |
| 51 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 51 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 #endif // defined(OS_IOS) | 127 #endif // defined(OS_IOS) |
| 128 } else { | 128 } else { |
| 129 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( | 129 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( |
| 130 proxy_config_service, | 130 proxy_config_service, |
| 131 num_pac_threads, | 131 num_pac_threads, |
| 132 net_log); | 132 net_log); |
| 133 } | 133 } |
| 134 | 134 |
| 135 return proxy_service; | 135 return proxy_service; |
| 136 } | 136 } |
| OLD | NEW |