Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Unified Diff: ppapi/proxy/ppb_audio_proxy.cc

Issue 7844018: Revert 100748 - This patch tries to remove most of the manual registration for Pepper interfaces,... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/ppb_audio_proxy.h ('k') | ppapi/proxy/ppb_broker_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_audio_proxy.cc
===================================================================
--- ppapi/proxy/ppb_audio_proxy.cc (revision 100753)
+++ ppapi/proxy/ppb_audio_proxy.cc (working copy)
@@ -116,6 +116,11 @@
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.
@@ -130,8 +135,9 @@
} // namespace
-PPB_Audio_Proxy::PPB_Audio_Proxy(Dispatcher* dispatcher)
- : InterfaceProxy(dispatcher),
+PPB_Audio_Proxy::PPB_Audio_Proxy(Dispatcher* dispatcher,
+ const void* target_interface)
+ : InterfaceProxy(dispatcher, target_interface),
callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
}
@@ -139,6 +145,18 @@
}
// 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,
@@ -224,19 +242,16 @@
// Clean up the temporary audio config resource we made.
const PPB_Core* core = static_cast<const PPB_Core*>(
- dispatcher()->local_get_interface()(PPB_CORE_INTERFACE));
+ dispatcher()->GetLocalInterface(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)
- enter.object()->StartPlayback();
+ ppb_audio_target()->StartPlayback(audio_id.host_resource());
else
- enter.object()->StopPlayback();
+ ppb_audio_target()->StopPlayback(audio_id.host_resource());
}
// Processed in the plugin (message from host).
@@ -292,7 +307,7 @@
base::SharedMemoryHandle* foreign_shared_memory_handle,
uint32_t* shared_memory_length) {
// Get the audio interface which will give us the handles.
- EnterHostFromHostResource<PPB_Audio_API> enter(resource);
+ EnterResourceNoLock<PPB_Audio_API> enter(resource.host_resource(), false);
if (enter.failed())
return PP_ERROR_NOINTERFACE;
« no previous file with comments | « ppapi/proxy/ppb_audio_proxy.h ('k') | ppapi/proxy/ppb_broker_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698