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

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

Issue 7629006: Make sure ppapi::WebKitForwarding::Font is deleted on the WebKit thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | ppapi/proxy/ppb_font_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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_
OLDNEW
« no previous file with comments | « no previous file | ppapi/proxy/ppb_font_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698