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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 WebLocalFrame* frame = GetFrame(); | 250 WebLocalFrame* frame = GetFrame(); |
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); | |
261 web_request.setRequestContext(WebURLRequest::RequestContextPlugin); | 260 web_request.setRequestContext(WebURLRequest::RequestContextPlugin); |
262 web_request.setRequestorProcessID(renderer_ppapi_host_->GetPluginPID()); | 261 web_request.setRequestorProcessID(renderer_ppapi_host_->GetPluginPID()); |
263 | 262 |
264 WebURLLoaderOptions options; | 263 WebURLLoaderOptions options; |
265 if (has_universal_access_) { | 264 if (has_universal_access_) { |
266 options.allowCredentials = true; | 265 options.allowCredentials = true; |
267 options.crossOriginRequestPolicy = | 266 options.crossOriginRequestPolicy = |
268 WebURLLoaderOptions::CrossOriginRequestPolicyAllow; | 267 WebURLLoaderOptions::CrossOriginRequestPolicyAllow; |
269 } else { | 268 } else { |
270 // All other HTTP requests are untrusted. | 269 // All other HTTP requests are untrusted. |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 ppapi::proxy::ResourceMessageReplyParams params; | 428 ppapi::proxy::ResourceMessageReplyParams params; |
430 SendUpdateToPlugin(new PpapiPluginMsg_URLLoader_UpdateProgress( | 429 SendUpdateToPlugin(new PpapiPluginMsg_URLLoader_UpdateProgress( |
431 record_upload ? bytes_sent_ : -1, | 430 record_upload ? bytes_sent_ : -1, |
432 record_upload ? total_bytes_to_be_sent_ : -1, | 431 record_upload ? total_bytes_to_be_sent_ : -1, |
433 record_download ? bytes_received_ : -1, | 432 record_download ? bytes_received_ : -1, |
434 record_download ? total_bytes_to_be_received_ : -1)); | 433 record_download ? total_bytes_to_be_received_ : -1)); |
435 } | 434 } |
436 } | 435 } |
437 | 436 |
438 } // namespace content | 437 } // namespace content |
OLD | NEW |