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..1b7e46030a213c338f3397d82087d5d90903f2cc 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,12 @@ 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_.release()->Destroy(true); |
::ppapi::PPB_VideoDecoder_Shared::Destroy(); |
- platform_video_decoder_ = NULL; |
ppp_videodecoder_ = NULL; |
} |