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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 base::Callback<void(int)> callback = | 143 base::Callback<void(int)> callback = |
144 base::Bind(&PepperNetworkProxyHost::OnResolveProxyCompleted, | 144 base::Bind(&PepperNetworkProxyHost::OnResolveProxyCompleted, |
145 weak_factory_.GetWeakPtr(), | 145 weak_factory_.GetWeakPtr(), |
146 request.reply_context, | 146 request.reply_context, |
147 base::Owned(proxy_info)); | 147 base::Owned(proxy_info)); |
148 int result = proxy_service_->ResolveProxy(request.url, | 148 int result = proxy_service_->ResolveProxy(request.url, |
149 net::LOAD_NORMAL, | 149 net::LOAD_NORMAL, |
150 proxy_info, | 150 proxy_info, |
151 callback, | 151 callback, |
152 &pending_request, | 152 &pending_request, |
153 NULL, | 153 nullptr, |
bengr
2016/02/16 20:00:13
Use NULL and std::string().
RyanSturm
2016/02/17 21:46:11
Done.
| |
154 "", | |
154 net::BoundNetLog()); | 155 net::BoundNetLog()); |
155 pending_requests_.push(pending_request); | 156 pending_requests_.push(pending_request); |
156 // If it was handled synchronously, we must run the callback now; | 157 // If it was handled synchronously, we must run the callback now; |
157 // proxy_service_ won't run it for us in this case. | 158 // proxy_service_ won't run it for us in this case. |
158 if (result != net::ERR_IO_PENDING) | 159 if (result != net::ERR_IO_PENDING) |
159 callback.Run(result); | 160 callback.Run(result); |
160 } | 161 } |
161 unsent_requests_.pop(); | 162 unsent_requests_.pop(); |
162 } | 163 } |
163 } | 164 } |
(...skipping 18 matching lines...) Expand all Loading... | |
182 | 183 |
183 void PepperNetworkProxyHost::SendFailureReply( | 184 void PepperNetworkProxyHost::SendFailureReply( |
184 int32_t error, | 185 int32_t error, |
185 ppapi::host::ReplyMessageContext context) { | 186 ppapi::host::ReplyMessageContext context) { |
186 context.params.set_result(error); | 187 context.params.set_result(error); |
187 host()->SendReply( | 188 host()->SendReply( |
188 context, PpapiPluginMsg_NetworkProxy_GetProxyForURLReply(std::string())); | 189 context, PpapiPluginMsg_NetworkProxy_GetProxyForURLReply(std::string())); |
189 } | 190 } |
190 | 191 |
191 } // namespace content | 192 } // namespace content |
OLD | NEW |