| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // From ppb_file_mapping.idl modified Mon Jan 27 11:00:43 2014. | 5 // From ppb_file_mapping.idl modified Mon Apr 7 08:55:47 2014. |
| 6 | 6 |
| 7 #include "ppapi/c/pp_completion_callback.h" | 7 #include "ppapi/c/pp_completion_callback.h" |
| 8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
| 9 #include "ppapi/c/ppb_file_mapping.h" | 9 #include "ppapi/c/ppb_file_mapping.h" |
| 10 #include "ppapi/shared_impl/tracked_callback.h" | 10 #include "ppapi/shared_impl/tracked_callback.h" |
| 11 #include "ppapi/thunk/enter.h" | 11 #include "ppapi/thunk/enter.h" |
| 12 #include "ppapi/thunk/ppapi_thunk_export.h" | 12 #include "ppapi/thunk/ppapi_thunk_export.h" |
| 13 #include "ppapi/thunk/ppb_file_mapping_api.h" | 13 #include "ppapi/thunk/ppb_file_mapping_api.h" |
| 14 | 14 |
| 15 namespace ppapi { | 15 namespace ppapi { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 int32_t Unmap(PP_Instance instance, | 42 int32_t Unmap(PP_Instance instance, |
| 43 const void* address, | 43 const void* address, |
| 44 int64_t length, | 44 int64_t length, |
| 45 struct PP_CompletionCallback callback) { | 45 struct PP_CompletionCallback callback) { |
| 46 VLOG(4) << "PPB_FileMapping::Unmap()"; | 46 VLOG(4) << "PPB_FileMapping::Unmap()"; |
| 47 EnterInstanceAPI<PPB_FileMapping_API> enter(instance, callback); | 47 EnterInstanceAPI<PPB_FileMapping_API> enter(instance, callback); |
| 48 if (enter.failed()) | 48 if (enter.failed()) |
| 49 return enter.retval(); | 49 return enter.retval(); |
| 50 return enter.SetResult(enter.functions()->Unmap(instance, | 50 return enter.SetResult( |
| 51 address, | 51 enter.functions()->Unmap(instance, address, length, enter.callback())); |
| 52 length, | |
| 53 enter.callback())); | |
| 54 } | 52 } |
| 55 | 53 |
| 56 int64_t GetMapPageSize(PP_Instance instance) { | 54 int64_t GetMapPageSize(PP_Instance instance) { |
| 57 VLOG(4) << "PPB_FileMapping::GetMapPageSize()"; | 55 VLOG(4) << "PPB_FileMapping::GetMapPageSize()"; |
| 58 EnterInstanceAPI<PPB_FileMapping_API> enter(instance); | 56 EnterInstanceAPI<PPB_FileMapping_API> enter(instance); |
| 59 if (enter.failed()) | 57 if (enter.failed()) |
| 60 return 0; | 58 return 0; |
| 61 return enter.functions()->GetMapPageSize(instance); | 59 return enter.functions()->GetMapPageSize(instance); |
| 62 } | 60 } |
| 63 | 61 |
| 64 const PPB_FileMapping_0_1 g_ppb_filemapping_thunk_0_1 = { | 62 const PPB_FileMapping_0_1 g_ppb_filemapping_thunk_0_1 = { // |
| 65 &Map, | 63 &Map, // |
| 66 &Unmap, | 64 &Unmap, // |
| 67 &GetMapPageSize | 65 &GetMapPageSize // |
| 68 }; | 66 }; |
| 69 | 67 |
| 70 } // namespace | 68 } // namespace |
| 71 | 69 |
| 72 PPAPI_THUNK_EXPORT const PPB_FileMapping_0_1* GetPPB_FileMapping_0_1_Thunk() { | 70 PPAPI_THUNK_EXPORT const PPB_FileMapping_0_1* GetPPB_FileMapping_0_1_Thunk() { |
| 73 return &g_ppb_filemapping_thunk_0_1; | 71 return &g_ppb_filemapping_thunk_0_1; |
| 74 } | 72 } |
| 75 | 73 |
| 76 } // namespace thunk | 74 } // namespace thunk |
| 77 } // namespace ppapi | 75 } // namespace ppapi |
| OLD | NEW |