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

Unified Diff: gpu/ipc/service/gpu_channel.cc

Issue 2038423004: Use ChannelMojo for Browser-GPU and Renderer-GPU IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-utility-channel-mojo
Patch Set: fix pepper 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
« no previous file with comments | « gpu/ipc/service/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/gpu_channel.cc
diff --git a/gpu/ipc/service/gpu_channel.cc b/gpu/ipc/service/gpu_channel.cc
index 73abc9c6867bc5820894b7ef368750805a845273..f069393276bd9b65701532dbb3babb3c93b15304 100644
--- a/gpu/ipc/service/gpu_channel.cc
+++ b/gpu/ipc/service/gpu_channel.cc
@@ -41,6 +41,7 @@
#include "gpu/ipc/service/gpu_memory_buffer_factory.h"
#include "ipc/ipc_channel.h"
#include "ipc/message_filter.h"
+#include "mojo/public/cpp/system/message_pipe.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_image_shared_memory.h"
#include "ui/gl/gl_surface.h"
@@ -630,22 +631,20 @@ IPC::ChannelHandle GpuChannel::Init(base::WaitableEvent* shutdown_event) {
DCHECK(!channel_);
IPC::ChannelHandle channel_handle(channel_id_);
+ IPC::ChannelHandle client_channel_handle = channel_handle;
+ mojo::MessagePipe pipe_pair;
+ DCHECK(pipe_pair.handle0.is_valid());
+ DCHECK(pipe_pair.handle1.is_valid());
+ channel_handle = IPC::ChannelHandle(pipe_pair.handle0.release());
+ client_channel_handle = IPC::ChannelHandle(pipe_pair.handle1.release());
channel_ =
- IPC::SyncChannel::Create(channel_handle, IPC::Channel::MODE_SERVER, this,
- io_task_runner_, false, shutdown_event);
-
-#if defined(OS_POSIX)
- // On POSIX, pass the renderer-side FD. Also mark it as auto-close so
- // that it gets closed after it has been sent.
- base::ScopedFD renderer_fd = channel_->TakeClientFileDescriptor();
- DCHECK(renderer_fd.is_valid());
- channel_handle.socket = base::FileDescriptor(std::move(renderer_fd));
-#endif
+ IPC::SyncChannel::Create(channel_handle, IPC::Channel::MODE_SERVER,
+ this, io_task_runner_, false, shutdown_event);
channel_->AddFilter(filter_.get());
- return channel_handle;
+ return client_channel_handle;
}
void GpuChannel::SetUnhandledMessageListener(IPC::Listener* listener) {
« no previous file with comments | « gpu/ipc/service/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698