Revert 233414 "x11: Move XInput2 availability information out of..."
[chromium-blink-merge.git] / ppapi / thunk / ppb_flash_font_file_thunk.cc
blob3a073657a60f873f116ffb6c694a31a4535f9642
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ppapi/c/private/ppb_flash_font_file.h"
6 #include "ppapi/thunk/enter.h"
7 #include "ppapi/thunk/ppb_flash_font_file_api.h"
8 #include "ppapi/thunk/resource_creation_api.h"
9 #include "ppapi/thunk/thunk.h"
11 namespace ppapi {
12 namespace thunk {
14 namespace {
16 PP_Resource Create(PP_Instance instance,
17 const PP_BrowserFont_Trusted_Description* description,
18 PP_PrivateFontCharset charset) {
19 EnterResourceCreation enter(instance);
20 if (enter.failed())
21 return 0;
22 return enter.functions()->CreateFlashFontFile(instance, description, charset);
25 PP_Bool IsFlashFontFile(PP_Resource resource) {
26 EnterResource<PPB_Flash_FontFile_API> enter(resource, false);
27 return PP_FromBool(enter.succeeded());
30 PP_Bool GetFontTable(PP_Resource font_file,
31 uint32_t table,
32 void* output,
33 uint32_t* output_length) {
34 EnterResource<PPB_Flash_FontFile_API> enter(font_file, true);
35 if (enter.failed())
36 return PP_FALSE;
37 return enter.object()->GetFontTable(table, output, output_length);
40 const PPB_Flash_FontFile g_ppb_flash_fontfile_thunk = {
41 &Create,
42 &IsFlashFontFile,
43 &GetFontTable
46 } // namespace
48 const PPB_Flash_FontFile_0_1* GetPPB_Flash_FontFile_0_1_Thunk() {
49 return &g_ppb_flash_fontfile_thunk;
52 } // namespace thunk
53 } // namespace ppapi