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

Unified Diff: media/gpu/video_decode_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/audio/audio_output_device_unittest.cc ('k') | media/gpu/video_encode_accelerator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/video_decode_accelerator_unittest.cc
diff --git a/media/gpu/video_decode_accelerator_unittest.cc b/media/gpu/video_decode_accelerator_unittest.cc
index 97ffb0595269d2795d1348af13b96dd0f8f93f52..b1564cf6d0f043bffe4f90c36d30d6026bc2aef4 100644
--- a/media/gpu/video_decode_accelerator_unittest.cc
+++ b/media/gpu/video_decode_accelerator_unittest.cc
@@ -1085,10 +1085,11 @@ void GLRenderingVDAClient::DecodeNextFragment() {
base::SharedMemory shm;
LOG_ASSERT(shm.CreateAndMapAnonymous(next_fragment_size));
memcpy(shm.memory(), next_fragment_bytes.data(), next_fragment_size);
- base::SharedMemoryHandle dup_handle;
- bool result =
- shm.ShareToProcess(base::GetCurrentProcessHandle(), &dup_handle);
- LOG_ASSERT(result);
+ 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_bitstream_buffer_id_, dup_handle,
next_fragment_size);
decode_start_time_[next_bitstream_buffer_id_] = base::TimeTicks::Now();
« no previous file with comments | « media/audio/audio_output_device_unittest.cc ('k') | media/gpu/video_encode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698