Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: net/proxy/proxy_service.cc

Issue 10206014: Upstream Android proxy config service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make Java methods non-synchronized Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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(
1458 io_loop->message_loop_proxy(),
1459 MessageLoopForUI::current()->message_loop_proxy());
1454 #else 1460 #else
1455 LOG(WARNING) << "Failed to choose a system proxy settings fetcher " 1461 LOG(WARNING) << "Failed to choose a system proxy settings fetcher "
1456 "for this platform."; 1462 "for this platform.";
1457 return new ProxyConfigServiceDirect(); 1463 return new ProxyConfigServiceDirect();
1458 #endif 1464 #endif
1459 } 1465 }
1460 1466
1461 // static 1467 // static
1462 const ProxyService::PacPollPolicy* ProxyService::set_pac_script_poll_policy( 1468 const ProxyService::PacPollPolicy* ProxyService::set_pac_script_poll_policy(
1463 const PacPollPolicy* policy) { 1469 const PacPollPolicy* policy) {
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 OnCompletion(result_); 1646 OnCompletion(result_);
1641 } 1647 }
1642 } 1648 }
1643 1649
1644 void SyncProxyServiceHelper::OnCompletion(int rv) { 1650 void SyncProxyServiceHelper::OnCompletion(int rv) {
1645 result_ = rv; 1651 result_ = rv;
1646 event_.Signal(); 1652 event_.Signal();
1647 } 1653 }
1648 1654
1649 } // namespace net 1655 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698