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 // From trusted/ppb_buffer_trusted.idl modified Mon Jan 14 14:31:34 2013. | 5 // From trusted/ppb_buffer_trusted.idl modified Wed Feb 6 15:21:31 2013. |
6 | 6 |
7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
8 #include "ppapi/c/trusted/ppb_buffer_trusted.h" | 8 #include "ppapi/c/trusted/ppb_buffer_trusted.h" |
9 #include "ppapi/shared_impl/tracked_callback.h" | 9 #include "ppapi/shared_impl/tracked_callback.h" |
10 #include "ppapi/thunk/enter.h" | 10 #include "ppapi/thunk/enter.h" |
11 #include "ppapi/thunk/ppb_buffer_trusted_api.h" | 11 #include "ppapi/thunk/ppb_buffer_api.h" |
12 #include "ppapi/thunk/ppb_instance_api.h" | 12 #include "ppapi/thunk/ppb_instance_api.h" |
13 #include "ppapi/thunk/resource_creation_api.h" | 13 #include "ppapi/thunk/resource_creation_api.h" |
14 #include "ppapi/thunk/thunk.h" | 14 #include "ppapi/thunk/thunk.h" |
15 | 15 |
16 namespace ppapi { | 16 namespace ppapi { |
17 namespace thunk { | 17 namespace thunk { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 int32_t GetSharedMemory(PP_Resource buffer, int* handle) { | 21 int32_t GetSharedMemory(PP_Resource buffer, int* handle) { |
22 EnterResource<PPB_BufferTrusted_API> enter(buffer, true); | 22 EnterResource<PPB_Buffer_API> enter(buffer, true); |
23 if (enter.failed()) | 23 if (enter.failed()) |
24 return enter.retval(); | 24 return enter.retval(); |
25 return enter.object()->GetSharedMemory(handle); | 25 return enter.object()->GetSharedMemory(handle); |
26 } | 26 } |
27 | 27 |
28 const PPB_BufferTrusted_0_1 g_ppb_buffertrusted_thunk_0_1 = { | 28 const PPB_BufferTrusted_0_1 g_ppb_buffertrusted_thunk_0_1 = { |
29 &GetSharedMemory | 29 &GetSharedMemory |
30 }; | 30 }; |
31 | 31 |
32 } // namespace | 32 } // namespace |
33 | 33 |
34 const PPB_BufferTrusted_0_1* GetPPB_BufferTrusted_0_1_Thunk() { | 34 const PPB_BufferTrusted_0_1* GetPPB_BufferTrusted_0_1_Thunk() { |
35 return &g_ppb_buffertrusted_thunk_0_1; | 35 return &g_ppb_buffertrusted_thunk_0_1; |
36 } | 36 } |
37 | 37 |
38 } // namespace thunk | 38 } // namespace thunk |
39 } // namespace ppapi | 39 } // namespace ppapi |
OLD | NEW |