Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: ppapi/proxy/ppb_font_proxy.h

Issue 7629017: Add a unified resource tracker shared between the proxy and the impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Assertion fixed Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/basictypes.h"
9 #include "base/callback.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/scoped_ptr.h"
dmichael (off chromium) 2011/08/17 16:28:07 These 3 look a little out-of-place here. Are these
9 #include "base/synchronization/waitable_event.h" 12 #include "base/synchronization/waitable_event.h"
10 #include "ppapi/proxy/interface_proxy.h" 13 #include "ppapi/proxy/interface_proxy.h"
11 #include "ppapi/proxy/plugin_resource.h" 14 #include "ppapi/shared_impl/function_group_base.h"
12 #include "ppapi/shared_impl/host_resource.h" 15 #include "ppapi/shared_impl/host_resource.h"
16 #include "ppapi/shared_impl/resource.h"
13 #include "ppapi/shared_impl/webkit_forwarding.h" 17 #include "ppapi/shared_impl/webkit_forwarding.h"
14 #include "ppapi/thunk/ppb_font_api.h" 18 #include "ppapi/thunk/ppb_font_api.h"
15 19
16 struct PPB_Font_Dev; 20 struct PPB_Font_Dev;
17 21
18 namespace pp { 22 namespace pp {
19 namespace proxy { 23 namespace proxy {
20 24
21 class SerializedVarReturnValue; 25 class SerializedVarReturnValue;
22 26
(...skipping 12 matching lines...) Expand all
35 // PPB_Font_FunctionAPI implementation. 39 // PPB_Font_FunctionAPI implementation.
36 virtual PP_Var GetFontFamilies(PP_Instance instance) OVERRIDE; 40 virtual PP_Var GetFontFamilies(PP_Instance instance) OVERRIDE;
37 41
38 // InterfaceProxy implementation. 42 // InterfaceProxy implementation.
39 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 43 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
40 44
41 private: 45 private:
42 DISALLOW_COPY_AND_ASSIGN(PPB_Font_Proxy); 46 DISALLOW_COPY_AND_ASSIGN(PPB_Font_Proxy);
43 }; 47 };
44 48
45 class Font : public PluginResource, 49 class Font : public ppapi::Resource,
46 public ppapi::thunk::PPB_Font_API { 50 public ppapi::thunk::PPB_Font_API {
47 public: 51 public:
48 // Note that there isn't a "real" resource in the renderer backing a font, 52 // 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 53 // 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 54 // resource should be 0. However, various code assumes the instance in the
51 // host resource is valid (this is how resources are associated with 55 // host resource is valid (this is how resources are associated with
52 // instances), so that should be set. 56 // instances), so that should be set.
53 Font(const ppapi::HostResource& resource, const PP_FontDescription_Dev& desc); 57 Font(const ppapi::HostResource& resource, const PP_FontDescription_Dev& desc);
54 virtual ~Font(); 58 virtual ~Font();
55 59
56 // ResourceObjectBase. 60 // Resource.
57 virtual ppapi::thunk::PPB_Font_API* AsPPB_Font_API() OVERRIDE; 61 virtual ppapi::thunk::PPB_Font_API* AsPPB_Font_API() OVERRIDE;
58 62
59 // PPB_Font_API implementation. 63 // PPB_Font_API implementation.
60 virtual PP_Bool Describe(PP_FontDescription_Dev* description, 64 virtual PP_Bool Describe(PP_FontDescription_Dev* description,
61 PP_FontMetrics_Dev* metrics) OVERRIDE; 65 PP_FontMetrics_Dev* metrics) OVERRIDE;
62 virtual PP_Bool DrawTextAt(PP_Resource image_data, 66 virtual PP_Bool DrawTextAt(PP_Resource image_data,
63 const PP_TextRun_Dev* text, 67 const PP_TextRun_Dev* text,
64 const PP_Point* position, 68 const PP_Point* position,
65 uint32_t color, 69 uint32_t color,
66 const PP_Rect* clip, 70 const PP_Rect* clip,
(...skipping 20 matching lines...) Expand all
87 // destruction). 91 // destruction).
88 ppapi::WebKitForwarding::Font* font_forwarding_; 92 ppapi::WebKitForwarding::Font* font_forwarding_;
89 93
90 DISALLOW_COPY_AND_ASSIGN(Font); 94 DISALLOW_COPY_AND_ASSIGN(Font);
91 }; 95 };
92 96
93 } // namespace proxy 97 } // namespace proxy
94 } // namespace pp 98 } // namespace pp
95 99
96 #endif // PPAPI_PROXY_PPB_FONT_PROXY_H_ 100 #endif // PPAPI_PROXY_PPB_FONT_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698