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

Side by Side Diff: ppapi/proxy/video_encoder_resource_unittest.cc

Issue 1864293002: Convert //ppapi to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more nullptr Created 4 years, 8 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.cc ('k') | ppapi/shared_impl/compositor_layer_data.h » ('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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 117
118 PP_Resource CreateEncoder() { 118 PP_Resource CreateEncoder() {
119 PP_Resource result = encoder_iface()->Create(pp_instance()); 119 PP_Resource result = encoder_iface()->Create(pp_instance());
120 return result; 120 return result;
121 } 121 }
122 122
123 void CreateBitstreamSharedMemory(uint32_t buffer_size, uint32_t nb_buffers) { 123 void CreateBitstreamSharedMemory(uint32_t buffer_size, uint32_t nb_buffers) {
124 shared_memory_bitstreams_.clear(); 124 shared_memory_bitstreams_.clear();
125 for (uint32_t i = 0; i < nb_buffers; ++i) { 125 for (uint32_t i = 0; i < nb_buffers; ++i) {
126 scoped_ptr<base::SharedMemory> mem(new base::SharedMemory()); 126 std::unique_ptr<base::SharedMemory> mem(new base::SharedMemory());
127 ASSERT_TRUE(mem->CreateAnonymous(buffer_size)); 127 ASSERT_TRUE(mem->CreateAnonymous(buffer_size));
128 shared_memory_bitstreams_.push_back(std::move(mem)); 128 shared_memory_bitstreams_.push_back(std::move(mem));
129 } 129 }
130 } 130 }
131 131
132 void CreateVideoFramesSharedMemory(uint32_t frame_length, 132 void CreateVideoFramesSharedMemory(uint32_t frame_length,
133 uint32_t frame_count) { 133 uint32_t frame_count) {
134 scoped_ptr<base::SharedMemory> shared_memory_frames( 134 std::unique_ptr<base::SharedMemory> shared_memory_frames(
135 new base::SharedMemory()); 135 new base::SharedMemory());
136 uint32_t buffer_length = 136 uint32_t buffer_length =
137 frame_length + sizeof(ppapi::MediaStreamBuffer::Video); 137 frame_length + sizeof(ppapi::MediaStreamBuffer::Video);
138 ASSERT_TRUE(shared_memory_frames->CreateAnonymous(buffer_length * 138 ASSERT_TRUE(shared_memory_frames->CreateAnonymous(buffer_length *
139 frame_count)); 139 frame_count));
140 ASSERT_TRUE(video_frames_manager_.SetBuffers( 140 ASSERT_TRUE(video_frames_manager_.SetBuffers(
141 frame_count, buffer_length, std::move(shared_memory_frames), true)); 141 frame_count, buffer_length, std::move(shared_memory_frames), true));
142 for (int32_t i = 0; i < video_frames_manager_.number_of_buffers(); ++i) { 142 for (int32_t i = 0; i < video_frames_manager_.number_of_buffers(); ++i) {
143 ppapi::MediaStreamBuffer::Video* buffer = 143 ppapi::MediaStreamBuffer::Video* buffer =
144 &(video_frames_manager_.GetBufferPointer(i)->video); 144 &(video_frames_manager_.GetBufferPointer(i)->video);
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 ResourceMessageCallParams params; 1145 ResourceMessageCallParams params;
1146 uint32_t frame_id; 1146 uint32_t frame_id;
1147 bool force_frame; 1147 bool force_frame;
1148 ASSERT_TRUE(CheckEncodeMsg(&params, &frame_id, &force_frame)); 1148 ASSERT_TRUE(CheckEncodeMsg(&params, &frame_id, &force_frame));
1149 SendEncodeReply(params, frame_id); 1149 SendEncodeReply(params, frame_id);
1150 } 1150 }
1151 } 1151 }
1152 1152
1153 } // namespace proxy 1153 } // namespace proxy
1154 } // namespace ppapi 1154 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/video_encoder_resource.cc ('k') | ppapi/shared_impl/compositor_layer_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698