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

Unified Diff: services/ui/gpu/gpu_service_mus.cc

Issue 2247183005: services/ui: Get rid of IPC::ChannelHandle type converter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review issues Created 4 years, 4 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 | « services/ui/gpu/gpu_service_mus.h ('k') | services/ui/public/cpp/gpu_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/gpu/gpu_service_mus.cc
diff --git a/services/ui/gpu/gpu_service_mus.cc b/services/ui/gpu/gpu_service_mus.cc
index fabbce31102148c3c3ec3a386442ad8ea366e432..25d95f24593c5100edd7b2927cd2ac993cd04557 100644
--- a/services/ui/gpu/gpu_service_mus.cc
+++ b/services/ui/gpu/gpu_service_mus.cc
@@ -42,9 +42,9 @@ const uint64_t kLocalGpuChannelClientTracingId = 1;
void EstablishGpuChannelDone(
int client_id,
- const IPC::ChannelHandle* channel_handle,
+ mojo::ScopedMessagePipeHandle* channel_handle,
const GpuServiceMus::EstablishGpuChannelCallback& callback) {
- callback.Run(channel_handle ? client_id : -1, *channel_handle);
+ callback.Run(client_id, std::move(*channel_handle));
}
}
@@ -76,12 +76,12 @@ void GpuServiceMus::EstablishGpuChannel(
DCHECK(CalledOnValidThread());
if (!gpu_channel_manager_) {
- callback.Run(-1, IPC::ChannelHandle());
+ callback.Run(-1, mojo::ScopedMessagePipeHandle());
return;
}
const int client_id = ++next_client_id_;
- IPC::ChannelHandle* channel_handle = new IPC::ChannelHandle;
+ auto* channel_handle = new mojo::ScopedMessagePipeHandle;
gpu_thread_.task_runner()->PostTaskAndReply(
FROM_HERE,
base::Bind(&GpuServiceMus::EstablishGpuChannelOnGpuThread,
@@ -169,7 +169,7 @@ void GpuServiceMus::Initialize() {
#endif
CHECK(io_thread_.StartWithOptions(thread_options));
- IPC::ChannelHandle channel_handle;
+ mojo::ScopedMessagePipeHandle channel_handle;
base::WaitableEvent event(base::WaitableEvent::ResetPolicy::MANUAL,
base::WaitableEvent::InitialState::NOT_SIGNALED);
gpu_thread_.task_runner()->PostTask(
@@ -180,12 +180,14 @@ void GpuServiceMus::Initialize() {
gpu_memory_buffer_manager_local_.reset(
new MusGpuMemoryBufferManager(this, kLocalGpuChannelClientId));
gpu_channel_local_ = gpu::GpuChannelHost::Create(
- this, kLocalGpuChannelClientId, gpu_info_, channel_handle,
- &shutdown_event_, gpu_memory_buffer_manager_local_.get());
+ this, kLocalGpuChannelClientId, gpu_info_,
+ IPC::ChannelHandle(channel_handle.release()), &shutdown_event_,
+ gpu_memory_buffer_manager_local_.get());
}
-void GpuServiceMus::InitializeOnGpuThread(IPC::ChannelHandle* channel_handle,
- base::WaitableEvent* event) {
+void GpuServiceMus::InitializeOnGpuThread(
+ mojo::ScopedMessagePipeHandle* channel_handle,
+ base::WaitableEvent* event) {
gpu_info_.video_decode_accelerator_capabilities =
media::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences_);
gpu_info_.video_encode_accelerator_supported_profiles =
@@ -240,11 +242,12 @@ void GpuServiceMus::EstablishGpuChannelOnGpuThread(
bool preempts,
bool allow_view_command_buffers,
bool allow_real_time_streams,
- IPC::ChannelHandle* channel_handle) {
+ mojo::ScopedMessagePipeHandle* channel_handle) {
if (gpu_channel_manager_) {
- *channel_handle = gpu_channel_manager_->EstablishChannel(
+ auto handle = gpu_channel_manager_->EstablishChannel(
client_id, client_tracing_id, preempts, allow_view_command_buffers,
allow_real_time_streams);
+ channel_handle->reset(handle.mojo_handle);
media_service_->AddChannel(client_id);
}
}
« no previous file with comments | « services/ui/gpu/gpu_service_mus.h ('k') | services/ui/public/cpp/gpu_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698