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

Unified Diff: ppapi/proxy/ppp_instance_private_proxy.cc

Issue 7740038: Use macros to define pepper interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review 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
Index: ppapi/proxy/ppp_instance_private_proxy.cc
diff --git a/ppapi/proxy/ppp_instance_private_proxy.cc b/ppapi/proxy/ppp_instance_private_proxy.cc
index 4ecd6a6ea0652ee183e1f8ae7a5a637a299dbeba..82057a62d99ce2c12f1fc691754d64961808599a 100644
--- a/ppapi/proxy/ppp_instance_private_proxy.cc
+++ b/ppapi/proxy/ppp_instance_private_proxy.cc
@@ -30,16 +30,19 @@ static const PPP_Instance_Private instance_private_interface = {
&GetInstanceObject
};
-InterfaceProxy* CreateInstancePrivateProxy(Dispatcher* dispatcher,
- const void* target_interface) {
- return new PPP_Instance_Private_Proxy(dispatcher, target_interface);
+InterfaceProxy* CreateInstancePrivateProxy(Dispatcher* dispatcher) {
+ return new PPP_Instance_Private_Proxy(dispatcher);
}
} // namespace
-PPP_Instance_Private_Proxy::PPP_Instance_Private_Proxy(
- Dispatcher* dispatcher, const void* target_interface)
- : InterfaceProxy(dispatcher, target_interface) {
+PPP_Instance_Private_Proxy::PPP_Instance_Private_Proxy(Dispatcher* dispatcher)
+ : InterfaceProxy(dispatcher),
+ ppp_instance_private_impl_(NULL) {
+ if (dispatcher->IsPlugin()) {
+ ppp_instance_private_impl_ = static_cast<const PPP_Instance_Private*>(
+ dispatcher->local_get_interface()(PPP_INSTANCE_PRIVATE_INTERFACE));
+ }
}
PPP_Instance_Private_Proxy::~PPP_Instance_Private_Proxy() {
@@ -71,7 +74,7 @@ void PPP_Instance_Private_Proxy::OnMsgGetInstanceObject(
PP_Instance instance,
SerializedVarReturnValue result) {
result.Return(dispatcher(),
- ppp_instance_private_target()->GetInstanceObject(instance));
+ ppp_instance_private_impl_->GetInstanceObject(instance));
}
} // namespace proxy

Powered by Google App Engine
This is Rietveld 408576698