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 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1355 ApplyProxyConfigIfAvailable(); | 1355 ApplyProxyConfigIfAvailable(); |
1356 } | 1356 } |
1357 | 1357 |
1358 void ProxyService::ForceReloadProxyConfig() { | 1358 void ProxyService::ForceReloadProxyConfig() { |
1359 DCHECK(CalledOnValidThread()); | 1359 DCHECK(CalledOnValidThread()); |
1360 ResetProxyConfig(false); | 1360 ResetProxyConfig(false); |
1361 ApplyProxyConfigIfAvailable(); | 1361 ApplyProxyConfigIfAvailable(); |
1362 } | 1362 } |
1363 | 1363 |
1364 // static | 1364 // static |
1365 ProxyConfigService* ProxyService::CreateSystemProxyConfigService( | 1365 ProxyConfigService* ProxyService::CreateSystemProxyConfigService( |
darin (slow to review)
2014/04/14 05:03:29
Perhaps a better approach here would be to have a
| |
1366 base::SingleThreadTaskRunner* io_thread_task_runner, | 1366 base::SingleThreadTaskRunner* io_thread_task_runner, |
1367 base::MessageLoop* file_loop) { | 1367 base::MessageLoop* file_loop) { |
1368 #if defined(OS_WIN) | 1368 #if defined(OS_WIN) |
1369 return new ProxyConfigServiceWin(); | 1369 return new ProxyConfigServiceWin(); |
1370 #elif defined(OS_IOS) | 1370 #elif defined(OS_IOS) |
1371 return new ProxyConfigServiceIOS(); | 1371 return new ProxyConfigServiceIOS(); |
1372 #elif defined(OS_MACOSX) | 1372 #elif defined(OS_MACOSX) |
1373 return new ProxyConfigServiceMac(io_thread_task_runner); | 1373 return new ProxyConfigServiceMac(io_thread_task_runner); |
1374 #elif defined(OS_CHROMEOS) | 1374 #elif defined(OS_CHROMEOS) |
1375 LOG(ERROR) << "ProxyConfigService for ChromeOS should be created in " | 1375 LOG(ERROR) << "ProxyConfigService for ChromeOS should be created in " |
1376 << "profile_io_data.cc::CreateProxyConfigService and this should " | 1376 << "profile_io_data.cc::CreateProxyConfigService and this should " |
1377 << "be used only for examples."; | 1377 << "be used only for examples."; |
1378 return new UnsetProxyConfigService; | 1378 return new UnsetProxyConfigService; |
1379 #elif defined(CHROMECAST_BUILD) | |
1380 return new ProxyConfigServiceDirect(); | |
1379 #elif defined(OS_LINUX) | 1381 #elif defined(OS_LINUX) |
1380 ProxyConfigServiceLinux* linux_config_service = | 1382 ProxyConfigServiceLinux* linux_config_service = |
1381 new ProxyConfigServiceLinux(); | 1383 new ProxyConfigServiceLinux(); |
1382 | 1384 |
1383 // Assume we got called on the thread that runs the default glib | 1385 // Assume we got called on the thread that runs the default glib |
1384 // main loop, so the current thread is where we should be running | 1386 // main loop, so the current thread is where we should be running |
1385 // gconf calls from. | 1387 // gconf calls from. |
1386 scoped_refptr<base::SingleThreadTaskRunner> glib_thread_task_runner = | 1388 scoped_refptr<base::SingleThreadTaskRunner> glib_thread_task_runner = |
1387 base::ThreadTaskRunnerHandle::Get(); | 1389 base::ThreadTaskRunnerHandle::Get(); |
1388 | 1390 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1616 OnCompletion(result_); | 1618 OnCompletion(result_); |
1617 } | 1619 } |
1618 } | 1620 } |
1619 | 1621 |
1620 void SyncProxyServiceHelper::OnCompletion(int rv) { | 1622 void SyncProxyServiceHelper::OnCompletion(int rv) { |
1621 result_ = rv; | 1623 result_ = rv; |
1622 event_.Signal(); | 1624 event_.Signal(); |
1623 } | 1625 } |
1624 | 1626 |
1625 } // namespace net | 1627 } // namespace net |
OLD | NEW |