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

Unified Diff: ui/gfx/mojo/buffer_types_struct_traits.cc

Issue 2859843002: Add a GUID to base::SharedMemoryHandle. (Closed)
Patch Set: fix guid on android. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/bootstrap/bootstrap.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/mojo/buffer_types_struct_traits.cc
diff --git a/ui/gfx/mojo/buffer_types_struct_traits.cc b/ui/gfx/mojo/buffer_types_struct_traits.cc
index 5e3c0fcd6919c0493664b0283ec4bd3f206e5b25..9450770235c362db5840257e14e9f6eb664f3071 100644
--- a/ui/gfx/mojo/buffer_types_struct_traits.cc
+++ b/ui/gfx/mojo/buffer_types_struct_traits.cc
@@ -128,11 +128,17 @@ bool StructTraits<gfx::mojom::GpuMemoryBufferHandleDataView,
mojo::UnwrapPlatformFile(std::move(handle), &platform_file);
if (unwrap_result != MOJO_RESULT_OK)
return false;
+ // TODO(rockot): Pass GUIDs through Mojo. https://crbug.com/713763.
+ // TODO(erikchen): During serialization, the SharedMemoryHandle is
+ // decomposed on Linux into a file_descriptor. The serialization path
+ // should be changed to serialize a Mojo shared buffer instead.
+ // https://crbug.com/713763.
+ base::UnguessableToken guid = base::UnguessableToken::Create();
#if defined(OS_WIN)
- out->handle = base::SharedMemoryHandle(platform_file);
+ out->handle = base::SharedMemoryHandle(platform_file, guid);
#else
- out->handle =
- base::SharedMemoryHandle(base::FileDescriptor(platform_file, true));
+ out->handle = base::SharedMemoryHandle(
+ base::FileDescriptor(platform_file, true), guid);
#endif
#endif // defined(OS_MACOSX)
}
« no previous file with comments | « tools/gn/bootstrap/bootstrap.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698