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

Unified Diff: ppapi/proxy/ppb_url_util_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/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
===================================================================
--- ppapi/proxy/ppb_url_util_proxy.cc (revision 100758)
+++ ppapi/proxy/ppb_url_util_proxy.cc (working copy)
@@ -129,16 +129,19 @@
&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 @@
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