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 "net/http/http_util.h" | 10 #include "net/http/http_util.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 string->value())); | 120 string->value())); |
121 break; | 121 break; |
122 } | 122 } |
123 default: | 123 default: |
124 break; | 124 break; |
125 } | 125 } |
126 return result; | 126 return result; |
127 } | 127 } |
128 | 128 |
129 PP_Bool AppendDataToBody(PP_Resource request_id, | 129 PP_Bool AppendDataToBody(PP_Resource request_id, |
130 const char* data, | 130 const void* data, |
131 uint32_t len) { | 131 uint32_t len) { |
132 scoped_refptr<PPB_URLRequestInfo_Impl> request( | 132 scoped_refptr<PPB_URLRequestInfo_Impl> request( |
133 Resource::GetAs<PPB_URLRequestInfo_Impl>(request_id)); | 133 Resource::GetAs<PPB_URLRequestInfo_Impl>(request_id)); |
134 if (!request) | 134 if (!request) |
135 return PP_FALSE; | 135 return PP_FALSE; |
136 | 136 |
137 return BoolToPPBool(request->AppendDataToBody(std::string(data, len))); | 137 return BoolToPPBool(request->AppendDataToBody(std::string( |
138 reinterpret_cast<const char*>(data), len))); | |
piman
2011/03/24 03:41:36
static_cast
neb
2011/03/25 21:27:10
Done.
| |
138 } | 139 } |
139 | 140 |
140 PP_Bool AppendFileToBody(PP_Resource request_id, | 141 PP_Bool AppendFileToBody(PP_Resource request_id, |
141 PP_Resource file_ref_id, | 142 PP_Resource file_ref_id, |
142 int64_t start_offset, | 143 int64_t start_offset, |
143 int64_t number_of_bytes, | 144 int64_t number_of_bytes, |
144 PP_Time expected_last_modified_time) { | 145 PP_Time expected_last_modified_time) { |
145 scoped_refptr<PPB_URLRequestInfo_Impl> request( | 146 scoped_refptr<PPB_URLRequestInfo_Impl> request( |
146 Resource::GetAs<PPB_URLRequestInfo_Impl>(request_id)); | 147 Resource::GetAs<PPB_URLRequestInfo_Impl>(request_id)); |
147 if (!request) | 148 if (!request) |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
343 | 344 |
344 return web_request; | 345 return web_request; |
345 } | 346 } |
346 | 347 |
347 bool PPB_URLRequestInfo_Impl::RequiresUniversalAccess() const { | 348 bool PPB_URLRequestInfo_Impl::RequiresUniversalAccess() const { |
348 return has_custom_referrer_url_; | 349 return has_custom_referrer_url_; |
349 } | 350 } |
350 | 351 |
351 } // namespace ppapi | 352 } // namespace ppapi |
352 } // namespace webkit | 353 } // namespace webkit |
OLD | NEW |