diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 05:33:20 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 05:33:20 +0000 |
commit | 7ca87c2179917c73feae2f6183d2536dd6690623 (patch) | |
tree | e4bf36cdd3bb3045f82d1d921f760d70b7dc73d5 /webkit/plugins/ppapi/ppb_audio_impl.cc | |
parent | 187c54919b3af4cd6dec23d9ea3c1547417fe7be (diff) | |
download | chromium_src-7ca87c2179917c73feae2f6183d2536dd6690623.zip chromium_src-7ca87c2179917c73feae2f6183d2536dd6690623.tar.gz chromium_src-7ca87c2179917c73feae2f6183d2536dd6690623.tar.bz2 |
Add an instance parameter to var objects, audio, and the 2D API. This replaces the module in most cases.
This will be used in the proxy to multiplex one plugin across multiple renderer processes. We need the instance in the proxy to know which process to send it to.
I added a deprecated var object creation function for native client, which
depends on the module and this is very difficult to change. Because it doesn't
have the multiplexing requirements, this is fine for now.
TEST=ppapi ui tests
BUG=none
Review URL: http://codereview.chromium.org/6085009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70721 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi/ppb_audio_impl.cc')
-rw-r--r-- | webkit/plugins/ppapi/ppb_audio_impl.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/webkit/plugins/ppapi/ppb_audio_impl.cc b/webkit/plugins/ppapi/ppb_audio_impl.cc index db11eba..c535334 100644 --- a/webkit/plugins/ppapi/ppb_audio_impl.cc +++ b/webkit/plugins/ppapi/ppb_audio_impl.cc @@ -19,11 +19,11 @@ namespace { uint32_t RecommendSampleFrameCount(uint32_t requested_sample_frame_count); -PP_Resource CreateStereo16bit(PP_Module module_id, +PP_Resource CreateStereo16bit(PP_Instance instance_id, PP_AudioSampleRate_Dev sample_rate, uint32_t sample_frame_count) { - PluginModule* module = ResourceTracker::Get()->GetModule(module_id); - if (!module) + PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); + if (!instance) return 0; // TODO(brettw): Currently we don't actually check what the hardware @@ -38,7 +38,8 @@ PP_Resource CreateStereo16bit(PP_Module module_id, return 0; scoped_refptr<PPB_AudioConfig_Impl> config( - new PPB_AudioConfig_Impl(module, sample_rate, sample_frame_count)); + new PPB_AudioConfig_Impl(instance->module(), sample_rate, + sample_frame_count)); return config->GetReference(); } @@ -102,7 +103,8 @@ PP_Bool IsAudio(PP_Resource resource) { } PP_Resource GetCurrentConfig(PP_Resource audio_id) { - scoped_refptr<PPB_Audio_Impl> audio = Resource::GetAs<PPB_Audio_Impl>(audio_id); + scoped_refptr<PPB_Audio_Impl> audio = + Resource::GetAs<PPB_Audio_Impl>(audio_id); return audio ? audio->GetCurrentConfig() : 0; } @@ -132,7 +134,8 @@ PP_Resource CreateTrusted(PP_Instance instance_id) { PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); if (!instance) return 0; - scoped_refptr<PPB_Audio_Impl> audio(new PPB_Audio_Impl(instance->module(), instance_id)); + scoped_refptr<PPB_Audio_Impl> audio( + new PPB_Audio_Impl(instance->module(), instance_id)); return audio->GetReference(); } |