summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-03 22:44:58 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-03 22:44:58 +0000
commit73b61881322b88e5bb10fdb9891e6772da334d08 (patch)
tree845d86b72e8a66d1daf578e3c5ab604b503376e2 /webkit
parentaafbcb57bbc46cd82c29fdb3c216ad7b15803704 (diff)
downloadchromium_src-73b61881322b88e5bb10fdb9891e6772da334d08.zip
chromium_src-73b61881322b88e5bb10fdb9891e6772da334d08.tar.gz
chromium_src-73b61881322b88e5bb10fdb9891e6772da334d08.tar.bz2
Revert 95309 - I need to fix some bugs with this.
Add a template to handle properly issuing completion callbacks. This fixes some bugs where we forgot to issue completion callbacks in some error cases in the proxy, and cleans up the cases that were already doing this properly. This removes the PPB_AudioTrusted_API and folds those functions into the regular Audio API. I'm trying to merge more things to have a smaller explosion of APIs and the boilerplate associated with them. Review URL: http://codereview.chromium.org/7551032 TBR=brettw@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95342 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/plugins/ppapi/ppb_audio_impl.cc19
-rw-r--r--webkit/plugins/ppapi/ppb_audio_impl.h5
2 files changed, 16 insertions, 8 deletions
diff --git a/webkit/plugins/ppapi/ppb_audio_impl.cc b/webkit/plugins/ppapi/ppb_audio_impl.cc
index 4c74181..1dc64e6 100644
--- a/webkit/plugins/ppapi/ppb_audio_impl.cc
+++ b/webkit/plugins/ppapi/ppb_audio_impl.cc
@@ -14,10 +14,6 @@
#include "ppapi/thunk/thunk.h"
#include "webkit/plugins/ppapi/common.h"
-using ppapi::thunk::EnterResourceNoLock;
-using ppapi::thunk::PPB_Audio_API;
-using ppapi::thunk::PPB_AudioConfig_API;
-
namespace webkit {
namespace ppapi {
@@ -41,7 +37,8 @@ PP_Resource PPB_AudioConfig_Impl::Create(PluginInstance* instance,
return config->GetReference();
}
-PPB_AudioConfig_API* PPB_AudioConfig_Impl::AsPPB_AudioConfig_API() {
+::ppapi::thunk::PPB_AudioConfig_API*
+PPB_AudioConfig_Impl::AsPPB_AudioConfig_API() {
return this;
}
@@ -89,14 +86,19 @@ PP_Resource PPB_Audio_Impl::Create(PluginInstance* instance,
return audio->GetReference();
}
-PPB_Audio_API* PPB_Audio_Impl::AsPPB_Audio_API() {
+::ppapi::thunk::PPB_Audio_API* PPB_Audio_Impl::AsPPB_Audio_API() {
+ return this;
+}
+
+::ppapi::thunk::PPB_AudioTrusted_API* PPB_Audio_Impl::AsPPB_AudioTrusted_API() {
return this;
}
bool PPB_Audio_Impl::Init(PP_Resource config_id,
PPB_Audio_Callback callback, void* user_data) {
// Validate the config and keep a reference to it.
- EnterResourceNoLock<PPB_AudioConfig_API> enter(config_id, true);
+ ::ppapi::thunk::EnterResourceNoLock< ::ppapi::thunk::PPB_AudioConfig_API>
+ enter(config_id, true);
if (enter.failed())
return false;
config_id_ = config_id;
@@ -145,7 +147,8 @@ int32_t PPB_Audio_Impl::OpenTrusted(PP_Resource config_id,
PP_CompletionCallback create_callback) {
// Validate the config and keep a reference to it.
- EnterResourceNoLock<PPB_AudioConfig_API> enter(config_id, true);
+ ::ppapi::thunk::EnterResourceNoLock< ::ppapi::thunk::PPB_AudioConfig_API>
+ enter(config_id, true);
if (enter.failed())
return false;
config_id_ = config_id;
diff --git a/webkit/plugins/ppapi/ppb_audio_impl.h b/webkit/plugins/ppapi/ppb_audio_impl.h
index 2a3ae8a..3fbd8fa 100644
--- a/webkit/plugins/ppapi/ppb_audio_impl.h
+++ b/webkit/plugins/ppapi/ppb_audio_impl.h
@@ -15,6 +15,7 @@
#include "ppapi/c/trusted/ppb_audio_trusted.h"
#include "ppapi/shared_impl/audio_config_impl.h"
#include "ppapi/shared_impl/audio_impl.h"
+#include "ppapi/thunk/ppb_audio_trusted_api.h"
#include "webkit/plugins/ppapi/plugin_delegate.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
#include "webkit/plugins/ppapi/resource.h"
@@ -48,6 +49,7 @@ class PPB_AudioConfig_Impl : public Resource,
// AudioImpl so it can be shared with the proxy.
class PPB_Audio_Impl : public Resource,
public ::ppapi::AudioImpl,
+ public ::ppapi::thunk::PPB_AudioTrusted_API,
public PluginDelegate::PlatformAudio::Client {
public:
// Trusted initialization. You must call Init after this.
@@ -71,11 +73,14 @@ class PPB_Audio_Impl : public Resource,
// ResourceObjectBase overrides.
virtual ::ppapi::thunk::PPB_Audio_API* AsPPB_Audio_API();
+ virtual ::ppapi::thunk::PPB_AudioTrusted_API* AsPPB_AudioTrusted_API();
// PPB_Audio_API implementation.
virtual PP_Resource GetCurrentConfig() OVERRIDE;
virtual PP_Bool StartPlayback() OVERRIDE;
virtual PP_Bool StopPlayback() OVERRIDE;
+
+ // PPB_AudioTrusted_API implementation.
virtual int32_t OpenTrusted(PP_Resource config_id,
PP_CompletionCallback create_callback) OVERRIDE;
virtual int32_t GetSyncSocket(int* sync_socket) OVERRIDE;