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 #include "ppapi/proxy/ppb_font_proxy.h" | 5 #include "ppapi/proxy/ppb_font_proxy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "ppapi/c/dev/ppb_font_dev.h" | 9 #include "ppapi/c/dev/ppb_font_dev.h" |
10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 font_forwarding_.reset(result); | 111 font_forwarding_.reset(result); |
112 } | 112 } |
113 | 113 |
114 Font::~Font() { | 114 Font::~Font() { |
115 } | 115 } |
116 | 116 |
117 ppapi::thunk::PPB_Font_API* Font::AsPPB_Font_API() { | 117 ppapi::thunk::PPB_Font_API* Font::AsPPB_Font_API() { |
118 return this; | 118 return this; |
119 } | 119 } |
120 | 120 |
121 Font* Font::AsFont() { | |
122 return this; | |
123 } | |
124 | |
125 PP_Bool Font::Describe(PP_FontDescription_Dev* description, | 121 PP_Bool Font::Describe(PP_FontDescription_Dev* description, |
126 PP_FontMetrics_Dev* metrics) { | 122 PP_FontMetrics_Dev* metrics) { |
127 TRACE_EVENT0("ppapi proxy", "Font::Describe"); | 123 TRACE_EVENT0("ppapi proxy", "Font::Describe"); |
128 std::string face; | 124 std::string face; |
129 PP_Bool result = PP_FALSE; | 125 PP_Bool result = PP_FALSE; |
130 RunOnWebKitThread(base::Bind(&WebKitForwarding::Font::Describe, | 126 RunOnWebKitThread(base::Bind(&WebKitForwarding::Font::Describe, |
131 base::Unretained(font_forwarding_.get()), | 127 base::Unretained(font_forwarding_.get()), |
132 &webkit_event_, description, &face, metrics, | 128 &webkit_event_, description, &face, metrics, |
133 &result)); | 129 &result)); |
134 | 130 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 return result; | 214 return result; |
219 } | 215 } |
220 | 216 |
221 void Font::RunOnWebKitThread(const base::Closure& task) { | 217 void Font::RunOnWebKitThread(const base::Closure& task) { |
222 GetDispatcher()->PostToWebKitThread(FROM_HERE, task); | 218 GetDispatcher()->PostToWebKitThread(FROM_HERE, task); |
223 webkit_event_.Wait(); | 219 webkit_event_.Wait(); |
224 } | 220 } |
225 | 221 |
226 } // namespace proxy | 222 } // namespace proxy |
227 } // namespace pp | 223 } // namespace pp |
OLD | NEW |