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

Unified Diff: content/browser/renderer_host/media/shared_memory_buffer_tracker.cc

Issue 2410383002: VideoCapture: more migration IPC-->mojo, part 6 (Closed)
Patch Set: Comment correction Created 4 years, 2 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
Index: content/browser/renderer_host/media/shared_memory_buffer_tracker.cc
diff --git a/content/browser/renderer_host/media/shared_memory_buffer_tracker.cc b/content/browser/renderer_host/media/shared_memory_buffer_tracker.cc
index bf8e3cd47869215972d1277ae29fbdbd23375cb3..2ac92b269e44bbbbf11a66611e4057218adb1952 100644
--- a/content/browser/renderer_host/media/shared_memory_buffer_tracker.cc
+++ b/content/browser/renderer_host/media/shared_memory_buffer_tracker.cc
@@ -6,6 +6,7 @@
#include "base/memory/ptr_util.h"
#include "content/browser/renderer_host/media/shared_memory_buffer_handle.h"
+#include "mojo/public/cpp/system/platform_handle.h"
namespace content {
@@ -16,7 +17,7 @@ bool SharedMemoryBufferTracker::Init(const gfx::Size& dimensions,
media::VideoPixelFormat format,
media::VideoPixelStorage storage_type,
base::Lock* lock) {
- DVLOG(2) << "allocating ShMem of " << dimensions.ToString();
+ DVLOG(2) << __func__ << "allocating ShMem of " << dimensions.ToString();
set_dimensions(dimensions);
// |dimensions| can be 0x0 for trackers that do not require memory backing.
set_max_pixel_count(dimensions.GetArea());
@@ -35,10 +36,11 @@ SharedMemoryBufferTracker::GetBufferHandle() {
return base::MakeUnique<SharedMemoryBufferHandle>(this);
}
-bool SharedMemoryBufferTracker::ShareToProcess(
- base::ProcessHandle process_handle,
- base::SharedMemoryHandle* new_handle) {
- return shared_memory_.ShareToProcess(process_handle, new_handle);
+mojo::ScopedSharedBufferHandle
+SharedMemoryBufferTracker::GetHandleForTransit() {
+ return mojo::WrapSharedMemoryHandle(
+ base::SharedMemory::DuplicateHandle(shared_memory_.handle()),
+ mapped_size_, false /* read_only */);
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698