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

Unified Diff: ppapi/proxy/video_decoder_resource.cc

Issue 2972053003: Remove ScopedVector from ppapi/. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « ppapi/proxy/video_decoder_resource.h ('k') | ppapi/proxy/video_encoder_resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/video_decoder_resource.cc
diff --git a/ppapi/proxy/video_decoder_resource.cc b/ppapi/proxy/video_decoder_resource.cc
index 26fee48177ec299412a7bed284dbfff87a5e0254..495d257a6958a8a5ec2c7c65902a89c5e5cade37 100644
--- a/ppapi/proxy/video_decoder_resource.cc
+++ b/ppapi/proxy/video_decoder_resource.cc
@@ -238,14 +238,10 @@ int32_t VideoDecoderResource::Decode(uint32_t decode_id,
return PP_ERROR_NOMEMORY;
available_shm_buffers_.push_back(shm_buffer.get());
- if (shm_buffers_.size() < kMaximumPendingDecodes) {
- shm_buffers_.push_back(shm_buffer.release());
- } else {
- // Delete manually since ScopedVector won't delete the existing element if
- // we just assign it.
- delete shm_buffers_[shm_id];
- shm_buffers_[shm_id] = shm_buffer.release();
- }
+ if (shm_buffers_.size() < kMaximumPendingDecodes)
+ shm_buffers_.push_back(std::move(shm_buffer));
+ else
+ shm_buffers_[shm_id] = std::move(shm_buffer);
}
// At this point we should have shared memory to hold the plugin's buffer.
@@ -486,7 +482,7 @@ void VideoDecoderResource::OnPluginMsgDecodeComplete(
return;
}
// Make the shm buffer available.
- available_shm_buffers_.push_back(shm_buffers_[shm_id]);
+ available_shm_buffers_.push_back(shm_buffers_[shm_id].get());
// If the plugin is waiting, let it call Decode again.
if (decode_callback_.get()) {
scoped_refptr<TrackedCallback> callback;
« no previous file with comments | « ppapi/proxy/video_decoder_resource.h ('k') | ppapi/proxy/video_encoder_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698