summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppb_pdf_proxy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi/proxy/ppb_pdf_proxy.cc')
-rw-r--r--ppapi/proxy/ppb_pdf_proxy.cc21
1 files changed, 9 insertions, 12 deletions
diff --git a/ppapi/proxy/ppb_pdf_proxy.cc b/ppapi/proxy/ppb_pdf_proxy.cc
index 874e487..dcf3358 100644
--- a/ppapi/proxy/ppb_pdf_proxy.cc
+++ b/ppapi/proxy/ppb_pdf_proxy.cc
@@ -118,19 +118,16 @@ const PPB_PDF pdf_interface = {
&GetFontTableForPrivateFontFile,
};
-InterfaceProxy* CreatePDFProxy(Dispatcher* dispatcher) {
- return new PPB_PDF_Proxy(dispatcher);
+InterfaceProxy* CreatePDFProxy(Dispatcher* dispatcher,
+ const void* target_interface) {
+ return new PPB_PDF_Proxy(dispatcher, target_interface);
}
} // namespace
-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(Dispatcher* dispatcher,
+ const void* target_interface)
+ : InterfaceProxy(dispatcher, target_interface) {
}
PPB_PDF_Proxy::~PPB_PDF_Proxy() {
@@ -169,7 +166,7 @@ void PPB_PDF_Proxy::OnMsgGetFontFileWithFallback(
PP_FontDescription_Dev desc;
in_desc.SetToPPFontDescription(dispatcher(), &desc, false);
result->SetHostResource(instance,
- ppb_pdf_impl_->GetFontFileWithFallback(
+ ppb_pdf_target()->GetFontFileWithFallback(
instance, &desc, static_cast<PP_PrivateFontCharset>(charset)));
}
@@ -180,12 +177,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_impl_->GetFontTableForPrivateFontFile(
+ if (!ppb_pdf_target()->GetFontTableForPrivateFontFile(
font_file.host_resource(), table, NULL, &table_length))
return;
result->resize(table_length);
- ppb_pdf_impl_->GetFontTableForPrivateFontFile(font_file.host_resource(),
+ ppb_pdf_target()->GetFontTableForPrivateFontFile(font_file.host_resource(),
table, const_cast<char*>(result->c_str()), &table_length);
}