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

Unified Diff: ppapi/proxy/ppp_instance_proxy.cc

Issue 7874002: This patch tries to remove most of the manual registration for Pepper interfaces, and replaces it... (Closed) Base URL: svn://chrome-svn/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 100758)
+++ 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->GetLocalInterface(PPB_FULLSCREEN_DEV_INTERFACE));
+ dispatcher->local_get_interface()(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->GetOrCreatePPBInterfaceProxy(INTERFACE_ID_PPB_URL_LOADER));
+ dispatcher->GetInterfaceProxy(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->GetLocalInterface(PPB_CORE_INTERFACE));
+ dispatcher->local_get_interface()(PPB_CORE_INTERFACE));
if (!core) {
NOTREACHED();
return PP_FALSE;
@@ -105,16 +105,21 @@
&HandleDocumentLoad
};
-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));
+InterfaceProxy* CreateInstanceProxy(Dispatcher* dispatcher) {
+ return new PPP_Instance_Proxy(dispatcher);
}
} // 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() {
}
@@ -125,7 +130,7 @@
PPP_INSTANCE_INTERFACE_1_0,
INTERFACE_ID_PPP_INSTANCE,
false,
- &CreateInstanceProxy<PPP_Instance_1_0>,
+ &CreateInstanceProxy
};
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