Index: ppapi/proxy/ppb_audio_proxy.cc |
=================================================================== |
--- ppapi/proxy/ppb_audio_proxy.cc (revision 100758) |
+++ ppapi/proxy/ppb_audio_proxy.cc (working copy) |
@@ -116,11 +116,6 @@ |
namespace { |
-InterfaceProxy* CreateAudioProxy(Dispatcher* dispatcher, |
- const void* target_interface) { |
- return new PPB_Audio_Proxy(dispatcher, target_interface); |
-} |
- |
base::PlatformFile IntToPlatformFile(int32_t handle) { |
// TODO(piman/brettw): Change trusted interface to return a PP_FileHandle, |
// those casts are ugly. |
@@ -135,9 +130,8 @@ |
} // namespace |
-PPB_Audio_Proxy::PPB_Audio_Proxy(Dispatcher* dispatcher, |
- const void* target_interface) |
- : InterfaceProxy(dispatcher, target_interface), |
+PPB_Audio_Proxy::PPB_Audio_Proxy(Dispatcher* dispatcher) |
+ : InterfaceProxy(dispatcher), |
callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
} |
@@ -145,18 +139,6 @@ |
} |
// static |
-const InterfaceProxy::Info* PPB_Audio_Proxy::GetInfo() { |
- static const Info info = { |
- thunk::GetPPB_Audio_Thunk(), |
- PPB_AUDIO_INTERFACE, |
- INTERFACE_ID_PPB_AUDIO, |
- false, |
- &CreateAudioProxy, |
- }; |
- return &info; |
-} |
- |
-// static |
PP_Resource PPB_Audio_Proxy::CreateProxyResource( |
PP_Instance instance_id, |
PP_Resource config_id, |
@@ -242,16 +224,19 @@ |
// Clean up the temporary audio config resource we made. |
const PPB_Core* core = static_cast<const PPB_Core*>( |
- dispatcher()->GetLocalInterface(PPB_CORE_INTERFACE)); |
+ dispatcher()->local_get_interface()(PPB_CORE_INTERFACE)); |
core->ReleaseResource(audio_config_res); |
} |
void PPB_Audio_Proxy::OnMsgStartOrStop(const HostResource& audio_id, |
bool play) { |
+ EnterHostFromHostResource<PPB_Audio_API> enter(audio_id); |
+ if (enter.failed()) |
+ return; |
if (play) |
- ppb_audio_target()->StartPlayback(audio_id.host_resource()); |
+ enter.object()->StartPlayback(); |
else |
- ppb_audio_target()->StopPlayback(audio_id.host_resource()); |
+ enter.object()->StopPlayback(); |
} |
// Processed in the plugin (message from host). |
@@ -307,7 +292,7 @@ |
base::SharedMemoryHandle* foreign_shared_memory_handle, |
uint32_t* shared_memory_length) { |
// Get the audio interface which will give us the handles. |
- EnterResourceNoLock<PPB_Audio_API> enter(resource.host_resource(), false); |
+ EnterHostFromHostResource<PPB_Audio_API> enter(resource); |
if (enter.failed()) |
return PP_ERROR_NOINTERFACE; |