diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-03 20:52:20 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-03 20:52:20 +0000 |
commit | 0609474310417da4a2235d85639aa387a8df0a6b (patch) | |
tree | 15f7ce49d32bfd832e65d6f015db5ae70607c6a9 /webkit | |
parent | 7efc582d60227aa473c77c3309a96b2dfed52351 (diff) | |
download | chromium_src-0609474310417da4a2235d85639aa387a8df0a6b.zip chromium_src-0609474310417da4a2235d85639aa387a8df0a6b.tar.gz chromium_src-0609474310417da4a2235d85639aa387a8df0a6b.tar.bz2 |
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
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95309 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/plugins/ppapi/ppb_audio_impl.cc | 19 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_audio_impl.h | 5 |
2 files changed, 8 insertions, 16 deletions
diff --git a/webkit/plugins/ppapi/ppb_audio_impl.cc b/webkit/plugins/ppapi/ppb_audio_impl.cc index 1dc64e6..4c74181 100644 --- a/webkit/plugins/ppapi/ppb_audio_impl.cc +++ b/webkit/plugins/ppapi/ppb_audio_impl.cc @@ -14,6 +14,10 @@ #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 { @@ -37,8 +41,7 @@ PP_Resource PPB_AudioConfig_Impl::Create(PluginInstance* instance, return config->GetReference(); } -::ppapi::thunk::PPB_AudioConfig_API* -PPB_AudioConfig_Impl::AsPPB_AudioConfig_API() { +PPB_AudioConfig_API* PPB_AudioConfig_Impl::AsPPB_AudioConfig_API() { return this; } @@ -86,19 +89,14 @@ PP_Resource PPB_Audio_Impl::Create(PluginInstance* instance, return audio->GetReference(); } -::ppapi::thunk::PPB_Audio_API* PPB_Audio_Impl::AsPPB_Audio_API() { - return this; -} - -::ppapi::thunk::PPB_AudioTrusted_API* PPB_Audio_Impl::AsPPB_AudioTrusted_API() { +PPB_Audio_API* PPB_Audio_Impl::AsPPB_Audio_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. - ::ppapi::thunk::EnterResourceNoLock< ::ppapi::thunk::PPB_AudioConfig_API> - enter(config_id, true); + EnterResourceNoLock<PPB_AudioConfig_API> enter(config_id, true); if (enter.failed()) return false; config_id_ = config_id; @@ -147,8 +145,7 @@ int32_t PPB_Audio_Impl::OpenTrusted(PP_Resource config_id, PP_CompletionCallback create_callback) { // Validate the config and keep a reference to it. - ::ppapi::thunk::EnterResourceNoLock< ::ppapi::thunk::PPB_AudioConfig_API> - enter(config_id, true); + EnterResourceNoLock<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 3fbd8fa..2a3ae8a 100644 --- a/webkit/plugins/ppapi/ppb_audio_impl.h +++ b/webkit/plugins/ppapi/ppb_audio_impl.h @@ -15,7 +15,6 @@ #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" @@ -49,7 +48,6 @@ 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. @@ -73,14 +71,11 @@ 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; |