OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/renderer_host/pepper/pepper_network_proxy_host.h" | 5 #include "content/browser/renderer_host/pepper/pepper_network_proxy_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" | 8 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" |
9 #include "content/browser/renderer_host/pepper/pepper_socket_utils.h" | 9 #include "content/browser/renderer_host/pepper/pepper_socket_utils.h" |
10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } else { | 138 } else { |
139 // Everything looks valid, so try to resolve the proxy. | 139 // Everything looks valid, so try to resolve the proxy. |
140 net::ProxyInfo* proxy_info = new net::ProxyInfo; | 140 net::ProxyInfo* proxy_info = new net::ProxyInfo; |
141 net::ProxyService::PacRequest* pending_request = NULL; | 141 net::ProxyService::PacRequest* pending_request = NULL; |
142 base::Callback<void(int)> callback = | 142 base::Callback<void(int)> callback = |
143 base::Bind(&PepperNetworkProxyHost::OnResolveProxyCompleted, | 143 base::Bind(&PepperNetworkProxyHost::OnResolveProxyCompleted, |
144 weak_factory_.GetWeakPtr(), | 144 weak_factory_.GetWeakPtr(), |
145 request.reply_context, | 145 request.reply_context, |
146 base::Owned(proxy_info)); | 146 base::Owned(proxy_info)); |
147 int result = proxy_service_->ResolveProxy(request.url, | 147 int result = proxy_service_->ResolveProxy(request.url, |
| 148 0, |
148 proxy_info, | 149 proxy_info, |
149 callback, | 150 callback, |
150 &pending_request, | 151 &pending_request, |
151 net::BoundNetLog()); | 152 net::BoundNetLog()); |
152 pending_requests_.push(pending_request); | 153 pending_requests_.push(pending_request); |
153 // If it was handled synchronously, we must run the callback now; | 154 // If it was handled synchronously, we must run the callback now; |
154 // proxy_service_ won't run it for us in this case. | 155 // proxy_service_ won't run it for us in this case. |
155 if (result != net::ERR_IO_PENDING) | 156 if (result != net::ERR_IO_PENDING) |
156 callback.Run(result); | 157 callback.Run(result); |
157 } | 158 } |
(...skipping 21 matching lines...) Expand all Loading... |
179 | 180 |
180 void PepperNetworkProxyHost::SendFailureReply( | 181 void PepperNetworkProxyHost::SendFailureReply( |
181 int32_t error, | 182 int32_t error, |
182 ppapi::host::ReplyMessageContext context) { | 183 ppapi::host::ReplyMessageContext context) { |
183 context.params.set_result(error); | 184 context.params.set_result(error); |
184 host()->SendReply( | 185 host()->SendReply( |
185 context, PpapiPluginMsg_NetworkProxy_GetProxyForURLReply(std::string())); | 186 context, PpapiPluginMsg_NetworkProxy_GetProxyForURLReply(std::string())); |
186 } | 187 } |
187 | 188 |
188 } // namespace content | 189 } // namespace content |
OLD | NEW |