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

Unified Diff: ppapi/proxy/ppp_instance_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/ppp_instance_proxy.h ('k') | ppapi/proxy/ppp_messaging_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppp_instance_proxy.cc
===================================================================
--- ppapi/proxy/ppp_instance_proxy.cc (revision 100753)
+++ ppapi/proxy/ppp_instance_proxy.cc (working copy)
@@ -50,7 +50,7 @@
HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance);
const PPB_Fullscreen_Dev* fullscreen_interface =
static_cast<const PPB_Fullscreen_Dev*>(
- dispatcher->local_get_interface()(PPB_FULLSCREEN_DEV_INTERFACE));
+ dispatcher->GetLocalInterface(PPB_FULLSCREEN_DEV_INTERFACE));
DCHECK(fullscreen_interface);
PP_Bool fullscreen = fullscreen_interface->IsFullscreen(instance);
dispatcher->Send(
@@ -73,7 +73,7 @@
// Set up the URLLoader for proxying.
PPB_URLLoader_Proxy* url_loader_proxy = static_cast<PPB_URLLoader_Proxy*>(
- dispatcher->GetInterfaceProxy(INTERFACE_ID_PPB_URL_LOADER));
+ dispatcher->GetOrCreatePPBInterfaceProxy(INTERFACE_ID_PPB_URL_LOADER));
url_loader_proxy->PrepareURLLoaderForSendingToPlugin(url_loader);
// PluginResourceTracker in the plugin process assumes that resources that it
@@ -83,7 +83,7 @@
// Please also see comments in PPP_Instance_Proxy::OnMsgHandleDocumentLoad()
// about releasing of this extra reference.
const PPB_Core* core = reinterpret_cast<const PPB_Core*>(
- dispatcher->local_get_interface()(PPB_CORE_INTERFACE));
+ dispatcher->GetLocalInterface(PPB_CORE_INTERFACE));
if (!core) {
NOTREACHED();
return PP_FALSE;
@@ -105,21 +105,16 @@
&HandleDocumentLoad
};
-InterfaceProxy* CreateInstanceProxy(Dispatcher* dispatcher) {
- return new PPP_Instance_Proxy(dispatcher);
+template <class PPP_Instance_Type>
+InterfaceProxy* CreateInstanceProxy(Dispatcher* dispatcher,
+ const void* target_interface) {
+ return new PPP_Instance_Proxy(
+ dispatcher,
+ static_cast<const PPP_Instance_Type*>(target_interface));
}
} // namespace
-PPP_Instance_Proxy::PPP_Instance_Proxy(Dispatcher* dispatcher)
- : InterfaceProxy(dispatcher) {
- if (dispatcher->IsPlugin()) {
- combined_interface_.reset(
- new PPP_Instance_Combined(*static_cast<const PPP_Instance_1_0*>(
- dispatcher->local_get_interface()(PPP_INSTANCE_INTERFACE_1_0))));
- }
-}
-
PPP_Instance_Proxy::~PPP_Instance_Proxy() {
}
@@ -130,7 +125,7 @@
PPP_INSTANCE_INTERFACE_1_0,
INTERFACE_ID_PPP_INSTANCE,
false,
- &CreateInstanceProxy
+ &CreateInstanceProxy<PPP_Instance_1_0>,
};
return &info;
}
« no previous file with comments | « ppapi/proxy/ppp_instance_proxy.h ('k') | ppapi/proxy/ppp_messaging_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698