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

Unified Diff: ppapi/proxy/ppb_pdf_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_pdf_proxy.h ('k') | ppapi/proxy/ppb_surface_3d_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_pdf_proxy.cc
===================================================================
--- ppapi/proxy/ppb_pdf_proxy.cc (revision 100758)
+++ ppapi/proxy/ppb_pdf_proxy.cc (working copy)
@@ -118,16 +118,19 @@
&GetFontTableForPrivateFontFile,
};
-InterfaceProxy* CreatePDFProxy(Dispatcher* dispatcher,
- const void* target_interface) {
- return new PPB_PDF_Proxy(dispatcher, target_interface);
+InterfaceProxy* CreatePDFProxy(Dispatcher* dispatcher) {
+ return new PPB_PDF_Proxy(dispatcher);
}
} // namespace
-PPB_PDF_Proxy::PPB_PDF_Proxy(Dispatcher* dispatcher,
- const void* target_interface)
- : InterfaceProxy(dispatcher, target_interface) {
+PPB_PDF_Proxy::PPB_PDF_Proxy(Dispatcher* dispatcher)
+ : InterfaceProxy(dispatcher),
+ ppb_pdf_impl_(NULL) {
+ if (!dispatcher->IsPlugin()) {
+ ppb_pdf_impl_ = static_cast<const PPB_PDF*>(
+ dispatcher->local_get_interface()(PPB_PDF_INTERFACE));
+ }
}
PPB_PDF_Proxy::~PPB_PDF_Proxy() {
@@ -166,7 +169,7 @@
PP_FontDescription_Dev desc;
in_desc.SetToPPFontDescription(dispatcher(), &desc, false);
result->SetHostResource(instance,
- ppb_pdf_target()->GetFontFileWithFallback(
+ ppb_pdf_impl_->GetFontFileWithFallback(
instance, &desc, static_cast<PP_PrivateFontCharset>(charset)));
}
@@ -177,12 +180,12 @@
// TODO(brettw): It would be nice not to copy here. At least on Linux,
// we can map the font file into shared memory and read it that way.
uint32_t table_length = 0;
- if (!ppb_pdf_target()->GetFontTableForPrivateFontFile(
+ if (!ppb_pdf_impl_->GetFontTableForPrivateFontFile(
font_file.host_resource(), table, NULL, &table_length))
return;
result->resize(table_length);
- ppb_pdf_target()->GetFontTableForPrivateFontFile(font_file.host_resource(),
+ ppb_pdf_impl_->GetFontTableForPrivateFontFile(font_file.host_resource(),
table, const_cast<char*>(result->c_str()), &table_length);
}
« no previous file with comments | « ppapi/proxy/ppb_pdf_proxy.h ('k') | ppapi/proxy/ppb_surface_3d_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698