Index: webkit/plugins/ppapi/ppb_font_impl.cc |
=================================================================== |
--- webkit/plugins/ppapi/ppb_font_impl.cc (revision 89610) |
+++ webkit/plugins/ppapi/ppb_font_impl.cc (working copy) |
@@ -6,6 +6,7 @@ |
#include "ppapi/c/dev/ppb_font_dev.h" |
#include "ppapi/shared_impl/ppapi_preferences.h" |
+#include "ppapi/thunk/enter.h" |
#include "ppapi/thunk/thunk.h" |
#include "webkit/plugins/ppapi/common.h" |
#include "webkit/plugins/ppapi/plugin_module.h" |
@@ -14,7 +15,9 @@ |
#include "webkit/plugins/ppapi/string.h" |
#include "webkit/plugins/ppapi/var.h" |
-using ::ppapi::WebKitForwarding; |
+using ppapi::thunk::EnterResource; |
+using ppapi::thunk::PPB_ImageData_API; |
+using ppapi::WebKitForwarding; |
namespace webkit { |
namespace ppapi { |
@@ -56,10 +59,6 @@ |
return this; |
} |
-PPB_Font_Impl* PPB_Font_Impl::AsPPB_Font_Impl() { |
- return this; |
-} |
- |
PP_Bool PPB_Font_Impl::Describe(PP_FontDescription_Dev* description, |
PP_FontMetrics_Dev* metrics) { |
std::string face; |
@@ -80,10 +79,12 @@ |
const PP_Rect* clip, |
PP_Bool image_data_is_opaque) { |
// Get and map the image data we're painting to. |
- scoped_refptr<PPB_ImageData_Impl> image_resource( |
- Resource::GetAs<PPB_ImageData_Impl>(image_data)); |
- if (!image_resource.get()) |
+ EnterResource<PPB_ImageData_API> enter(image_data, true); |
+ if (enter.failed()) |
return PP_FALSE; |
+ PPB_ImageData_Impl* image_resource = |
+ static_cast<PPB_ImageData_Impl*>(enter.object()); |
+ |
ImageDataAutoMapper mapper(image_resource); |
if (!mapper.is_valid()) |
return PP_FALSE; |