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

Unified Diff: webkit/plugins/ppapi/ppb_buffer_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_buffer_impl.h ('k') | webkit/plugins/ppapi/ppb_context_3d_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_buffer_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_buffer_impl.cc b/webkit/plugins/ppapi/ppb_buffer_impl.cc
index 2782b847c04255a6428ea6c9d64c05e83287dc44..dc3e70ff571a6734622e27d9c7ea6b0deb281aed 100644
--- a/webkit/plugins/ppapi/ppb_buffer_impl.cc
+++ b/webkit/plugins/ppapi/ppb_buffer_impl.cc
@@ -13,6 +13,7 @@
#include "ppapi/c/pp_resource.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_Buffer_API;
using ::ppapi::thunk::PPB_BufferTrusted_API;
@@ -20,15 +21,17 @@ using ::ppapi::thunk::PPB_BufferTrusted_API;
namespace webkit {
namespace ppapi {
-PPB_Buffer_Impl::PPB_Buffer_Impl(PluginInstance* instance)
- : Resource(instance), size_(0), map_count_(0) {
+PPB_Buffer_Impl::PPB_Buffer_Impl(PP_Instance instance)
+ : Resource(instance),
+ size_(0),
+ map_count_(0) {
}
PPB_Buffer_Impl::~PPB_Buffer_Impl() {
}
// static
-PP_Resource PPB_Buffer_Impl::Create(PluginInstance* instance, uint32_t size) {
+PP_Resource PPB_Buffer_Impl::Create(PP_Instance instance, uint32_t size) {
scoped_refptr<PPB_Buffer_Impl> buffer(new PPB_Buffer_Impl(instance));
if (!buffer->Init(size))
return 0;
@@ -48,11 +51,11 @@ PPB_BufferTrusted_API* PPB_Buffer_Impl::AsPPB_BufferTrusted_API() {
}
bool PPB_Buffer_Impl::Init(uint32_t size) {
- if (size == 0 || !instance())
+ PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this);
+ if (size == 0 || !plugin_delegate)
return false;
size_ = size;
- shared_memory_.reset(
- instance()->delegate()->CreateAnonymousSharedMemory(size));
+ shared_memory_.reset(plugin_delegate->CreateAnonymousSharedMemory(size));
return shared_memory_.get() != NULL;
}
« no previous file with comments | « webkit/plugins/ppapi/ppb_buffer_impl.h ('k') | webkit/plugins/ppapi/ppb_context_3d_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698