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

Unified Diff: webkit/plugins/ppapi/ppb_video_decoder_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
« no previous file with comments | « webkit/plugins/ppapi/ppb_transport_impl.cc ('k') | webkit/plugins/ppapi/ppb_widget_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_video_decoder_impl.cc
===================================================================
--- webkit/plugins/ppapi/ppb_video_decoder_impl.cc (revision 89672)
+++ webkit/plugins/ppapi/ppb_video_decoder_impl.cc (working copy)
@@ -23,6 +23,9 @@
#include "webkit/plugins/ppapi/resource_tracker.h"
#include "webkit/plugins/ppapi/var.h"
+using ppapi::thunk::EnterResourceNoLock;
+using ppapi::thunk::PPB_Buffer_API;
+using ppapi::thunk::PPB_Context3D_API;
using ppapi::thunk::PPB_VideoDecoder_API;
namespace webkit {
@@ -122,11 +125,11 @@
if (!instance())
return PP_ERROR_FAILED;
- scoped_refptr<webkit::ppapi::PPB_Context3D_Impl> context3d =
- webkit::ppapi::Resource::GetAs<webkit::ppapi::PPB_Context3D_Impl>(
- context_id);
- if (!context3d)
+ EnterResourceNoLock<PPB_Context3D_API> enter(context_id, true);
+ if (enter.failed())
return PP_ERROR_BADRESOURCE;
+ PPB_Context3D_Impl* context3d =
+ static_cast<PPB_Context3D_Impl*>(enter.object());
int command_buffer_route_id =
context3d->platform_context()->GetCommandBufferRouteId();
@@ -157,8 +160,7 @@
if (!platform_video_decoder_.get())
return PP_ERROR_BADRESOURCE;
- ::ppapi::thunk::EnterResourceNoLock< ::ppapi::thunk::PPB_Buffer_API>
- enter(bitstream_buffer->data, true);
+ EnterResourceNoLock<PPB_Buffer_API> enter(bitstream_buffer->data, true);
if (enter.failed())
return PP_ERROR_FAILED;
@@ -354,9 +356,12 @@
SysmemBuffer::SysmemBuffer(const PP_SysmemBuffer_Dev& buffer)
: BaseBuffer(buffer.info) {
- scoped_refptr<webkit::ppapi::PPB_Buffer_Impl> pepper_buffer =
- webkit::ppapi::Resource::GetAs<webkit::ppapi::PPB_Buffer_Impl>(
- buffer.data);
+ // TODO(brettw) we should properly handle the errors here if the buffer
+ // isn't a valid image rather than CHECKing.
+ EnterResourceNoLock<PPB_Buffer_API> enter(buffer.data, true);
+ CHECK(enter.succeeded());
+ webkit::ppapi::PPB_Buffer_Impl* pepper_buffer =
+ static_cast<webkit::ppapi::PPB_Buffer_Impl*>(enter.object());
CHECK(pepper_buffer->IsMapped());
data_ = pepper_buffer->Map();
}
« no previous file with comments | « webkit/plugins/ppapi/ppb_transport_impl.cc ('k') | webkit/plugins/ppapi/ppb_widget_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698