Chromium Code Reviews| Index: content/browser/renderer_host/gpu_message_filter.cc |
| diff --git a/content/browser/renderer_host/gpu_message_filter.cc b/content/browser/renderer_host/gpu_message_filter.cc |
| index a5997db7c807f1b24ebee9176dec07d6af2a7ec9..4e1108275e49c9144681fa9a5d72ca6c7340f8bb 100644 |
| --- a/content/browser/renderer_host/gpu_message_filter.cc |
| +++ b/content/browser/renderer_host/gpu_message_filter.cc |
| @@ -34,6 +34,7 @@ bool GpuMessageFilter::OnMessageReceived(const IPC::Message& message) { |
| IPC_BEGIN_MESSAGE_MAP(GpuMessageFilter, message) |
| IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_EstablishGpuChannel, |
| OnEstablishGpuChannel) |
| + IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_HasGpuProcess, OnHasGpuProcess) |
| IPC_MESSAGE_UNHANDLED(handled = false) |
| IPC_END_MESSAGE_MAP() |
| return handled; |
| @@ -80,6 +81,13 @@ void GpuMessageFilter::OnEstablishGpuChannel( |
| weak_ptr_factory_.GetWeakPtr(), base::Passed(&reply))); |
| } |
| +void GpuMessageFilter::OnHasGpuProcess(IPC::Message* reply_ptr) { |
| + scoped_ptr<IPC::Message> reply(reply_ptr); |
| + GpuProcessHost::GetProcessHandles( |
| + base::Bind(&GpuMessageFilter::GetGpuProcessHandlesCallback, |
| + weak_ptr_factory_.GetWeakPtr(), base::Passed(&reply))); |
| +} |
| + |
| void GpuMessageFilter::EstablishChannelCallback( |
| scoped_ptr<IPC::Message> reply, |
| const IPC::ChannelHandle& channel, |
| @@ -91,4 +99,12 @@ void GpuMessageFilter::EstablishChannelCallback( |
| Send(reply.release()); |
| } |
| +void GpuMessageFilter::GetGpuProcessHandlesCallback( |
| + scoped_ptr<IPC::Message> reply, |
| + const std::list<base::ProcessHandle>& handles) { |
| + bool hasGpuProcess = handles.size() > 0; |
|
jam
2016/02/10 18:32:33
nit: has_gpu_process per style guide
|
| + GpuHostMsg_HasGpuProcess::WriteReplyParams(reply.get(), hasGpuProcess); |
| + Send(reply.release()); |
| +} |
| + |
| } // namespace content |