| 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 "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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "net/url_request/url_request_context.h" | 33 #include "net/url_request/url_request_context.h" |
| 34 | 34 |
| 35 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
| 36 #include "net/proxy/proxy_config_service_win.h" | 36 #include "net/proxy/proxy_config_service_win.h" |
| 37 #include "net/proxy/proxy_resolver_winhttp.h" | 37 #include "net/proxy/proxy_resolver_winhttp.h" |
| 38 #elif defined(OS_MACOSX) | 38 #elif defined(OS_MACOSX) |
| 39 #include "net/proxy/proxy_config_service_mac.h" | 39 #include "net/proxy/proxy_config_service_mac.h" |
| 40 #include "net/proxy/proxy_resolver_mac.h" | 40 #include "net/proxy/proxy_resolver_mac.h" |
| 41 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) | 41 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 42 #include "net/proxy/proxy_config_service_linux.h" | 42 #include "net/proxy/proxy_config_service_linux.h" |
| 43 #elif defined(OS_ANDROID) |
| 44 #include "net/proxy/proxy_config_service_android.h" |
| 43 #endif | 45 #endif |
| 44 | 46 |
| 45 using base::TimeDelta; | 47 using base::TimeDelta; |
| 46 using base::TimeTicks; | 48 using base::TimeTicks; |
| 47 | 49 |
| 48 namespace net { | 50 namespace net { |
| 49 | 51 |
| 50 namespace { | 52 namespace { |
| 51 | 53 |
| 52 const size_t kMaxNumNetLogEntries = 100; | 54 const size_t kMaxNumNetLogEntries = 100; |
| (...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1444 // Synchronously fetch the current proxy config (since we are | 1446 // Synchronously fetch the current proxy config (since we are |
| 1445 // running on glib_default_loop). Additionally register for | 1447 // running on glib_default_loop). Additionally register for |
| 1446 // notifications (delivered in either |glib_default_loop| or | 1448 // notifications (delivered in either |glib_default_loop| or |
| 1447 // |file_loop|) to keep us updated when the proxy config changes. | 1449 // |file_loop|) to keep us updated when the proxy config changes. |
| 1448 linux_config_service->SetupAndFetchInitialConfig( | 1450 linux_config_service->SetupAndFetchInitialConfig( |
| 1449 glib_default_loop->message_loop_proxy(), | 1451 glib_default_loop->message_loop_proxy(), |
| 1450 io_loop->message_loop_proxy(), | 1452 io_loop->message_loop_proxy(), |
| 1451 static_cast<MessageLoopForIO*>(file_loop)); | 1453 static_cast<MessageLoopForIO*>(file_loop)); |
| 1452 | 1454 |
| 1453 return linux_config_service; | 1455 return linux_config_service; |
| 1456 #elif defined(OS_ANDROID) |
| 1457 return new ProxyConfigServiceAndroid(io_loop->message_loop_proxy()); |
| 1454 #else | 1458 #else |
| 1455 LOG(WARNING) << "Failed to choose a system proxy settings fetcher " | 1459 LOG(WARNING) << "Failed to choose a system proxy settings fetcher " |
| 1456 "for this platform."; | 1460 "for this platform."; |
| 1457 return new ProxyConfigServiceDirect(); | 1461 return new ProxyConfigServiceDirect(); |
| 1458 #endif | 1462 #endif |
| 1459 } | 1463 } |
| 1460 | 1464 |
| 1461 // static | 1465 // static |
| 1462 const ProxyService::PacPollPolicy* ProxyService::set_pac_script_poll_policy( | 1466 const ProxyService::PacPollPolicy* ProxyService::set_pac_script_poll_policy( |
| 1463 const PacPollPolicy* policy) { | 1467 const PacPollPolicy* policy) { |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1640 OnCompletion(result_); | 1644 OnCompletion(result_); |
| 1641 } | 1645 } |
| 1642 } | 1646 } |
| 1643 | 1647 |
| 1644 void SyncProxyServiceHelper::OnCompletion(int rv) { | 1648 void SyncProxyServiceHelper::OnCompletion(int rv) { |
| 1645 result_ = rv; | 1649 result_ = rv; |
| 1646 event_.Signal(); | 1650 event_.Signal(); |
| 1647 } | 1651 } |
| 1648 | 1652 |
| 1649 } // namespace net | 1653 } // namespace net |
| OLD | NEW |