Index: media/gpu/video_encode_accelerator_unittest.cc |
diff --git a/media/gpu/video_encode_accelerator_unittest.cc b/media/gpu/video_encode_accelerator_unittest.cc |
index 2ee1df6e2cc4e56d1382b3d53d894cbed2a1e943..cdb9984aa44e992106c82837ec796268213b55aa 100644 |
--- a/media/gpu/video_encode_accelerator_unittest.cc |
+++ b/media/gpu/video_encode_accelerator_unittest.cc |
@@ -1646,9 +1646,11 @@ void VEAClient::FeedEncoderWithOutput(base::SharedMemory* shm) { |
if (state_ != CS_ENCODING) |
return; |
- base::SharedMemoryHandle dup_handle; |
- LOG_ASSERT(shm->ShareToProcess(base::GetCurrentProcessHandle(), &dup_handle)); |
+ base::SharedMemoryHandle dup_handle = shm->handle().Duplicate(); |
+ LOG_ASSERT(dup_handle.IsValid()); |
+ // TODO(erikchen): This may leak the SharedMemoryHandle. |
+ // https://crbug.com/640840. |
BitstreamBuffer bitstream_buffer(next_output_buffer_id_++, dup_handle, |
output_buffer_size_); |
LOG_ASSERT(output_buffers_at_client_ |
@@ -1912,8 +1914,8 @@ void SimpleVEAClientBase::FeedEncoderWithOutput(base::SharedMemory* shm, |
if (!has_encoder()) |
return; |
- base::SharedMemoryHandle dup_handle; |
- LOG_ASSERT(shm->ShareToProcess(base::GetCurrentProcessHandle(), &dup_handle)); |
+ base::SharedMemoryHandle dup_handle = shm->handle().Duplicate(); |
+ LOG_ASSERT(dup_handle.IsValid()); |
BitstreamBuffer bitstream_buffer(next_output_buffer_id_++, dup_handle, |
output_size); |