| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "net/http/http_util.h" | 10 #include "net/http/http_util.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 number_of_bytes, | 271 number_of_bytes, |
| 272 expected_last_modified_time)); | 272 expected_last_modified_time)); |
| 273 return true; | 273 return true; |
| 274 } | 274 } |
| 275 | 275 |
| 276 WebURLRequest PPB_URLRequestInfo_Impl::ToWebURLRequest(WebFrame* frame) const { | 276 WebURLRequest PPB_URLRequestInfo_Impl::ToWebURLRequest(WebFrame* frame) const { |
| 277 WebURLRequest web_request; | 277 WebURLRequest web_request; |
| 278 web_request.initialize(); | 278 web_request.initialize(); |
| 279 web_request.setURL(frame->document().completeURL(WebString::fromUTF8(url_))); | 279 web_request.setURL(frame->document().completeURL(WebString::fromUTF8(url_))); |
| 280 web_request.setDownloadToFile(stream_to_file_); | 280 web_request.setDownloadToFile(stream_to_file_); |
| 281 web_request.setReportUploadProgress(record_upload_progress()); |
| 281 | 282 |
| 282 if (!method_.empty()) | 283 if (!method_.empty()) |
| 283 web_request.setHTTPMethod(WebString::fromUTF8(method_)); | 284 web_request.setHTTPMethod(WebString::fromUTF8(method_)); |
| 284 | 285 |
| 285 if (!headers_.empty()) { | 286 if (!headers_.empty()) { |
| 286 net::HttpUtil::HeadersIterator it(headers_.begin(), headers_.end(), "\n"); | 287 net::HttpUtil::HeadersIterator it(headers_.begin(), headers_.end(), "\n"); |
| 287 while (it.GetNext()) { | 288 while (it.GetNext()) { |
| 288 web_request.addHTTPHeaderField( | 289 web_request.addHTTPHeaderField( |
| 289 WebString::fromUTF8(it.name()), | 290 WebString::fromUTF8(it.name()), |
| 290 WebString::fromUTF8(it.values())); | 291 WebString::fromUTF8(it.values())); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 310 web_request.setHTTPBody(http_body); | 311 web_request.setHTTPBody(http_body); |
| 311 } | 312 } |
| 312 | 313 |
| 313 frame->setReferrerForRequest(web_request, WebURL()); // Use default. | 314 frame->setReferrerForRequest(web_request, WebURL()); // Use default. |
| 314 return web_request; | 315 return web_request; |
| 315 } | 316 } |
| 316 | 317 |
| 317 } // namespace ppapi | 318 } // namespace ppapi |
| 318 } // namespace webkit | 319 } // namespace webkit |
| 319 | 320 |
| OLD | NEW |