OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_file_ref_proxy.h" | 5 #include "ppapi/proxy/ppb_file_ref_proxy.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFileRef_GetAbsolutePath, | 227 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFileRef_GetAbsolutePath, |
228 OnMsgGetAbsolutePath) | 228 OnMsgGetAbsolutePath) |
229 | 229 |
230 IPC_MESSAGE_HANDLER(PpapiMsg_PPBFileRef_CallbackComplete, | 230 IPC_MESSAGE_HANDLER(PpapiMsg_PPBFileRef_CallbackComplete, |
231 OnMsgCallbackComplete) | 231 OnMsgCallbackComplete) |
232 IPC_MESSAGE_UNHANDLED(handled = false) | 232 IPC_MESSAGE_UNHANDLED(handled = false) |
233 IPC_END_MESSAGE_MAP() | 233 IPC_END_MESSAGE_MAP() |
234 return handled; | 234 return handled; |
235 } | 235 } |
236 | 236 |
| 237 // static |
237 void PPB_FileRef_Proxy::SerializeFileRef(PP_Resource file_ref, | 238 void PPB_FileRef_Proxy::SerializeFileRef(PP_Resource file_ref, |
238 PPB_FileRef_CreateInfo* result) { | 239 PPB_FileRef_CreateInfo* result) { |
239 EnterResourceNoLock<PPB_FileRef_API> enter(file_ref, false); | 240 EnterResourceNoLock<PPB_FileRef_API> enter(file_ref, false); |
240 if (enter.succeeded()) | 241 if (enter.succeeded()) |
241 *result = enter.object()->GetCreateInfo(); | 242 *result = enter.object()->GetCreateInfo(); |
242 } | 243 } |
243 | 244 |
244 // static | 245 // static |
245 PP_Resource PPB_FileRef_Proxy::DeserializeFileRef( | 246 PP_Resource PPB_FileRef_Proxy::DeserializeFileRef( |
246 const PPB_FileRef_CreateInfo& serialized) { | 247 const PPB_FileRef_CreateInfo& serialized) { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 int32_t result, | 337 int32_t result, |
337 const HostResource& host_resource, | 338 const HostResource& host_resource, |
338 int callback_id) { | 339 int callback_id) { |
339 // Execute OnMsgCallbackComplete in the plugin process. | 340 // Execute OnMsgCallbackComplete in the plugin process. |
340 Send(new PpapiMsg_PPBFileRef_CallbackComplete( | 341 Send(new PpapiMsg_PPBFileRef_CallbackComplete( |
341 API_ID_PPB_FILE_REF, host_resource, callback_id, result)); | 342 API_ID_PPB_FILE_REF, host_resource, callback_id, result)); |
342 } | 343 } |
343 | 344 |
344 } // namespace proxy | 345 } // namespace proxy |
345 } // namespace ppapi | 346 } // namespace ppapi |
OLD | NEW |