summaryrefslogtreecommitdiffstats
path: root/ppapi/thunk
diff options
context:
space:
mode:
authorraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-26 22:15:51 +0000
committerraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-26 22:15:51 +0000
commitc9be98ebf8f22fef9d9fc71f625aae5d73b0cd0c (patch)
tree02a4bcb19ce4e7145cd4876eae3b968266500c57 /ppapi/thunk
parent7dcce17ae227d749d7684784fd212789a686b28a (diff)
downloadchromium_src-c9be98ebf8f22fef9d9fc71f625aae5d73b0cd0c.zip
chromium_src-c9be98ebf8f22fef9d9fc71f625aae5d73b0cd0c.tar.gz
chromium_src-c9be98ebf8f22fef9d9fc71f625aae5d73b0cd0c.tar.bz2
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
Diffstat (limited to 'ppapi/thunk')
-rw-r--r--ppapi/thunk/ppb_pdf_thunk.cc24
1 files changed, 17 insertions, 7 deletions
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<PPB_Flash_FontFile_API> 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,