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