diff options
author | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-25 09:49:20 +0000 |
---|---|---|
committer | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-25 09:49:20 +0000 |
commit | 79d816cf8c148613a3af610a39eca90db480b6d6 (patch) | |
tree | 04fc001a2b9d72cd7a4a5cd42ebf86bbe315720e | |
parent | 48743c4df8145d110bd6f2285490721c54a7c3bb (diff) | |
download | chromium_src-79d816cf8c148613a3af610a39eca90db480b6d6.zip chromium_src-79d816cf8c148613a3af610a39eca90db480b6d6.tar.gz chromium_src-79d816cf8c148613a3af610a39eca90db480b6d6.tar.bz2 |
Pepper: Remove in-process support for PPB_Audio.
This is the first in a series of changes to refactor support for PPB_Audio. We
don't need in-process support, so this gets the support for that out of the way
in a change that can be easily reverted if necessary.
BUG=
Review URL: https://codereview.chromium.org/170303005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253102 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/test/ppapi/ppapi_browsertest.cc | 16 | ||||
-rw-r--r-- | content/renderer/pepper/ppb_audio_impl.cc | 41 | ||||
-rw-r--r-- | content/renderer/pepper/ppb_audio_impl.h | 19 | ||||
-rw-r--r-- | content/renderer/pepper/resource_creation_impl.cc | 8 |
4 files changed, 6 insertions, 78 deletions
diff --git a/chrome/test/ppapi/ppapi_browsertest.cc b/chrome/test/ppapi/ppapi_browsertest.cc index fc16193..94a95c3 100644 --- a/chrome/test/ppapi/ppapi_browsertest.cc +++ b/chrome/test/ppapi/ppapi_browsertest.cc @@ -1495,21 +1495,7 @@ IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, AudioConfig) { LIST_TEST(AudioConfig_InvalidConfigs)); } -// Flaky on ChromeOS dbg, http://crbug.com/277564. -#if defined(OS_CHROMEOS) && !defined(NDEBUG) -#define MAYBE_Audio DISABLED_Audio -#else -#define MAYBE_Audio Audio -#endif -IN_PROC_BROWSER_TEST_F(PPAPITest, MAYBE_Audio) { - RunTest(LIST_TEST(Audio_Creation) - LIST_TEST(Audio_DestroyNoStop) - LIST_TEST(Audio_Failures) - LIST_TEST(Audio_AudioCallback1) - LIST_TEST(Audio_AudioCallback2) - LIST_TEST(Audio_AudioCallback3) - LIST_TEST(Audio_AudioCallback4)); -} +// PPB_Audio is not supported in-process. IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, Audio) { RunTest(LIST_TEST(Audio_Creation) LIST_TEST(Audio_DestroyNoStop) diff --git a/content/renderer/pepper/ppb_audio_impl.cc b/content/renderer/pepper/ppb_audio_impl.cc index 2356fea..864c61d 100644 --- a/content/renderer/pepper/ppb_audio_impl.cc +++ b/content/renderer/pepper/ppb_audio_impl.cc @@ -46,51 +46,10 @@ PPB_Audio_Impl::~PPB_Audio_Impl() { } } -// static -PP_Resource PPB_Audio_Impl::Create( - PP_Instance instance, - PP_Resource config, - const ppapi::AudioCallbackCombined& audio_callback, - void* user_data) { - scoped_refptr<PPB_Audio_Impl> audio(new PPB_Audio_Impl(instance)); - if (!audio->Init(config, audio_callback, user_data)) - return 0; - return audio->GetReference(); -} - PPB_Audio_API* PPB_Audio_Impl::AsPPB_Audio_API() { return this; } -bool PPB_Audio_Impl::Init(PP_Resource config, - const ppapi::AudioCallbackCombined& callback, - void* user_data) { - // Validate the config and keep a reference to it. - EnterResourceNoLock<PPB_AudioConfig_API> enter(config, true); - if (enter.failed()) - return false; - config_ = config; - - if (!callback.IsValid()) - return false; - SetCallback(callback, user_data); - - PepperPluginInstanceImpl* instance = static_cast<PepperPluginInstanceImpl*>( - PepperPluginInstance::Get(pp_instance())); - if (!instance) - return false; - - // When the stream is created, we'll get called back on StreamCreated(). - CHECK(!audio_); - audio_ = PepperPlatformAudioOutput::Create( - static_cast<int>(enter.object()->GetSampleRate()), - static_cast<int>(enter.object()->GetSampleFrameCount()), - instance->GetRenderView()->GetRoutingID(), - instance->render_frame()->GetRoutingID(), - this); - return audio_ != NULL; -} - PP_Resource PPB_Audio_Impl::GetCurrentConfig() { // AddRef on behalf of caller, while keeping a ref for ourselves. PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(config_); diff --git a/content/renderer/pepper/ppb_audio_impl.h b/content/renderer/pepper/ppb_audio_impl.h index 16837c8..708524b 100644 --- a/content/renderer/pepper/ppb_audio_impl.h +++ b/content/renderer/pepper/ppb_audio_impl.h @@ -23,28 +23,15 @@ class PepperPlatformAudioOutput; // Some of the backend functionality of this class is implemented by the // PPB_Audio_Shared so it can be shared with the proxy. +// +// TODO(teravest): PPB_Audio is no longer supported in-process. Clean this up +// to look more like typical HostResource implementations. class PPB_Audio_Impl : public ppapi::Resource, public ppapi::PPB_Audio_Shared, public AudioHelper { public: - // Trusted initialization. You must call Init after this. - // - // Untrusted initialization should just call the static Create() function - // to properly create & initialize this class. explicit PPB_Audio_Impl(PP_Instance instance); - // Creation function for untrusted plugins. This handles all initialization - // and will return 0 on failure. - static PP_Resource Create(PP_Instance instance, - PP_Resource config_id, - const ppapi::AudioCallbackCombined& audio_callback, - void* user_data); - - // Initialization function for trusted init. - bool Init(PP_Resource config_id, - const ppapi::AudioCallbackCombined& user_callback, - void* user_data); - // Resource overrides. virtual ppapi::thunk::PPB_Audio_API* AsPPB_Audio_API() OVERRIDE; diff --git a/content/renderer/pepper/resource_creation_impl.cc b/content/renderer/pepper/resource_creation_impl.cc index 18f06fc..5d2c0ee 100644 --- a/content/renderer/pepper/resource_creation_impl.cc +++ b/content/renderer/pepper/resource_creation_impl.cc @@ -37,9 +37,7 @@ PP_Resource ResourceCreationImpl::CreateAudio1_0( PP_Resource config_id, PPB_Audio_Callback_1_0 audio_callback, void* user_data) { - return PPB_Audio_Impl::Create( - instance, config_id, ppapi::AudioCallbackCombined(audio_callback), - user_data); + return 0; // Not supported in-process. } PP_Resource ResourceCreationImpl::CreateAudio( @@ -47,9 +45,7 @@ PP_Resource ResourceCreationImpl::CreateAudio( PP_Resource config_id, PPB_Audio_Callback audio_callback, void* user_data) { - return PPB_Audio_Impl::Create( - instance, config_id, ppapi::AudioCallbackCombined(audio_callback), - user_data); + return 0; // Not supported in-process. } PP_Resource ResourceCreationImpl::CreateAudioConfig( |