| 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" |
| 11 #include "ppapi/proxy/ppapi_messages.h" | 11 #include "ppapi/proxy/ppapi_messages.h" |
| 12 #include "ppapi/proxy/ppb_image_data_proxy.h" | 12 #include "ppapi/proxy/ppb_image_data_proxy.h" |
| 13 #include "ppapi/proxy/serialized_var.h" | 13 #include "ppapi/proxy/serialized_var.h" |
| 14 #include "ppapi/shared_impl/ppapi_preferences.h" | 14 #include "ppapi/shared_impl/ppapi_preferences.h" |
| 15 #include "ppapi/shared_impl/resource_object_base.h" | 15 #include "ppapi/shared_impl/resource_object_base.h" |
| 16 #include "ppapi/shared_impl/var.h" | 16 #include "ppapi/shared_impl/var.h" |
| 17 #include "ppapi/thunk/enter.h" | 17 #include "ppapi/thunk/enter.h" |
| 18 #include "ppapi/thunk/ppb_image_data_api.h" | 18 #include "ppapi/thunk/ppb_image_data_api.h" |
| 19 #include "ppapi/thunk/thunk.h" | 19 #include "ppapi/thunk/thunk.h" |
| 20 | 20 |
| 21 using ppapi::HostResource; |
| 21 using ppapi::StringVar; | 22 using ppapi::StringVar; |
| 22 using ppapi::thunk::EnterResourceNoLock; | 23 using ppapi::thunk::EnterResourceNoLock; |
| 23 using ppapi::thunk::PPB_ImageData_API; | 24 using ppapi::thunk::PPB_ImageData_API; |
| 24 using ppapi::WebKitForwarding; | 25 using ppapi::WebKitForwarding; |
| 25 | 26 |
| 26 namespace pp { | 27 namespace pp { |
| 27 namespace proxy { | 28 namespace proxy { |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| 30 | 31 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 112 } |
| 112 | 113 |
| 113 Font::~Font() { | 114 Font::~Font() { |
| 114 RunOnWebKitThread(false, base::Bind(&DeleteFontForwarding, font_forwarding_)); | 115 RunOnWebKitThread(false, base::Bind(&DeleteFontForwarding, font_forwarding_)); |
| 115 } | 116 } |
| 116 | 117 |
| 117 ppapi::thunk::PPB_Font_API* Font::AsPPB_Font_API() { | 118 ppapi::thunk::PPB_Font_API* Font::AsPPB_Font_API() { |
| 118 return this; | 119 return this; |
| 119 } | 120 } |
| 120 | 121 |
| 121 Font* Font::AsFont() { | |
| 122 return this; | |
| 123 } | |
| 124 | |
| 125 PP_Bool Font::Describe(PP_FontDescription_Dev* description, | 122 PP_Bool Font::Describe(PP_FontDescription_Dev* description, |
| 126 PP_FontMetrics_Dev* metrics) { | 123 PP_FontMetrics_Dev* metrics) { |
| 127 TRACE_EVENT0("ppapi proxy", "Font::Describe"); | 124 TRACE_EVENT0("ppapi proxy", "Font::Describe"); |
| 128 std::string face; | 125 std::string face; |
| 129 PP_Bool result = PP_FALSE; | 126 PP_Bool result = PP_FALSE; |
| 130 RunOnWebKitThread(true, | 127 RunOnWebKitThread(true, |
| 131 base::Bind(&WebKitForwarding::Font::Describe, | 128 base::Bind(&WebKitForwarding::Font::Describe, |
| 132 base::Unretained(font_forwarding_), | 129 base::Unretained(font_forwarding_), |
| 133 &webkit_event_, description, &face, metrics, | 130 &webkit_event_, description, &face, metrics, |
| 134 &result)); | 131 &result)); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 } | 227 } |
| 231 | 228 |
| 232 // static | 229 // static |
| 233 void Font::DeleteFontForwarding( | 230 void Font::DeleteFontForwarding( |
| 234 ppapi::WebKitForwarding::Font* font_forwarding) { | 231 ppapi::WebKitForwarding::Font* font_forwarding) { |
| 235 delete font_forwarding; | 232 delete font_forwarding; |
| 236 } | 233 } |
| 237 | 234 |
| 238 } // namespace proxy | 235 } // namespace proxy |
| 239 } // namespace pp | 236 } // namespace pp |
| OLD | NEW |