OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PPB_FONT_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_FONT_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_FONT_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_FONT_PROXY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | |
dmichael (off chromium)
2011/08/17 21:35:51
So callback and ref_counted are necessary? I don't
| |
9 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
10 #include "ppapi/proxy/interface_proxy.h" | 11 #include "ppapi/proxy/interface_proxy.h" |
11 #include "ppapi/proxy/plugin_resource.h" | 12 #include "ppapi/shared_impl/function_group_base.h" |
12 #include "ppapi/shared_impl/host_resource.h" | 13 #include "ppapi/shared_impl/host_resource.h" |
14 #include "ppapi/shared_impl/resource.h" | |
13 #include "ppapi/shared_impl/webkit_forwarding.h" | 15 #include "ppapi/shared_impl/webkit_forwarding.h" |
14 #include "ppapi/thunk/ppb_font_api.h" | 16 #include "ppapi/thunk/ppb_font_api.h" |
15 | 17 |
16 struct PPB_Font_Dev; | 18 struct PPB_Font_Dev; |
17 | 19 |
18 namespace pp { | 20 namespace pp { |
19 namespace proxy { | 21 namespace proxy { |
20 | 22 |
21 class SerializedVarReturnValue; | 23 class SerializedVarReturnValue; |
22 | 24 |
(...skipping 12 matching lines...) Expand all Loading... | |
35 // PPB_Font_FunctionAPI implementation. | 37 // PPB_Font_FunctionAPI implementation. |
36 virtual PP_Var GetFontFamilies(PP_Instance instance) OVERRIDE; | 38 virtual PP_Var GetFontFamilies(PP_Instance instance) OVERRIDE; |
37 | 39 |
38 // InterfaceProxy implementation. | 40 // InterfaceProxy implementation. |
39 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 41 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
40 | 42 |
41 private: | 43 private: |
42 DISALLOW_COPY_AND_ASSIGN(PPB_Font_Proxy); | 44 DISALLOW_COPY_AND_ASSIGN(PPB_Font_Proxy); |
43 }; | 45 }; |
44 | 46 |
45 class Font : public PluginResource, | 47 class Font : public ppapi::Resource, |
46 public ppapi::thunk::PPB_Font_API { | 48 public ppapi::thunk::PPB_Font_API { |
47 public: | 49 public: |
48 // Note that there isn't a "real" resource in the renderer backing a font, | 50 // Note that there isn't a "real" resource in the renderer backing a font, |
49 // it lives entirely in the plugin process. So the resource ID in the host | 51 // it lives entirely in the plugin process. So the resource ID in the host |
50 // resource should be 0. However, various code assumes the instance in the | 52 // resource should be 0. However, various code assumes the instance in the |
51 // host resource is valid (this is how resources are associated with | 53 // host resource is valid (this is how resources are associated with |
52 // instances), so that should be set. | 54 // instances), so that should be set. |
53 Font(const ppapi::HostResource& resource, const PP_FontDescription_Dev& desc); | 55 Font(const ppapi::HostResource& resource, const PP_FontDescription_Dev& desc); |
54 virtual ~Font(); | 56 virtual ~Font(); |
55 | 57 |
56 // ResourceObjectBase. | 58 // Resource. |
57 virtual ppapi::thunk::PPB_Font_API* AsPPB_Font_API() OVERRIDE; | 59 virtual ppapi::thunk::PPB_Font_API* AsPPB_Font_API() OVERRIDE; |
58 | 60 |
59 // PPB_Font_API implementation. | 61 // PPB_Font_API implementation. |
60 virtual PP_Bool Describe(PP_FontDescription_Dev* description, | 62 virtual PP_Bool Describe(PP_FontDescription_Dev* description, |
61 PP_FontMetrics_Dev* metrics) OVERRIDE; | 63 PP_FontMetrics_Dev* metrics) OVERRIDE; |
62 virtual PP_Bool DrawTextAt(PP_Resource image_data, | 64 virtual PP_Bool DrawTextAt(PP_Resource image_data, |
63 const PP_TextRun_Dev* text, | 65 const PP_TextRun_Dev* text, |
64 const PP_Point* position, | 66 const PP_Point* position, |
65 uint32_t color, | 67 uint32_t color, |
66 const PP_Rect* clip, | 68 const PP_Rect* clip, |
(...skipping 20 matching lines...) Expand all Loading... | |
87 // destruction). | 89 // destruction). |
88 ppapi::WebKitForwarding::Font* font_forwarding_; | 90 ppapi::WebKitForwarding::Font* font_forwarding_; |
89 | 91 |
90 DISALLOW_COPY_AND_ASSIGN(Font); | 92 DISALLOW_COPY_AND_ASSIGN(Font); |
91 }; | 93 }; |
92 | 94 |
93 } // namespace proxy | 95 } // namespace proxy |
94 } // namespace pp | 96 } // namespace pp |
95 | 97 |
96 #endif // PPAPI_PROXY_PPB_FONT_PROXY_H_ | 98 #endif // PPAPI_PROXY_PPB_FONT_PROXY_H_ |
OLD | NEW |