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
3 // found in the LICENSE file.
5 #include "ppapi/c/pp_errors.h"
6 #include "ppapi/c/trusted/ppb_audio_trusted.h"
7 #include "ppapi/thunk/enter.h"
8 #include "ppapi/thunk/thunk.h"
9 #include "ppapi/thunk/ppb_audio_api.h"
10 #include "ppapi/thunk/resource_creation_api.h"
17 typedef EnterResource
<PPB_Audio_API
> EnterAudio
;
19 PP_Resource
Create(PP_Instance instance_id
) {
20 EnterFunction
<ResourceCreationAPI
> enter(instance_id
, true);
23 return enter
.functions()->CreateAudioTrusted(instance_id
);
26 int32_t Open(PP_Resource audio_id
,
27 PP_Resource config_id
,
28 PP_CompletionCallback callback
) {
29 EnterAudio
enter(audio_id
, callback
, true);
31 return enter
.retval();
32 return enter
.SetResult(enter
.object()->OpenTrusted(config_id
, callback
));
35 int32_t GetSyncSocket(PP_Resource audio_id
, int* sync_socket
) {
36 EnterAudio
enter(audio_id
, true);
38 return enter
.retval();
39 return enter
.object()->GetSyncSocket(sync_socket
);
42 int32_t GetSharedMemory(PP_Resource audio_id
,
45 EnterAudio
enter(audio_id
, true);
47 return enter
.retval();
48 return enter
.object()->GetSharedMemory(shm_handle
, shm_size
);
51 const PPB_AudioTrusted g_ppb_audio_trusted_thunk
= {
60 const PPB_AudioTrusted_0_6
* GetPPB_AudioTrusted_0_6_Thunk() {
61 return &g_ppb_audio_trusted_thunk
;