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/basictypes.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "ppapi/proxy/host_resource.h" | 10 #include "ppapi/proxy/host_resource.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 uint32_t color, | 68 uint32_t color, |
69 const PP_Rect* clip, | 69 const PP_Rect* clip, |
70 PP_Bool image_data_is_opaque) OVERRIDE; | 70 PP_Bool image_data_is_opaque) OVERRIDE; |
71 virtual int32_t MeasureText(const PP_TextRun_Dev* text) OVERRIDE; | 71 virtual int32_t MeasureText(const PP_TextRun_Dev* text) OVERRIDE; |
72 virtual uint32_t CharacterOffsetForPixel(const PP_TextRun_Dev* text, | 72 virtual uint32_t CharacterOffsetForPixel(const PP_TextRun_Dev* text, |
73 int32_t pixel_position) OVERRIDE; | 73 int32_t pixel_position) OVERRIDE; |
74 virtual int32_t PixelOffsetForCharacter(const PP_TextRun_Dev* text, | 74 virtual int32_t PixelOffsetForCharacter(const PP_TextRun_Dev* text, |
75 uint32_t char_offset) OVERRIDE; | 75 uint32_t char_offset) OVERRIDE; |
76 | 76 |
77 private: | 77 private: |
78 // Posts the given closure to the WebKit thread and waits on the | 78 // Posts the given closure to the WebKit thread. |
79 // webkit_event_ for the task to continue. | 79 // If |blocking| is true, the method waits on |webkit_event_| for the task to |
80 void RunOnWebKitThread(const base::Closure& task); | 80 // continue. |
| 81 void RunOnWebKitThread(bool blocking, const base::Closure& task); |
| 82 |
| 83 static void DeleteFontForwarding( |
| 84 ppapi::WebKitForwarding::Font* font_forwarding); |
81 | 85 |
82 base::WaitableEvent webkit_event_; | 86 base::WaitableEvent webkit_event_; |
83 | 87 |
84 scoped_ptr<ppapi::WebKitForwarding::Font> font_forwarding_; | 88 // This class owns |font_forwarding_|. |
| 89 // |font_forwarding_| should always be used on the WebKit thread (including |
| 90 // destruction). |
| 91 ppapi::WebKitForwarding::Font* font_forwarding_; |
85 | 92 |
86 DISALLOW_COPY_AND_ASSIGN(Font); | 93 DISALLOW_COPY_AND_ASSIGN(Font); |
87 }; | 94 }; |
88 | 95 |
89 } // namespace proxy | 96 } // namespace proxy |
90 } // namespace pp | 97 } // namespace pp |
91 | 98 |
92 #endif // PPAPI_PROXY_PPB_FONT_PROXY_H_ | 99 #endif // PPAPI_PROXY_PPB_FONT_PROXY_H_ |
OLD | NEW |