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

Unified Diff: webkit/plugins/ppapi/ppb_font_impl.cc

Issue 7206016: Convert most remaining resources to use the API/thunk system. The significant (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698