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 22 matching lines...) Expand all Loading... |
33 StringVar* str = StringVar::FromPPVar(run->text); | 33 StringVar* str = StringVar::FromPPVar(run->text); |
34 if (!str) | 34 if (!str) |
35 return false; | 35 return false; |
36 | 36 |
37 output->text = str->value(); | 37 output->text = str->value(); |
38 output->rtl = PP_ToBool(run->rtl); | 38 output->rtl = PP_ToBool(run->rtl); |
39 output->override_direction = PP_ToBool(run->override_direction); | 39 output->override_direction = PP_ToBool(run->override_direction); |
40 return true; | 40 return true; |
41 } | 41 } |
42 | 42 |
43 InterfaceProxy* CreateFontProxy(Dispatcher* dispatcher, | |
44 const void* target_interface) { | |
45 return new PPB_Font_Proxy(dispatcher, target_interface); | |
46 } | |
47 | |
48 } // namespace | 43 } // namespace |
49 | 44 |
50 PPB_Font_Proxy::PPB_Font_Proxy(Dispatcher* dispatcher, | 45 PPB_Font_Proxy::PPB_Font_Proxy(Dispatcher* dispatcher) |
51 const void* target_interface) | 46 : InterfaceProxy(dispatcher) { |
52 : InterfaceProxy(dispatcher, target_interface) { | |
53 } | 47 } |
54 | 48 |
55 PPB_Font_Proxy::~PPB_Font_Proxy() { | 49 PPB_Font_Proxy::~PPB_Font_Proxy() { |
56 } | 50 } |
57 | 51 |
58 // static | |
59 const InterfaceProxy::Info* PPB_Font_Proxy::GetInfo() { | |
60 static const Info info = { | |
61 thunk::GetPPB_Font_Thunk(), | |
62 PPB_FONT_DEV_INTERFACE, | |
63 INTERFACE_ID_PPB_FONT, | |
64 false, | |
65 &CreateFontProxy, | |
66 }; | |
67 return &info; | |
68 } | |
69 | |
70 PPB_Font_FunctionAPI* PPB_Font_Proxy::AsPPB_Font_FunctionAPI() { | 52 PPB_Font_FunctionAPI* PPB_Font_Proxy::AsPPB_Font_FunctionAPI() { |
71 return this; | 53 return this; |
72 } | 54 } |
73 | 55 |
74 PP_Var PPB_Font_Proxy::GetFontFamilies(PP_Instance instance) { | 56 PP_Var PPB_Font_Proxy::GetFontFamilies(PP_Instance instance) { |
75 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); | 57 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
76 if (!dispatcher) | 58 if (!dispatcher) |
77 return PP_MakeUndefined(); | 59 return PP_MakeUndefined(); |
78 | 60 |
79 // Assume the font families don't change, so we can cache the result globally. | 61 // Assume the font families don't change, so we can cache the result globally. |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 webkit_event_.Wait(); | 208 webkit_event_.Wait(); |
227 } | 209 } |
228 | 210 |
229 // static | 211 // static |
230 void Font::DeleteFontForwarding(WebKitForwarding::Font* font_forwarding) { | 212 void Font::DeleteFontForwarding(WebKitForwarding::Font* font_forwarding) { |
231 delete font_forwarding; | 213 delete font_forwarding; |
232 } | 214 } |
233 | 215 |
234 } // namespace proxy | 216 } // namespace proxy |
235 } // namespace ppapi | 217 } // namespace ppapi |
OLD | NEW |