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

Unified Diff: ppapi/proxy/ppp_messaging_proxy.cc

Issue 7740038: Use macros to define pepper interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New patch 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_messaging_proxy.h ('k') | ppapi/proxy/ppp_mouse_lock_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppp_messaging_proxy.cc
diff --git a/ppapi/proxy/ppp_messaging_proxy.cc b/ppapi/proxy/ppp_messaging_proxy.cc
index 59f4574d83e50fda3a5c8cbd9ec664735afb5032..390794a8d237979f62294c1584af725a8e60b896 100644
--- a/ppapi/proxy/ppp_messaging_proxy.cc
+++ b/ppapi/proxy/ppp_messaging_proxy.cc
@@ -37,16 +37,19 @@ static const PPP_Messaging messaging_interface = {
&HandleMessage
};
-InterfaceProxy* CreateMessagingProxy(Dispatcher* dispatcher,
- const void* target_interface) {
- return new PPP_Messaging_Proxy(dispatcher, target_interface);
+InterfaceProxy* CreateMessagingProxy(Dispatcher* dispatcher) {
+ return new PPP_Messaging_Proxy(dispatcher);
}
} // namespace
-PPP_Messaging_Proxy::PPP_Messaging_Proxy(Dispatcher* dispatcher,
- const void* target_interface)
- : InterfaceProxy(dispatcher, target_interface) {
+PPP_Messaging_Proxy::PPP_Messaging_Proxy(Dispatcher* dispatcher)
+ : InterfaceProxy(dispatcher),
+ ppp_messaging_impl_(NULL) {
+ if (dispatcher->IsPlugin()) {
+ ppp_messaging_impl_ = static_cast<const PPP_Messaging*>(
+ dispatcher->local_get_interface()(PPP_MESSAGING_INTERFACE));
+ }
}
PPP_Messaging_Proxy::~PPP_Messaging_Proxy() {
@@ -80,7 +83,7 @@ void PPP_Messaging_Proxy::OnMsgHandleMessage(
// SerializedVarReceiveInput will decrement the reference count, but we want
// to give the recipient a reference.
PluginResourceTracker::GetInstance()->var_tracker().AddRefVar(received_var);
- ppp_messaging_target()->HandleMessage(instance, received_var);
+ ppp_messaging_impl_->HandleMessage(instance, received_var);
}
} // namespace proxy
« no previous file with comments | « ppapi/proxy/ppp_messaging_proxy.h ('k') | ppapi/proxy/ppp_mouse_lock_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698