OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/ppb_url_request_info_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_url_request_info_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 #include "googleurl/src/url_util.h" | 10 #include "googleurl/src/url_util.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 bool PPB_URLRequestInfo_Impl::ToWebURLRequest(WebFrame* frame, | 123 bool PPB_URLRequestInfo_Impl::ToWebURLRequest(WebFrame* frame, |
124 WebURLRequest* dest) { | 124 WebURLRequest* dest) { |
125 // In the out-of-process case, we've received the PPB_URLRequestInfo_Data | 125 // In the out-of-process case, we've received the PPB_URLRequestInfo_Data |
126 // from the untrusted plugin and done no validation on it. We need to be | 126 // from the untrusted plugin and done no validation on it. We need to be |
127 // sure it's not being malicious by checking everything for consistency. | 127 // sure it's not being malicious by checking everything for consistency. |
128 if (!ValidateData()) | 128 if (!ValidateData()) |
129 return false; | 129 return false; |
130 | 130 |
131 dest->initialize(); | 131 dest->initialize(); |
132 dest->setURL(frame->document().completeURL(WebString::fromUTF8( | 132 dest->setURL(frame->document().completeURL(WebString::fromUTF8(data().url))); |
133 data().url))); | |
134 dest->setDownloadToFile(data().stream_to_file); | 133 dest->setDownloadToFile(data().stream_to_file); |
135 dest->setReportUploadProgress(data().record_upload_progress); | 134 dest->setReportUploadProgress(data().record_upload_progress); |
136 | 135 |
137 if (!data().method.empty()) | 136 if (!data().method.empty()) |
138 dest->setHTTPMethod(WebString::fromUTF8(data().method)); | 137 dest->setHTTPMethod(WebString::fromUTF8(data().method)); |
139 | 138 |
140 dest->setFirstPartyForCookies(frame->document().firstPartyForCookies()); | 139 dest->setFirstPartyForCookies(frame->document().firstPartyForCookies()); |
141 | 140 |
142 const std::string& headers = data().headers; | 141 const std::string& headers = data().headers; |
143 if (!headers.empty()) { | 142 if (!headers.empty()) { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 webkit_glue::FilePathToWebString(platform_path), | 261 webkit_glue::FilePathToWebString(platform_path), |
263 start_offset, | 262 start_offset, |
264 number_of_bytes, | 263 number_of_bytes, |
265 expected_last_modified_time); | 264 expected_last_modified_time); |
266 return true; | 265 return true; |
267 } | 266 } |
268 | 267 |
269 | 268 |
270 } // namespace ppapi | 269 } // namespace ppapi |
271 } // namespace webkit | 270 } // namespace webkit |
OLD | NEW |