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

Unified Diff: ppapi/proxy/ppb_pdf_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_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
diff --git a/ppapi/proxy/ppb_pdf_proxy.cc b/ppapi/proxy/ppb_pdf_proxy.cc
index dcf33583a072ae377e75eedab8a7cebbd3bfcf22..874e4870fa0a2a78c16e175a50a96968f5cff237 100644
--- a/ppapi/proxy/ppb_pdf_proxy.cc
+++ b/ppapi/proxy/ppb_pdf_proxy.cc
@@ -118,16 +118,19 @@ const PPB_PDF pdf_interface = {
&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 @@ void PPB_PDF_Proxy::OnMsgGetFontFileWithFallback(
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 @@ void PPB_PDF_Proxy::OnMsgGetFontTableForPrivateFontFile(
// 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