OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef PPAPI_PROXY_TRUETYPE_FONT_SINGLETON_RESOURCE_H_ | 5 #ifndef PPAPI_PROXY_TRUETYPE_FONT_SINGLETON_RESOURCE_H_ |
6 #define PPAPI_PROXY_TRUETYPE_FONT_SINGLETON_RESOURCE_H_ | 6 #define PPAPI_PROXY_TRUETYPE_FONT_SINGLETON_RESOURCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ppapi/proxy/connection.h" | 11 #include "ppapi/proxy/connection.h" |
12 #include "ppapi/proxy/plugin_resource.h" | 12 #include "ppapi/proxy/plugin_resource.h" |
13 #include "ppapi/thunk/ppb_truetype_font_singleton_api.h" | 13 #include "ppapi/thunk/ppb_truetype_font_singleton_api.h" |
14 | 14 |
15 namespace ppapi { | 15 namespace ppapi { |
16 | 16 |
17 class TrackedCallback; | 17 class TrackedCallback; |
18 | 18 |
19 namespace proxy { | 19 namespace proxy { |
20 | 20 |
21 struct SerializedTrueTypeFontDesc; | 21 struct SerializedTrueTypeFontDesc; |
22 | 22 |
23 // This handles the singleton calls (that don't take a PP_Resource parameter) | 23 // This handles the singleton calls (that don't take a PP_Resource parameter) |
24 // on the TrueType font interface. | 24 // on the TrueType font interface. |
25 class TrueTypeFontSingletonResource | 25 class TrueTypeFontSingletonResource |
26 : public PluginResource, | 26 : public PluginResource, |
27 public thunk::PPB_TrueTypeFont_Singleton_API { | 27 public thunk::PPB_TrueTypeFont_Singleton_API { |
28 public: | 28 public: |
29 TrueTypeFontSingletonResource(Connection connection, PP_Instance instance); | 29 TrueTypeFontSingletonResource(Connection connection, PP_Instance instance); |
30 virtual ~TrueTypeFontSingletonResource(); | 30 ~TrueTypeFontSingletonResource() override; |
31 | 31 |
32 // Resource override. | 32 // Resource override. |
33 virtual thunk::PPB_TrueTypeFont_Singleton_API* | 33 thunk::PPB_TrueTypeFont_Singleton_API* AsPPB_TrueTypeFont_Singleton_API() |
34 AsPPB_TrueTypeFont_Singleton_API() override; | 34 override; |
35 | 35 |
36 // thunk::PPB_TrueTypeFont_Singleton_API implementation. | 36 // thunk::PPB_TrueTypeFont_Singleton_API implementation. |
37 virtual int32_t GetFontFamilies( | 37 int32_t GetFontFamilies( |
38 PP_Instance instance, | 38 PP_Instance instance, |
39 const PP_ArrayOutput& output, | 39 const PP_ArrayOutput& output, |
40 const scoped_refptr<TrackedCallback>& callback) override; | 40 const scoped_refptr<TrackedCallback>& callback) override; |
41 virtual int32_t GetFontsInFamily( | 41 int32_t GetFontsInFamily( |
42 PP_Instance instance, | 42 PP_Instance instance, |
43 PP_Var family, | 43 PP_Var family, |
44 const PP_ArrayOutput& output, | 44 const PP_ArrayOutput& output, |
45 const scoped_refptr<TrackedCallback>& callback) override; | 45 const scoped_refptr<TrackedCallback>& callback) override; |
46 | 46 |
47 private: | 47 private: |
48 void OnPluginMsgGetFontFamiliesComplete( | 48 void OnPluginMsgGetFontFamiliesComplete( |
49 scoped_refptr<TrackedCallback> callback, | 49 scoped_refptr<TrackedCallback> callback, |
50 PP_ArrayOutput array_output, | 50 PP_ArrayOutput array_output, |
51 const ResourceMessageReplyParams& params, | 51 const ResourceMessageReplyParams& params, |
52 const std::vector<std::string>& data); | 52 const std::vector<std::string>& data); |
53 void OnPluginMsgGetFontsInFamilyComplete( | 53 void OnPluginMsgGetFontsInFamilyComplete( |
54 scoped_refptr<TrackedCallback> callback, | 54 scoped_refptr<TrackedCallback> callback, |
55 PP_ArrayOutput array_output, | 55 PP_ArrayOutput array_output, |
56 const ResourceMessageReplyParams& params, | 56 const ResourceMessageReplyParams& params, |
57 const std::vector<SerializedTrueTypeFontDesc>& fonts); | 57 const std::vector<SerializedTrueTypeFontDesc>& fonts); |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(TrueTypeFontSingletonResource); | 59 DISALLOW_COPY_AND_ASSIGN(TrueTypeFontSingletonResource); |
60 }; | 60 }; |
61 | 61 |
62 } // namespace proxy | 62 } // namespace proxy |
63 } // namespace ppapi | 63 } // namespace ppapi |
64 | 64 |
65 #endif // PPAPI_PROXY_TRUETYPE_FONT_SINGLETON_RESOURCE_H_ | 65 #endif // PPAPI_PROXY_TRUETYPE_FONT_SINGLETON_RESOURCE_H_ |
OLD | NEW |