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

Unified Diff: components/mus/common/gpu_type_converters.cc

Issue 2109593006: Add ChannelHandle::mojo_handle to mus' ChannelHandle mojom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make mojo_handle optional, which it is. Created 4 years, 6 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: components/mus/common/gpu_type_converters.cc
diff --git a/components/mus/common/gpu_type_converters.cc b/components/mus/common/gpu_type_converters.cc
index 7733c7d3bf7e5d51ebd95afcdba9d865ae18541c..4a2615e1654a65c8a08a38e0926788dc97c336ea 100644
--- a/components/mus/common/gpu_type_converters.cc
+++ b/components/mus/common/gpu_type_converters.cc
@@ -31,6 +31,7 @@ TypeConverter<mus::mojom::ChannelHandlePtr, IPC::ChannelHandle>::Convert(
if (platform_file != -1)
result->socket = mojo::WrapPlatformFile(platform_file);
#endif
+ result->mojo_handle.reset(handle.mojo_handle);
dcheng 2016/07/01 01:31:43 It's hard for me to tell where the type converter
Anand Mistry (off Chromium) 2016/07/01 05:52:54 So, I'm making this change in prep for switching G
dcheng 2016/07/04 07:11:59 Fair enough, I've filed a followup bug and assign
Peng 2016/07/06 15:19:06 I think when GPU starts using ChannelMojo, we coul
return result;
}
@@ -40,6 +41,11 @@ TypeConverter<IPC::ChannelHandle, mus::mojom::ChannelHandlePtr>::Convert(
const mus::mojom::ChannelHandlePtr& handle) {
if (handle.is_null())
return IPC::ChannelHandle();
+ if (handle->mojo_handle.is_valid()) {
+ IPC::ChannelHandle channel_handle(handle->mojo_handle.release());
+ channel_handle.name = handle->name;
+ return channel_handle;
+ }
#if defined(OS_WIN)
// On windows, a pipe handle Will NOT be marshalled over IPC.
DCHECK(!handle->socket.is_valid());

Powered by Google App Engine
This is Rietveld 408576698