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(data().url))); | 132 dest->setURL(frame->document().completeURL(WebString::fromUTF8( |
| 133 data().url))); |
133 dest->setDownloadToFile(data().stream_to_file); | 134 dest->setDownloadToFile(data().stream_to_file); |
134 dest->setReportUploadProgress(data().record_upload_progress); | 135 dest->setReportUploadProgress(data().record_upload_progress); |
135 | 136 |
136 if (!data().method.empty()) | 137 if (!data().method.empty()) |
137 dest->setHTTPMethod(WebString::fromUTF8(data().method)); | 138 dest->setHTTPMethod(WebString::fromUTF8(data().method)); |
138 | 139 |
139 dest->setFirstPartyForCookies(frame->document().firstPartyForCookies()); | 140 dest->setFirstPartyForCookies(frame->document().firstPartyForCookies()); |
140 | 141 |
141 const std::string& headers = data().headers; | 142 const std::string& headers = data().headers; |
142 if (!headers.empty()) { | 143 if (!headers.empty()) { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 webkit_glue::FilePathToWebString(platform_path), | 262 webkit_glue::FilePathToWebString(platform_path), |
262 start_offset, | 263 start_offset, |
263 number_of_bytes, | 264 number_of_bytes, |
264 expected_last_modified_time); | 265 expected_last_modified_time); |
265 return true; | 266 return true; |
266 } | 267 } |
267 | 268 |
268 | 269 |
269 } // namespace ppapi | 270 } // namespace ppapi |
270 } // namespace webkit | 271 } // namespace webkit |
OLD | NEW |