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/renderer/pepper/pepper_url_loader_host.h" | 5 #include "content/renderer/pepper/pepper_url_loader_host.h" |
6 | 6 |
7 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 7 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
8 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 8 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
9 #include "content/renderer/pepper/url_request_info_util.h" | 9 #include "content/renderer/pepper/url_request_info_util.h" |
10 #include "content/renderer/pepper/url_response_info_util.h" | 10 #include "content/renderer/pepper/url_response_info_util.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 if (!frame) | 251 if (!frame) |
252 return PP_ERROR_FAILED; | 252 return PP_ERROR_FAILED; |
253 | 253 |
254 WebURLRequest web_request; | 254 WebURLRequest web_request; |
255 if (!CreateWebURLRequest( | 255 if (!CreateWebURLRequest( |
256 pp_instance(), &filled_in_request_data, frame, &web_request)) { | 256 pp_instance(), &filled_in_request_data, frame, &web_request)) { |
257 return PP_ERROR_FAILED; | 257 return PP_ERROR_FAILED; |
258 } | 258 } |
259 | 259 |
260 web_request.setTargetType(WebURLRequest::TargetIsObject); | 260 web_request.setTargetType(WebURLRequest::TargetIsObject); |
| 261 web_request.setRequestContext(WebURLRequest::RequestContextPlugin); |
261 web_request.setRequestorProcessID(renderer_ppapi_host_->GetPluginPID()); | 262 web_request.setRequestorProcessID(renderer_ppapi_host_->GetPluginPID()); |
262 | 263 |
263 WebURLLoaderOptions options; | 264 WebURLLoaderOptions options; |
264 if (has_universal_access_) { | 265 if (has_universal_access_) { |
265 options.allowCredentials = true; | 266 options.allowCredentials = true; |
266 options.crossOriginRequestPolicy = | 267 options.crossOriginRequestPolicy = |
267 WebURLLoaderOptions::CrossOriginRequestPolicyAllow; | 268 WebURLLoaderOptions::CrossOriginRequestPolicyAllow; |
268 } else { | 269 } else { |
269 // All other HTTP requests are untrusted. | 270 // All other HTTP requests are untrusted. |
270 options.untrustedHTTP = true; | 271 options.untrustedHTTP = true; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 ppapi::proxy::ResourceMessageReplyParams params; | 429 ppapi::proxy::ResourceMessageReplyParams params; |
429 SendUpdateToPlugin(new PpapiPluginMsg_URLLoader_UpdateProgress( | 430 SendUpdateToPlugin(new PpapiPluginMsg_URLLoader_UpdateProgress( |
430 record_upload ? bytes_sent_ : -1, | 431 record_upload ? bytes_sent_ : -1, |
431 record_upload ? total_bytes_to_be_sent_ : -1, | 432 record_upload ? total_bytes_to_be_sent_ : -1, |
432 record_download ? bytes_received_ : -1, | 433 record_download ? bytes_received_ : -1, |
433 record_download ? total_bytes_to_be_received_ : -1)); | 434 record_download ? total_bytes_to_be_received_ : -1)); |
434 } | 435 } |
435 } | 436 } |
436 | 437 |
437 } // namespace content | 438 } // namespace content |
OLD | NEW |