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 "ppapi/proxy/ppb_url_request_info_proxy.h" | 5 #include "ppapi/proxy/ppb_url_request_info_proxy.h" |
6 | 6 |
7 #include "ppapi/c/ppb_url_request_info.h" | 7 #include "ppapi/c/ppb_url_request_info.h" |
8 #include "ppapi/proxy/plugin_dispatcher.h" | 8 #include "ppapi/proxy/plugin_dispatcher.h" |
9 #include "ppapi/proxy/plugin_resource.h" | 9 #include "ppapi/proxy/plugin_resource.h" |
10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 INTERFACE_ID_PPB_URL_REQUEST_INFO, request_info->host_resource(), | 72 INTERFACE_ID_PPB_URL_REQUEST_INFO, request_info->host_resource(), |
73 static_cast<int32_t>(property), | 73 static_cast<int32_t>(property), |
74 SerializedVarSendInput(dispatcher, var))); | 74 SerializedVarSendInput(dispatcher, var))); |
75 | 75 |
76 // TODO(brettw) do some validation on the types. We should be able to tell on | 76 // TODO(brettw) do some validation on the types. We should be able to tell on |
77 // the plugin side whether the request will succeed or fail in the renderer. | 77 // the plugin side whether the request will succeed or fail in the renderer. |
78 return PP_TRUE; | 78 return PP_TRUE; |
79 } | 79 } |
80 | 80 |
81 PP_Bool AppendDataToBody(PP_Resource request_id, | 81 PP_Bool AppendDataToBody(PP_Resource request_id, |
82 const char* data, uint32_t len) { | 82 const void* data, uint32_t len) { |
83 PluginDispatcher* dispatcher; | 83 PluginDispatcher* dispatcher; |
84 URLRequestInfo* request_info; | 84 URLRequestInfo* request_info; |
85 if (!DispatcherFromURLRequestInfo(request_id, &dispatcher, &request_info)) | 85 if (!DispatcherFromURLRequestInfo(request_id, &dispatcher, &request_info)) |
86 return PP_FALSE; | 86 return PP_FALSE; |
87 | 87 |
88 dispatcher->Send(new PpapiHostMsg_PPBURLRequestInfo_AppendDataToBody( | 88 dispatcher->Send(new PpapiHostMsg_PPBURLRequestInfo_AppendDataToBody( |
89 INTERFACE_ID_PPB_URL_REQUEST_INFO, request_info->host_resource(), | 89 INTERFACE_ID_PPB_URL_REQUEST_INFO, request_info->host_resource(), |
90 std::string(data, len))); | 90 std::string(reinterpret_cast<const char*>(data), len))); |
piman
2011/03/24 03:41:36
static_cast
neb
2011/03/25 21:27:10
Done.
| |
91 | 91 |
92 // TODO(brettw) do some validation. We should be able to tell on the plugin | 92 // TODO(brettw) do some validation. We should be able to tell on the plugin |
93 // side whether the request will succeed or fail in the renderer. | 93 // side whether the request will succeed or fail in the renderer. |
94 return PP_TRUE; | 94 return PP_TRUE; |
95 } | 95 } |
96 | 96 |
97 PP_Bool AppendFileToBody(PP_Resource request_id, | 97 PP_Bool AppendFileToBody(PP_Resource request_id, |
98 PP_Resource file_ref_id, | 98 PP_Resource file_ref_id, |
99 int64_t start_offset, | 99 int64_t start_offset, |
100 int64_t number_of_bytes, | 100 int64_t number_of_bytes, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 int64_t start_offset, | 199 int64_t start_offset, |
200 int64_t number_of_bytes, | 200 int64_t number_of_bytes, |
201 double expected_last_modified_time) { | 201 double expected_last_modified_time) { |
202 ppb_url_request_info_target()->AppendFileToBody( | 202 ppb_url_request_info_target()->AppendFileToBody( |
203 request.host_resource(), file_ref.host_resource(), | 203 request.host_resource(), file_ref.host_resource(), |
204 start_offset, number_of_bytes, expected_last_modified_time); | 204 start_offset, number_of_bytes, expected_last_modified_time); |
205 } | 205 } |
206 | 206 |
207 } // namespace proxy | 207 } // namespace proxy |
208 } // namespace pp | 208 } // namespace pp |
OLD | NEW |