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

Unified Diff: media/gpu/video_encode_accelerator_unittest.cc

Issue 2852803002: Remove base::SharedMemory::ShareToProcess. (Closed)
Patch Set: Compile error. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/gpu/video_decode_accelerator_unittest.cc ('k') | ppapi/proxy/video_decoder_resource_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « media/gpu/video_decode_accelerator_unittest.cc ('k') | ppapi/proxy/video_decoder_resource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698