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

Unified Diff: ppapi/proxy/ppb_url_util_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/ppb_url_util_proxy.h ('k') | ppapi/proxy/ppb_var_deprecated_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_url_util_proxy.cc
diff --git a/ppapi/proxy/ppb_url_util_proxy.cc b/ppapi/proxy/ppb_url_util_proxy.cc
index a202038d40b2ea9259448eda6a5a349bd6cb1129..b3cea08dff944952eabf53f7c2f141cdbd183df4 100644
--- a/ppapi/proxy/ppb_url_util_proxy.cc
+++ b/ppapi/proxy/ppb_url_util_proxy.cc
@@ -129,16 +129,19 @@ const PPB_URLUtil_Dev url_util_interface = {
&GetPluginInstanceURL
};
-InterfaceProxy* CreateURLUtilProxy(Dispatcher* dispatcher,
- const void* target_interface) {
- return new PPB_URLUtil_Proxy(dispatcher, target_interface);
+InterfaceProxy* CreateURLUtilProxy(Dispatcher* dispatcher) {
+ return new PPB_URLUtil_Proxy(dispatcher);
}
} // namespace
-PPB_URLUtil_Proxy::PPB_URLUtil_Proxy(Dispatcher* dispatcher,
- const void* target_interface)
- : InterfaceProxy(dispatcher, target_interface) {
+PPB_URLUtil_Proxy::PPB_URLUtil_Proxy(Dispatcher* dispatcher)
+ : InterfaceProxy(dispatcher),
+ ppb_url_util_impl_(NULL) {
+ if (!dispatcher->IsPlugin()) {
+ ppb_url_util_impl_ = static_cast<const PPB_URLUtil_Dev*>(
+ dispatcher->local_get_interface()(PPB_URLUTIL_DEV_INTERFACE));
+ }
}
PPB_URLUtil_Proxy::~PPB_URLUtil_Proxy() {
@@ -179,34 +182,34 @@ void PPB_URLUtil_Proxy::OnMsgResolveRelativeToDocument(
SerializedVarReceiveInput relative,
SerializedVarReturnValue result) {
result.Return(dispatcher(),
- ppb_url_util_target()->ResolveRelativeToDocument(
+ ppb_url_util_impl_->ResolveRelativeToDocument(
instance, relative.Get(dispatcher()), NULL));
}
void PPB_URLUtil_Proxy::OnMsgDocumentCanRequest(PP_Instance instance,
SerializedVarReceiveInput url,
PP_Bool* result) {
- *result = ppb_url_util_target()->DocumentCanRequest(instance,
- url.Get(dispatcher()));
+ *result = ppb_url_util_impl_->DocumentCanRequest(instance,
+ url.Get(dispatcher()));
}
void PPB_URLUtil_Proxy::OnMsgDocumentCanAccessDocument(PP_Instance active,
PP_Instance target,
PP_Bool* result) {
- *result = ppb_url_util_target()->DocumentCanAccessDocument(
+ *result = ppb_url_util_impl_->DocumentCanAccessDocument(
active, target);
}
void PPB_URLUtil_Proxy::OnMsgGetDocumentURL(PP_Instance instance,
SerializedVarReturnValue result) {
result.Return(dispatcher(),
- ppb_url_util_target()->GetDocumentURL(instance, NULL));
+ ppb_url_util_impl_->GetDocumentURL(instance, NULL));
}
void PPB_URLUtil_Proxy::OnMsgGetPluginInstanceURL(
PP_Instance instance, SerializedVarReturnValue result) {
result.Return(dispatcher(),
- ppb_url_util_target()->GetPluginInstanceURL(instance, NULL));
+ ppb_url_util_impl_->GetPluginInstanceURL(instance, NULL));
}
} // namespace proxy
« no previous file with comments | « ppapi/proxy/ppb_url_util_proxy.h ('k') | ppapi/proxy/ppb_var_deprecated_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698