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/thunk/thunk.h" | 5 #include "ppapi/thunk/thunk.h" |
6 #include "ppapi/thunk/enter.h" | 6 #include "ppapi/thunk/enter.h" |
7 #include "ppapi/thunk/ppb_audio_api.h" | 7 #include "ppapi/thunk/ppb_audio_api.h" |
8 #include "ppapi/thunk/resource_creation_api.h" | 8 #include "ppapi/thunk/resource_creation_api.h" |
9 | 9 |
10 namespace ppapi { | 10 namespace ppapi { |
11 namespace thunk { | 11 namespace thunk { |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 typedef EnterResource<PPB_Audio_API> EnterAudio; | 15 typedef EnterResource<PPB_Audio_API> EnterAudio; |
16 | 16 |
17 PP_Resource Create(PP_Instance instance, | 17 PP_Resource Create(PP_Instance instance, |
18 PP_Resource config_id, | 18 PP_Resource config_id, |
19 PPB_Audio_Callback callback, | 19 PPB_Audio_Callback callback, |
20 void* user_data) { | 20 void* user_data) { |
21 EnterFunction<ResourceCreationAPI> enter(instance, true); | 21 EnterResourceCreation enter(instance); |
22 if (enter.failed()) | 22 if (enter.failed()) |
23 return 0; | 23 return 0; |
24 return enter.functions()->CreateAudio(instance, config_id, | 24 return enter.functions()->CreateAudio(instance, config_id, |
25 callback, user_data); | 25 callback, user_data); |
26 } | 26 } |
27 | 27 |
28 PP_Bool IsAudio(PP_Resource resource) { | 28 PP_Bool IsAudio(PP_Resource resource) { |
29 EnterAudio enter(resource, false); | 29 EnterAudio enter(resource, false); |
30 return enter.succeeded() ? PP_TRUE : PP_FALSE; | 30 return enter.succeeded() ? PP_TRUE : PP_FALSE; |
31 } | 31 } |
(...skipping 28 matching lines...) Expand all Loading... |
60 }; | 60 }; |
61 | 61 |
62 } // namespace | 62 } // namespace |
63 | 63 |
64 const PPB_Audio_1_0* GetPPB_Audio_1_0_Thunk() { | 64 const PPB_Audio_1_0* GetPPB_Audio_1_0_Thunk() { |
65 return &g_ppb_audio_thunk; | 65 return &g_ppb_audio_thunk; |
66 } | 66 } |
67 | 67 |
68 } // namespace thunk | 68 } // namespace thunk |
69 } // namespace ppapi | 69 } // namespace ppapi |
OLD | NEW |