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 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1417 // running gconf calls from. | 1417 // running gconf calls from. |
1418 MessageLoop* glib_default_loop = MessageLoopForUI::current(); | 1418 MessageLoop* glib_default_loop = MessageLoopForUI::current(); |
1419 | 1419 |
1420 // The file loop should be a MessageLoopForIO on Linux. | 1420 // The file loop should be a MessageLoopForIO on Linux. |
1421 DCHECK_EQ(MessageLoop::TYPE_IO, file_loop->type()); | 1421 DCHECK_EQ(MessageLoop::TYPE_IO, file_loop->type()); |
1422 | 1422 |
1423 // Synchronously fetch the current proxy config (since we are | 1423 // Synchronously fetch the current proxy config (since we are |
1424 // running on glib_default_loop). Additionally register for | 1424 // running on glib_default_loop). Additionally register for |
1425 // notifications (delivered in either |glib_default_loop| or | 1425 // notifications (delivered in either |glib_default_loop| or |
1426 // |file_loop|) to keep us updated when the proxy config changes. | 1426 // |file_loop|) to keep us updated when the proxy config changes. |
1427 linux_config_service->SetupAndFetchInitialConfig(glib_default_loop, io_loop, | 1427 linux_config_service->SetupAndFetchInitialConfig( |
| 1428 glib_default_loop->message_loop_proxy(), |
| 1429 io_loop->message_loop_proxy(), |
1428 static_cast<MessageLoopForIO*>(file_loop)); | 1430 static_cast<MessageLoopForIO*>(file_loop)); |
1429 | 1431 |
1430 return linux_config_service; | 1432 return linux_config_service; |
1431 #else | 1433 #else |
1432 LOG(WARNING) << "Failed to choose a system proxy settings fetcher " | 1434 LOG(WARNING) << "Failed to choose a system proxy settings fetcher " |
1433 "for this platform."; | 1435 "for this platform."; |
1434 return new ProxyConfigServiceDirect(); | 1436 return new ProxyConfigServiceDirect(); |
1435 #endif | 1437 #endif |
1436 } | 1438 } |
1437 | 1439 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1617 OnCompletion(result_); | 1619 OnCompletion(result_); |
1618 } | 1620 } |
1619 } | 1621 } |
1620 | 1622 |
1621 void SyncProxyServiceHelper::OnCompletion(int rv) { | 1623 void SyncProxyServiceHelper::OnCompletion(int rv) { |
1622 result_ = rv; | 1624 result_ = rv; |
1623 event_.Signal(); | 1625 event_.Signal(); |
1624 } | 1626 } |
1625 | 1627 |
1626 } // namespace net | 1628 } // namespace net |
OLD | NEW |