Chromium Code Reviews| Index: webkit/plugins/ppapi/ppb_url_request_info_impl.cc |
| diff --git a/webkit/plugins/ppapi/ppb_url_request_info_impl.cc b/webkit/plugins/ppapi/ppb_url_request_info_impl.cc |
| index 44aa1615ff637cc5c9be95cb610c6ef9b2314c21..a07452f6fca529ec321c72cc282f4f2ec2f46910 100644 |
| --- a/webkit/plugins/ppapi/ppb_url_request_info_impl.cc |
| +++ b/webkit/plugins/ppapi/ppb_url_request_info_impl.cc |
| @@ -19,11 +19,13 @@ |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebHTTPBody.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
| +#include "webkit/glue/webkit_glue.h" |
| #include "webkit/plugins/ppapi/common.h" |
| #include "webkit/plugins/ppapi/plugin_module.h" |
| +#include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| #include "webkit/plugins/ppapi/ppb_file_ref_impl.h" |
| +#include "webkit/plugins/ppapi/ppb_file_system_impl.h" |
| #include "webkit/plugins/ppapi/string.h" |
| -#include "webkit/glue/webkit_glue.h" |
| using ppapi::StringVar; |
| using ppapi::thunk::EnterResourceNoLock; |
| @@ -94,7 +96,7 @@ bool AreValidHeaders(const std::string& headers) { |
| } // namespace |
| struct PPB_URLRequestInfo_Impl::BodyItem { |
| - BodyItem(const std::string& data) |
| + explicit BodyItem(const std::string& data) |
| : data(data), |
| start_offset(0), |
| number_of_bytes(-1), |
| @@ -224,9 +226,22 @@ WebURLRequest PPB_URLRequestInfo_Impl::ToWebURLRequest(WebFrame* frame) const { |
| http_body.initialize(); |
| for (size_t i = 0; i < body_.size(); ++i) { |
| if (body_[i].file_ref) { |
| + FilePath platform_path; |
| + switch (body_[i].file_ref->file_system()->type()) { |
| + case PP_FILESYSTEMTYPE_LOCALTEMPORARY: |
| + case PP_FILESYSTEMTYPE_LOCALPERSISTENT: |
| + instance()->delegate()->SyncGetFileSystemPlatformPath( |
|
darin (slow to review)
2011/08/16 17:28:36
can you insert a TODO(kinuko) here about switching
kinuko
2011/08/17 07:55:28
Done.
|
| + body_[i].file_ref->GetFileSystemURL(), |
| + &platform_path); |
| + break; |
| + case PP_FILESYSTEMTYPE_EXTERNAL: |
| + platform_path = body_[i].file_ref->GetSystemPath(); |
| + break; |
| + default: |
| + NOTREACHED(); |
| + } |
| http_body.appendFileRange( |
| - webkit_glue::FilePathToWebString( |
| - body_[i].file_ref->GetSystemPath()), |
| + webkit_glue::FilePathToWebString(platform_path), |
| body_[i].start_offset, |
| body_[i].number_of_bytes, |
| body_[i].expected_last_modified_time); |