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

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

Issue 7669055: Remove webkit::ppapi::Resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nulls auditeed Created 9 years, 4 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
« no previous file with comments | « webkit/plugins/ppapi/ppb_image_data_impl.h ('k') | webkit/plugins/ppapi/ppb_input_event_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_image_data_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_image_data_impl.cc b/webkit/plugins/ppapi/ppb_image_data_impl.cc
index d565addcb58a9fc99d7352d00837ed98054af8c9..65637138e09da9793a290726839ad37b4ffbb38b 100644
--- a/webkit/plugins/ppapi/ppb_image_data_impl.cc
+++ b/webkit/plugins/ppapi/ppb_image_data_impl.cc
@@ -18,13 +18,14 @@
#include "third_party/skia/include/core/SkColorPriv.h"
#include "webkit/plugins/ppapi/common.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
+#include "webkit/plugins/ppapi/resource_helper.h"
using ::ppapi::thunk::PPB_ImageData_API;
namespace webkit {
namespace ppapi {
-PPB_ImageData_Impl::PPB_ImageData_Impl(PluginInstance* instance)
+PPB_ImageData_Impl::PPB_ImageData_Impl(PP_Instance instance)
: Resource(instance),
format_(PP_IMAGEDATAFORMAT_BGRA_PREMUL),
width_(0),
@@ -35,7 +36,7 @@ PPB_ImageData_Impl::~PPB_ImageData_Impl() {
}
// static
-PP_Resource PPB_ImageData_Impl::Create(PluginInstance* instance,
+PP_Resource PPB_ImageData_Impl::Create(PP_Instance instance,
PP_ImageDataFormat format,
const PP_Size& size,
PP_Bool init_to_zero) {
@@ -62,8 +63,11 @@ bool PPB_ImageData_Impl::Init(PP_ImageDataFormat format,
std::numeric_limits<int32>::max())
return false; // Prevent overflow of signed 32-bit ints.
- platform_image_.reset(
- instance()->delegate()->CreateImage2D(width, height));
+ PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this);
+ if (!plugin_delegate)
+ return false;
+
+ platform_image_.reset(plugin_delegate->CreateImage2D(width, height));
format_ = format;
width_ = width;
height_ = height;
« no previous file with comments | « webkit/plugins/ppapi/ppb_image_data_impl.h ('k') | webkit/plugins/ppapi/ppb_input_event_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698