| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "net/proxy/proxy_service.h" | 5 #include "net/proxy/proxy_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "base/histogram.h" | 12 #include "base/histogram.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 16 #include "net/base/forwarding_net_log.h" | 16 #include "net/base/forwarding_net_log.h" |
| 17 #include "net/base/net_log.h" | 17 #include "net/base/net_log.h" |
| 18 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
| 19 #include "net/base/net_util.h" | 19 #include "net/base/net_util.h" |
| 20 #include "net/proxy/init_proxy_resolver.h" | 20 #include "net/proxy/init_proxy_resolver.h" |
| 21 #include "net/proxy/multi_threaded_proxy_resolver.h" | 21 #include "net/proxy/multi_threaded_proxy_resolver.h" |
| 22 #include "net/proxy/proxy_config_service_fixed.h" | 22 #include "net/proxy/proxy_config_service_fixed.h" |
| 23 #include "net/proxy/proxy_script_fetcher.h" | 23 #include "net/proxy/proxy_script_fetcher.h" |
| 24 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
| 25 #include "net/proxy/proxy_config_service_win.h" | 25 #include "net/proxy/proxy_config_service_win.h" |
| 26 #include "net/proxy/proxy_resolver_winhttp.h" | 26 #include "net/proxy/proxy_resolver_winhttp.h" |
| 27 #elif defined(OS_MACOSX) | 27 #elif defined(OS_MACOSX) |
| 28 #include "net/proxy/proxy_config_service_mac.h" | 28 #include "net/proxy/proxy_config_service_mac.h" |
| 29 #include "net/proxy/proxy_resolver_mac.h" | 29 #include "net/proxy/proxy_resolver_mac.h" |
| 30 #elif defined(OS_LINUX) | 30 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 31 #include "net/proxy/proxy_config_service_linux.h" | 31 #include "net/proxy/proxy_config_service_linux.h" |
| 32 #endif | 32 #endif |
| 33 #include "net/proxy/proxy_resolver.h" | 33 #include "net/proxy/proxy_resolver.h" |
| 34 #include "net/proxy/proxy_resolver_js_bindings.h" | 34 #include "net/proxy/proxy_resolver_js_bindings.h" |
| 35 #include "net/proxy/proxy_resolver_v8.h" | 35 #include "net/proxy/proxy_resolver_v8.h" |
| 36 #include "net/proxy/sync_host_resolver_bridge.h" | 36 #include "net/proxy/sync_host_resolver_bridge.h" |
| 37 #include "net/url_request/url_request_context.h" | 37 #include "net/url_request/url_request_context.h" |
| 38 | 38 |
| 39 using base::TimeDelta; | 39 using base::TimeDelta; |
| 40 using base::TimeTicks; | 40 using base::TimeTicks; |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 ApplyProxyConfigIfAvailable(); | 638 ApplyProxyConfigIfAvailable(); |
| 639 } | 639 } |
| 640 | 640 |
| 641 // static | 641 // static |
| 642 ProxyConfigService* ProxyService::CreateSystemProxyConfigService( | 642 ProxyConfigService* ProxyService::CreateSystemProxyConfigService( |
| 643 MessageLoop* io_loop, MessageLoop* file_loop) { | 643 MessageLoop* io_loop, MessageLoop* file_loop) { |
| 644 #if defined(OS_WIN) | 644 #if defined(OS_WIN) |
| 645 return new ProxyConfigServiceWin(); | 645 return new ProxyConfigServiceWin(); |
| 646 #elif defined(OS_MACOSX) | 646 #elif defined(OS_MACOSX) |
| 647 return new ProxyConfigServiceMac(io_loop); | 647 return new ProxyConfigServiceMac(io_loop); |
| 648 #elif defined(OS_CHROMEOS) |
| 649 NOTREACHED() << "ProxyConfigService for ChromeOS should be created in " |
| 650 << "chrome_url_request_context.cc::CreateProxyConfigService."; |
| 651 return NULL; |
| 648 #elif defined(OS_LINUX) | 652 #elif defined(OS_LINUX) |
| 649 ProxyConfigServiceLinux* linux_config_service | 653 ProxyConfigServiceLinux* linux_config_service |
| 650 = new ProxyConfigServiceLinux(); | 654 = new ProxyConfigServiceLinux(); |
| 651 | 655 |
| 652 // Assume we got called from the UI loop, which runs the default | 656 // Assume we got called from the UI loop, which runs the default |
| 653 // glib main loop, so the current thread is where we should be | 657 // glib main loop, so the current thread is where we should be |
| 654 // running gconf calls from. | 658 // running gconf calls from. |
| 655 MessageLoop* glib_default_loop = MessageLoopForUI::current(); | 659 MessageLoop* glib_default_loop = MessageLoopForUI::current(); |
| 656 | 660 |
| 657 // The file loop should be a MessageLoopForIO on Linux. | 661 // The file loop should be a MessageLoopForIO on Linux. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 OnCompletion(result_); | 778 OnCompletion(result_); |
| 775 } | 779 } |
| 776 } | 780 } |
| 777 | 781 |
| 778 void SyncProxyServiceHelper::OnCompletion(int rv) { | 782 void SyncProxyServiceHelper::OnCompletion(int rv) { |
| 779 result_ = rv; | 783 result_ = rv; |
| 780 event_.Signal(); | 784 event_.Signal(); |
| 781 } | 785 } |
| 782 | 786 |
| 783 } // namespace net | 787 } // namespace net |
| OLD | NEW |