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

Side by Side Diff: ppapi/proxy/video_encoder_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 unified diff | Download patch
« no previous file with comments | « ppapi/proxy/video_encoder_resource.h ('k') | ppapi/proxy/video_encoder_resource_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/proxy/video_encoder_resource.h" 5 #include "ppapi/proxy/video_encoder_resource.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 if (shm_handles.size() == 0) { 394 if (shm_handles.size() == 0) {
395 NotifyError(PP_ERROR_FAILED); 395 NotifyError(PP_ERROR_FAILED);
396 return; 396 return;
397 } 397 }
398 398
399 for (uint32_t i = 0; i < shm_handles.size(); ++i) { 399 for (uint32_t i = 0; i < shm_handles.size(); ++i) {
400 std::unique_ptr<base::SharedMemory> shm( 400 std::unique_ptr<base::SharedMemory> shm(
401 new base::SharedMemory(shm_handles[i], true)); 401 new base::SharedMemory(shm_handles[i], true));
402 CHECK(shm->Map(buffer_length)); 402 CHECK(shm->Map(buffer_length));
403 403
404 ShmBuffer* buffer = new ShmBuffer(i, std::move(shm)); 404 auto buffer = base::MakeUnique<ShmBuffer>(i, std::move(shm));
405 shm_buffers_.push_back(buffer);
406 bitstream_buffer_map_.insert( 405 bitstream_buffer_map_.insert(
407 std::make_pair(buffer->shm->memory(), buffer->id)); 406 std::make_pair(buffer->shm->memory(), buffer->id));
407 shm_buffers_.push_back(std::move(buffer));
408 } 408 }
409 } 409 }
410 410
411 void VideoEncoderResource::OnPluginMsgBitstreamBufferReady( 411 void VideoEncoderResource::OnPluginMsgBitstreamBufferReady(
412 const ResourceMessageReplyParams& params, 412 const ResourceMessageReplyParams& params,
413 uint32_t buffer_id, 413 uint32_t buffer_id,
414 uint32_t buffer_size, 414 uint32_t buffer_size,
415 bool key_frame) { 415 bool key_frame) {
416 available_bitstream_buffers_.push_back( 416 available_bitstream_buffers_.push_back(
417 BitstreamBuffer(buffer_id, buffer_size, key_frame)); 417 BitstreamBuffer(buffer_id, buffer_size, key_frame));
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 for (VideoFrameMap::iterator it = video_frames_.begin(); 476 for (VideoFrameMap::iterator it = video_frames_.begin();
477 it != video_frames_.end(); ++it) { 477 it != video_frames_.end(); ++it) {
478 it->second->Invalidate(); 478 it->second->Invalidate();
479 it->second = nullptr; 479 it->second = nullptr;
480 } 480 }
481 video_frames_.clear(); 481 video_frames_.clear();
482 } 482 }
483 483
484 } // namespace proxy 484 } // namespace proxy
485 } // namespace ppapi 485 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/video_encoder_resource.h ('k') | ppapi/proxy/video_encoder_resource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698