Commit 793202cb authored by teravest@chromium.org's avatar teravest@chromium.org

Autogenerate thunk .cc file for PPB_Audio.


BUG=


Review URL: https://chromiumcodereview.appspot.com/11316335

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171047 0039d316-1c4b-4281-b951-d872f2087c98
parent dcd7e26e
......@@ -8,6 +8,8 @@
* realtime stereo audio streaming capabilities.
*/
[generate_thunk]
label Chrome {
M14 = 1.0
};
......
......@@ -2,67 +2,73 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ppapi/thunk/thunk.h"
// From ppb_audio.idl modified Tue Dec 4 10:41:02 2012.
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/ppb_audio.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_audio_api.h"
#include "ppapi/thunk/ppb_instance_api.h"
#include "ppapi/thunk/resource_creation_api.h"
#include "ppapi/thunk/thunk.h"
namespace ppapi {
namespace thunk {
namespace {
typedef EnterResource<PPB_Audio_API> EnterAudio;
PP_Resource Create(PP_Instance instance,
PP_Resource config_id,
PPB_Audio_Callback callback,
PP_Resource config,
PPB_Audio_Callback audio_callback,
void* user_data) {
EnterResourceCreation enter(instance);
if (enter.failed())
return 0;
return enter.functions()->CreateAudio(instance, config_id,
callback, user_data);
return enter.functions()->CreateAudio(instance,
config,
audio_callback,
user_data);
}
PP_Bool IsAudio(PP_Resource resource) {
EnterAudio enter(resource, false);
return enter.succeeded() ? PP_TRUE : PP_FALSE;
EnterResource<PPB_Audio_API> enter(resource, false);
return PP_FromBool(enter.succeeded());
}
PP_Resource GetCurrentConfiguration(PP_Resource audio_id) {
EnterAudio enter(audio_id, true);
PP_Resource GetCurrentConfig(PP_Resource audio) {
EnterResource<PPB_Audio_API> enter(audio, true);
if (enter.failed())
return 0;
return enter.object()->GetCurrentConfig();
}
PP_Bool StartPlayback(PP_Resource audio_id) {
EnterAudio enter(audio_id, true);
PP_Bool StartPlayback(PP_Resource audio) {
EnterResource<PPB_Audio_API> enter(audio, true);
if (enter.failed())
return PP_FALSE;
return enter.object()->StartPlayback();
}
PP_Bool StopPlayback(PP_Resource audio_id) {
EnterAudio enter(audio_id, true);
PP_Bool StopPlayback(PP_Resource audio) {
EnterResource<PPB_Audio_API> enter(audio, true);
if (enter.failed())
return PP_FALSE;
return enter.object()->StopPlayback();
}
const PPB_Audio g_ppb_audio_thunk = {
const PPB_Audio_1_0 g_ppb_audio_thunk_1_0 = {
&Create,
&IsAudio,
&GetCurrentConfiguration,
&GetCurrentConfig,
&StartPlayback,
&StopPlayback
&StopPlayback,
};
} // namespace
const PPB_Audio_1_0* GetPPB_Audio_1_0_Thunk() {
return &g_ppb_audio_thunk;
return &g_ppb_audio_thunk_1_0;
}
} // namespace thunk
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment