| 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/glue/plugins/pepper_url_request_info.h" | 5 #include "webkit/glue/plugins/pepper_url_request_info.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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 const PPB_URLRequestInfo_Dev ppb_urlrequestinfo = { | 116 const PPB_URLRequestInfo_Dev ppb_urlrequestinfo = { |
| 117 &Create, | 117 &Create, |
| 118 &IsURLRequestInfo, | 118 &IsURLRequestInfo, |
| 119 &SetProperty, | 119 &SetProperty, |
| 120 &AppendDataToBody, | 120 &AppendDataToBody, |
| 121 &AppendFileToBody | 121 &AppendFileToBody |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 } // namespace | 124 } // namespace |
| 125 | 125 |
| 126 struct URLRequestInfo::BodyItem { |
| 127 BodyItem(const std::string& data) |
| 128 : data(data), |
| 129 start_offset(0), |
| 130 number_of_bytes(-1), |
| 131 expected_last_modified_time(0.0) { |
| 132 } |
| 133 |
| 134 BodyItem(FileRef* file_ref, |
| 135 int64_t start_offset, |
| 136 int64_t number_of_bytes, |
| 137 PP_Time expected_last_modified_time) |
| 138 : file_ref(file_ref), |
| 139 start_offset(start_offset), |
| 140 number_of_bytes(number_of_bytes), |
| 141 expected_last_modified_time(expected_last_modified_time) { |
| 142 } |
| 143 |
| 144 std::string data; |
| 145 scoped_refptr<FileRef> file_ref; |
| 146 int64_t start_offset; |
| 147 int64_t number_of_bytes; |
| 148 PP_Time expected_last_modified_time; |
| 149 }; |
| 150 |
| 126 URLRequestInfo::URLRequestInfo(PluginModule* module) | 151 URLRequestInfo::URLRequestInfo(PluginModule* module) |
| 127 : Resource(module), | 152 : Resource(module), |
| 128 stream_to_file_(false) { | 153 stream_to_file_(false) { |
| 129 } | 154 } |
| 130 | 155 |
| 131 URLRequestInfo::~URLRequestInfo() { | 156 URLRequestInfo::~URLRequestInfo() { |
| 132 } | 157 } |
| 133 | 158 |
| 134 // static | 159 // static |
| 135 const PPB_URLRequestInfo_Dev* URLRequestInfo::GetInterface() { | 160 const PPB_URLRequestInfo_Dev* URLRequestInfo::GetInterface() { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 } | 252 } |
| 228 } | 253 } |
| 229 web_request.setHTTPBody(http_body); | 254 web_request.setHTTPBody(http_body); |
| 230 } | 255 } |
| 231 | 256 |
| 232 frame->setReferrerForRequest(web_request, WebURL()); // Use default. | 257 frame->setReferrerForRequest(web_request, WebURL()); // Use default. |
| 233 return web_request; | 258 return web_request; |
| 234 } | 259 } |
| 235 | 260 |
| 236 } // namespace pepper | 261 } // namespace pepper |
| OLD | NEW |