From c9be98ebf8f22fef9d9fc71f625aae5d73b0cd0c Mon Sep 17 00:00:00 2001 From: "raymes@chromium.org" Date: Tue, 26 Mar 2013 22:15:51 +0000 Subject: Change PPB_PDF to use PP_BrowserFont_Trusted_Description instead of PP_FontDescription_Dev. This also changes the ppb_pdf_thunk (which is only used for the out of process case) to call directly into PPB_Flash_Font_File for font-related functions. BUG= Review URL: https://codereview.chromium.org/12893016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190777 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/thunk/ppb_pdf_thunk.cc | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'ppapi/thunk') diff --git a/ppapi/thunk/ppb_pdf_thunk.cc b/ppapi/thunk/ppb_pdf_thunk.cc index 4216a2b..1d018dc 100644 --- a/ppapi/thunk/ppb_pdf_thunk.cc +++ b/ppapi/thunk/ppb_pdf_thunk.cc @@ -6,7 +6,9 @@ #include "ppapi/c/pp_errors.h" #include "ppapi/c/private/ppb_pdf.h" #include "ppapi/thunk/enter.h" +#include "ppapi/thunk/ppb_flash_font_file_api.h" #include "ppapi/thunk/ppb_pdf_api.h" +#include "ppapi/thunk/resource_creation_api.h" #include "ppapi/thunk/thunk.h" namespace ppapi { @@ -31,20 +33,28 @@ PP_Resource GetResourceImage(PP_Instance instance, PP_Resource GetFontFileWithFallback( PP_Instance instance, - const PP_FontDescription_Dev* description, + const PP_BrowserFont_Trusted_Description* description, PP_PrivateFontCharset charset) { - // Not implemented out-of-process. - NOTIMPLEMENTED(); - return 0; + // TODO(raymes): Eventually we should replace the use of this function with + // either PPB_Flash_Font_File or PPB_TrueType_Font directly in the PDF code. + // For now just call into PPB_Flash_Font_File which has the exact same API. + EnterResourceCreation enter(instance); + if (enter.failed()) + return 0; + return enter.functions()->CreateFlashFontFile(instance, description, charset); } bool GetFontTableForPrivateFontFile(PP_Resource font_file, uint32_t table, void* output, uint32_t* output_length) { - // Not implemented out-of-process. - NOTIMPLEMENTED(); - return false; + // TODO(raymes): Eventually we should replace the use of this function with + // either PPB_Flash_Font_File or PPB_TrueType_Font directly in the PDF code. + // For now just call into PPB_Flash_Font_File which has the exact same API. + EnterResource enter(font_file, true); + if (enter.failed()) + return PP_FALSE; + return PP_ToBool(enter.object()->GetFontTable(table, output, output_length)); } void SearchString(PP_Instance instance, -- cgit v1.1