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/c/pp_errors.h" | 5 #include "ppapi/c/pp_errors.h" |
6 #include "ppapi/c/trusted/ppb_audio_trusted.h" | 6 #include "ppapi/c/trusted/ppb_audio_trusted.h" |
7 #include "ppapi/thunk/enter.h" | 7 #include "ppapi/thunk/enter.h" |
8 #include "ppapi/thunk/thunk.h" | 8 #include "ppapi/thunk/thunk.h" |
9 #include "ppapi/thunk/ppb_audio_api.h" | 9 #include "ppapi/thunk/ppb_audio_api.h" |
10 #include "ppapi/thunk/resource_creation_api.h" | 10 #include "ppapi/thunk/resource_creation_api.h" |
11 | 11 |
12 namespace ppapi { | 12 namespace ppapi { |
13 namespace thunk { | 13 namespace thunk { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 typedef EnterResource<PPB_Audio_API> EnterAudio; | 17 typedef EnterResource<PPB_Audio_API> EnterAudio; |
18 | 18 |
19 PP_Resource Create(PP_Instance instance_id) { | 19 PP_Resource Create(PP_Instance instance_id) { |
20 EnterFunction<ResourceCreationAPI> enter(instance_id, true); | 20 EnterResourceCreation enter(instance_id); |
21 if (enter.failed()) | 21 if (enter.failed()) |
22 return 0; | 22 return 0; |
23 return enter.functions()->CreateAudioTrusted(instance_id); | 23 return enter.functions()->CreateAudioTrusted(instance_id); |
24 } | 24 } |
25 | 25 |
26 int32_t Open(PP_Resource audio_id, | 26 int32_t Open(PP_Resource audio_id, |
27 PP_Resource config_id, | 27 PP_Resource config_id, |
28 PP_CompletionCallback callback) { | 28 PP_CompletionCallback callback) { |
29 EnterAudio enter(audio_id, callback, true); | 29 EnterAudio enter(audio_id, callback, true); |
30 if (enter.failed()) | 30 if (enter.failed()) |
(...skipping 25 matching lines...) Expand all Loading... |
56 }; | 56 }; |
57 | 57 |
58 } // namespace | 58 } // namespace |
59 | 59 |
60 const PPB_AudioTrusted_0_6* GetPPB_AudioTrusted_0_6_Thunk() { | 60 const PPB_AudioTrusted_0_6* GetPPB_AudioTrusted_0_6_Thunk() { |
61 return &g_ppb_audio_trusted_thunk; | 61 return &g_ppb_audio_trusted_thunk; |
62 } | 62 } |
63 | 63 |
64 } // namespace thunk | 64 } // namespace thunk |
65 } // namespace ppapi | 65 } // namespace ppapi |
OLD | NEW |