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

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

Issue 10749019: VideoDecodeAccelerator now SupportsWeakPtr instead of being RefCountedThreadSafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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_video_decoder_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_video_decoder_impl.cc b/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
index 9c63e13bdad96892d4290c2432dc36bae92e4414..9c2b676dcc7df942c978ecac5f898d06f5745bba 100644
--- a/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
+++ b/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
@@ -116,9 +116,9 @@ bool PPB_VideoDecoder_Impl::Init(
if (!plugin_delegate)
return false;
- platform_video_decoder_ = plugin_delegate->CreateVideoDecoder(
- this, command_buffer_route_id);
- if (!platform_video_decoder_)
+ platform_video_decoder_.reset(plugin_delegate->CreateVideoDecoder(
+ this, command_buffer_route_id));
+ if (!platform_video_decoder_.get())
return false;
FlushCommandBuffer();
@@ -128,7 +128,7 @@ bool PPB_VideoDecoder_Impl::Init(
int32_t PPB_VideoDecoder_Impl::Decode(
const PP_VideoBitstreamBuffer_Dev* bitstream_buffer,
scoped_refptr<TrackedCallback> callback) {
- if (!platform_video_decoder_)
+ if (!platform_video_decoder_.get())
return PP_ERROR_BADRESOURCE;
EnterResourceNoLock<PPB_Buffer_API> enter(bitstream_buffer->data, true);
@@ -151,7 +151,7 @@ int32_t PPB_VideoDecoder_Impl::Decode(
void PPB_VideoDecoder_Impl::AssignPictureBuffers(
uint32_t no_of_buffers,
const PP_PictureBuffer_Dev* buffers) {
- if (!platform_video_decoder_)
+ if (!platform_video_decoder_.get())
return;
std::vector<media::PictureBuffer> wrapped_buffers;
@@ -169,7 +169,7 @@ void PPB_VideoDecoder_Impl::AssignPictureBuffers(
}
void PPB_VideoDecoder_Impl::ReusePictureBuffer(int32_t picture_buffer_id) {
- if (!platform_video_decoder_)
+ if (!platform_video_decoder_.get())
return;
FlushCommandBuffer();
@@ -177,7 +177,7 @@ void PPB_VideoDecoder_Impl::ReusePictureBuffer(int32_t picture_buffer_id) {
}
int32_t PPB_VideoDecoder_Impl::Flush(scoped_refptr<TrackedCallback> callback) {
- if (!platform_video_decoder_)
+ if (!platform_video_decoder_.get())
return PP_ERROR_BADRESOURCE;
if (!SetFlushCallback(callback))
@@ -189,7 +189,7 @@ int32_t PPB_VideoDecoder_Impl::Flush(scoped_refptr<TrackedCallback> callback) {
}
int32_t PPB_VideoDecoder_Impl::Reset(scoped_refptr<TrackedCallback> callback) {
- if (!platform_video_decoder_)
+ if (!platform_video_decoder_.get())
return PP_ERROR_BADRESOURCE;
if (!SetResetCallback(callback))
@@ -201,13 +201,13 @@ int32_t PPB_VideoDecoder_Impl::Reset(scoped_refptr<TrackedCallback> callback) {
}
void PPB_VideoDecoder_Impl::Destroy() {
- if (!platform_video_decoder_)
+ if (!platform_video_decoder_.get())
return;
FlushCommandBuffer();
- platform_video_decoder_->Destroy();
+ platform_video_decoder_->Destroy(
+ platform_video_decoder_.PassAs<media::VideoDecodeAccelerator>());
::ppapi::PPB_VideoDecoder_Shared::Destroy();
- platform_video_decoder_ = NULL;
ppp_videodecoder_ = NULL;
}
« media/video/video_decode_accelerator.h ('K') | « webkit/plugins/ppapi/ppb_video_decoder_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698