OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/thunk/thunk.h" | 5 #include "ppapi/thunk/thunk.h" |
6 #include "ppapi/thunk/enter.h" | 6 #include "ppapi/thunk/enter.h" |
| 7 #include "ppapi/thunk/ppb_browser_font_singleton_api.h" |
7 #include "ppapi/thunk/ppb_browser_font_trusted_api.h" | 8 #include "ppapi/thunk/ppb_browser_font_trusted_api.h" |
8 #include "ppapi/thunk/resource_creation_api.h" | 9 #include "ppapi/thunk/resource_creation_api.h" |
9 | 10 |
10 namespace ppapi { | 11 namespace ppapi { |
11 namespace thunk { | 12 namespace thunk { |
12 | 13 |
13 namespace { | 14 namespace { |
14 | 15 |
15 typedef EnterResource<PPB_BrowserFont_Trusted_API> EnterBrowserFont; | 16 typedef EnterResource<PPB_BrowserFont_Trusted_API> EnterBrowserFont; |
16 | 17 |
17 PP_Var GetFontFamilies(PP_Instance instance) { | 18 PP_Var GetFontFamilies(PP_Instance instance) { |
18 EnterInstance enter(instance); | 19 EnterInstanceAPI<PPB_BrowserFont_Singleton_API> enter(instance); |
19 if (enter.failed()) | 20 if (enter.failed()) |
20 return PP_MakeUndefined(); | 21 return PP_MakeUndefined(); |
21 return enter.functions()->GetFontFamilies(instance); | 22 return enter.functions()->GetFontFamilies(instance); |
22 } | 23 } |
23 | 24 |
24 PP_Resource Create(PP_Instance instance, | 25 PP_Resource Create(PP_Instance instance, |
25 const PP_BrowserFont_Trusted_Description* description) { | 26 const PP_BrowserFont_Trusted_Description* description) { |
26 EnterResourceCreation enter(instance); | 27 EnterResourceCreation enter(instance); |
27 if (enter.failed()) | 28 if (enter.failed()) |
28 return 0; | 29 return 0; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 }; | 96 }; |
96 | 97 |
97 } // namespace | 98 } // namespace |
98 | 99 |
99 const PPB_BrowserFont_Trusted_1_0* GetPPB_BrowserFont_Trusted_1_0_Thunk() { | 100 const PPB_BrowserFont_Trusted_1_0* GetPPB_BrowserFont_Trusted_1_0_Thunk() { |
100 return &g_ppb_browser_font_trusted_thunk; | 101 return &g_ppb_browser_font_trusted_thunk; |
101 } | 102 } |
102 | 103 |
103 } // namespace thunk | 104 } // namespace thunk |
104 } // namespace ppapi | 105 } // namespace ppapi |
OLD | NEW |