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

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

Issue 2852803002: Remove base::SharedMemory::ShareToProcess. (Closed)
Patch Set: Compile error. Created 3 years, 7 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_decoder_resource_unittest.cc ('k') | no next file » | 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 const PP_Size& input_coded_size) { 285 const PP_Size& input_coded_size) {
286 SendReply(params, success, PpapiPluginMsg_VideoEncoder_InitializeReply( 286 SendReply(params, success, PpapiPluginMsg_VideoEncoder_InitializeReply(
287 input_frame_count, input_coded_size)); 287 input_frame_count, input_coded_size));
288 } 288 }
289 289
290 void SendBitstreamBuffers(const ResourceMessageCallParams& params, 290 void SendBitstreamBuffers(const ResourceMessageCallParams& params,
291 uint32_t buffer_length) { 291 uint32_t buffer_length) {
292 std::vector<SerializedHandle> handles; 292 std::vector<SerializedHandle> handles;
293 for (base::SharedMemory* mem : shared_memory_bitstreams_) { 293 for (base::SharedMemory* mem : shared_memory_bitstreams_) {
294 ASSERT_EQ(mem->requested_size(), buffer_length); 294 ASSERT_EQ(mem->requested_size(), buffer_length);
295 base::SharedMemoryHandle handle; 295 base::SharedMemoryHandle handle = mem->handle().Duplicate();
296 296 ASSERT_TRUE(handle.IsValid());
297 ASSERT_TRUE(
298 mem->ShareToProcess(base::Process::Current().Handle(), &handle));
299 handles.push_back(SerializedHandle(handle, buffer_length)); 297 handles.push_back(SerializedHandle(handle, buffer_length));
300 } 298 }
301 SendReplyWithHandles( 299 SendReplyWithHandles(
302 params, PP_OK, 300 params, PP_OK,
303 PpapiPluginMsg_VideoEncoder_BitstreamBuffers(buffer_length), handles); 301 PpapiPluginMsg_VideoEncoder_BitstreamBuffers(buffer_length), handles);
304 } 302 }
305 303
306 void SendGetVideoFramesReply(const ResourceMessageCallParams& params, 304 void SendGetVideoFramesReply(const ResourceMessageCallParams& params,
307 uint32_t frame_count, 305 uint32_t frame_count,
308 uint32_t frame_length, 306 uint32_t frame_length,
309 const PP_Size& size) { 307 const PP_Size& size) {
310 base::SharedMemoryHandle handle; 308 base::SharedMemoryHandle handle =
311 ASSERT_TRUE(video_frames_manager_.shm()->ShareToProcess( 309 video_frames_manager_.shm()->handle().Duplicate();
312 base::Process::Current().Handle(), &handle)); 310 ASSERT_TRUE(handle.IsValid());
313 SendReplyWithHandle( 311 SendReplyWithHandle(
314 params, PP_OK, PpapiPluginMsg_VideoEncoder_GetVideoFramesReply( 312 params, PP_OK, PpapiPluginMsg_VideoEncoder_GetVideoFramesReply(
315 frame_count, 313 frame_count,
316 frame_length + sizeof(MediaStreamBuffer::Video), 314 frame_length + sizeof(MediaStreamBuffer::Video),
317 size), 315 size),
318 SerializedHandle( 316 SerializedHandle(
319 handle, 317 handle,
320 static_cast<uint32_t>( 318 static_cast<uint32_t>(
321 video_frames_manager_.shm()->requested_size()))); 319 video_frames_manager_.shm()->requested_size())));
322 } 320 }
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 ResourceMessageCallParams params; 1146 ResourceMessageCallParams params;
1149 uint32_t frame_id; 1147 uint32_t frame_id;
1150 bool force_frame; 1148 bool force_frame;
1151 ASSERT_TRUE(CheckEncodeMsg(&params, &frame_id, &force_frame)); 1149 ASSERT_TRUE(CheckEncodeMsg(&params, &frame_id, &force_frame));
1152 SendEncodeReply(params, frame_id); 1150 SendEncodeReply(params, frame_id);
1153 } 1151 }
1154 } 1152 }
1155 1153
1156 } // namespace proxy 1154 } // namespace proxy
1157 } // namespace ppapi 1155 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/video_decoder_resource_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698