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 "chromeos/dbus/services/proxy_resolution_service_provider.h" | 5 #include "chromeos/dbus/services/proxy_resolution_service_provider.h" |
6 | 6 |
| 7 #include <string> |
7 #include <utility> | 8 #include <utility> |
8 | 9 |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
13 #include "dbus/bus.h" | 14 #include "dbus/bus.h" |
14 #include "dbus/message.h" | 15 #include "dbus/message.h" |
15 #include "net/base/load_flags.h" | 16 #include "net/base/load_flags.h" |
16 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 return; | 127 return; |
127 } | 128 } |
128 | 129 |
129 VLOG(1) << "Starting network proxy resolution for " | 130 VLOG(1) << "Starting network proxy resolution for " |
130 << request->source_url_; | 131 << request->source_url_; |
131 net::CompletionCallback completion_callback = | 132 net::CompletionCallback completion_callback = |
132 base::Bind(&Request::OnCompletion, | 133 base::Bind(&Request::OnCompletion, |
133 base::Unretained(request), | 134 base::Unretained(request), |
134 origin_thread); | 135 origin_thread); |
135 const int result = proxy_service->ResolveProxy( | 136 const int result = proxy_service->ResolveProxy( |
136 GURL(request->source_url_), net::LOAD_NORMAL, &request->proxy_info_, | 137 GURL(request->source_url_), std::string(), net::LOAD_NORMAL, |
137 completion_callback, NULL, NULL, net::BoundNetLog()); | 138 &request->proxy_info_, completion_callback, NULL, NULL, |
| 139 net::BoundNetLog()); |
138 if (result != net::ERR_IO_PENDING) { | 140 if (result != net::ERR_IO_PENDING) { |
139 VLOG(1) << "Network proxy resolution completed synchronously."; | 141 VLOG(1) << "Network proxy resolution completed synchronously."; |
140 completion_callback.Run(result); | 142 completion_callback.Run(result); |
141 } | 143 } |
142 } | 144 } |
143 | 145 |
144 // Called on UI thread as task posted from Request::OnCompletion on IO | 146 // Called on UI thread as task posted from Request::OnCompletion on IO |
145 // thread. | 147 // thread. |
146 void NotifyProxyResolved( | 148 void NotifyProxyResolved( |
147 const std::string& signal_interface, | 149 const std::string& signal_interface, |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 ProxyResolutionServiceProvider* ProxyResolutionServiceProvider::Create( | 270 ProxyResolutionServiceProvider* ProxyResolutionServiceProvider::Create( |
269 scoped_ptr<ProxyResolverDelegate> delegate) { | 271 scoped_ptr<ProxyResolverDelegate> delegate) { |
270 return new ProxyResolutionServiceProvider( | 272 return new ProxyResolutionServiceProvider( |
271 new ProxyResolverImpl(std::move(delegate))); | 273 new ProxyResolverImpl(std::move(delegate))); |
272 } | 274 } |
273 | 275 |
274 ProxyResolverInterface::~ProxyResolverInterface() { | 276 ProxyResolverInterface::~ProxyResolverInterface() { |
275 } | 277 } |
276 | 278 |
277 } // namespace chromeos | 279 } // namespace chromeos |
OLD | NEW |