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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } else { | 142 } else { |
143 // Everything looks valid, so try to resolve the proxy. | 143 // Everything looks valid, so try to resolve the proxy. |
144 net::ProxyInfo* proxy_info = new net::ProxyInfo; | 144 net::ProxyInfo* proxy_info = new net::ProxyInfo; |
145 net::ProxyService::PacRequest* pending_request = NULL; | 145 net::ProxyService::PacRequest* pending_request = NULL; |
146 base::Callback<void(int)> callback = | 146 base::Callback<void(int)> callback = |
147 base::Bind(&PepperNetworkProxyHost::OnResolveProxyCompleted, | 147 base::Bind(&PepperNetworkProxyHost::OnResolveProxyCompleted, |
148 weak_factory_.GetWeakPtr(), | 148 weak_factory_.GetWeakPtr(), |
149 request.reply_context, | 149 request.reply_context, |
150 base::Owned(proxy_info)); | 150 base::Owned(proxy_info)); |
151 int result = proxy_service_->ResolveProxy(request.url, | 151 int result = proxy_service_->ResolveProxy(request.url, |
| 152 std::string(), |
152 net::LOAD_NORMAL, | 153 net::LOAD_NORMAL, |
153 proxy_info, | 154 proxy_info, |
154 callback, | 155 callback, |
155 &pending_request, | 156 &pending_request, |
156 NULL, | 157 NULL, |
157 net::BoundNetLog()); | 158 net::BoundNetLog()); |
158 pending_requests_.push(pending_request); | 159 pending_requests_.push(pending_request); |
159 // If it was handled synchronously, we must run the callback now; | 160 // If it was handled synchronously, we must run the callback now; |
160 // proxy_service_ won't run it for us in this case. | 161 // proxy_service_ won't run it for us in this case. |
161 if (result != net::ERR_IO_PENDING) | 162 if (result != net::ERR_IO_PENDING) |
(...skipping 23 matching lines...) Expand all Loading... |
185 | 186 |
186 void PepperNetworkProxyHost::SendFailureReply( | 187 void PepperNetworkProxyHost::SendFailureReply( |
187 int32_t error, | 188 int32_t error, |
188 ppapi::host::ReplyMessageContext context) { | 189 ppapi::host::ReplyMessageContext context) { |
189 context.params.set_result(error); | 190 context.params.set_result(error); |
190 host()->SendReply( | 191 host()->SendReply( |
191 context, PpapiPluginMsg_NetworkProxy_GetProxyForURLReply(std::string())); | 192 context, PpapiPluginMsg_NetworkProxy_GetProxyForURLReply(std::string())); |
192 } | 193 } |
193 | 194 |
194 } // namespace content | 195 } // namespace content |
OLD | NEW |