Commit 81366316 authored by jam's avatar jam Committed by Commit bot

Simplify an IPC handler which doesn't need _DELAY_REPLY

Review URL: https://codereview.chromium.org/1008563003

Cr-Commit-Position: refs/heads/master@{#322400}
parent d49c9e18
...@@ -254,8 +254,7 @@ bool ChildProcessHostImpl::OnMessageReceived(const IPC::Message& msg) { ...@@ -254,8 +254,7 @@ bool ChildProcessHostImpl::OnMessageReceived(const IPC::Message& msg) {
OnShutdownRequest) OnShutdownRequest)
IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateSharedMemory, IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateSharedMemory,
OnAllocateSharedMemory) OnAllocateSharedMemory)
IPC_MESSAGE_HANDLER_DELAY_REPLY( IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer,
ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer,
OnAllocateGpuMemoryBuffer) OnAllocateGpuMemoryBuffer)
IPC_MESSAGE_HANDLER(ChildProcessHostMsg_DeletedGpuMemoryBuffer, IPC_MESSAGE_HANDLER(ChildProcessHostMsg_DeletedGpuMemoryBuffer,
OnDeletedGpuMemoryBuffer) OnDeletedGpuMemoryBuffer)
...@@ -317,25 +316,20 @@ void ChildProcessHostImpl::OnAllocateGpuMemoryBuffer( ...@@ -317,25 +316,20 @@ void ChildProcessHostImpl::OnAllocateGpuMemoryBuffer(
uint32 height, uint32 height,
gfx::GpuMemoryBuffer::Format format, gfx::GpuMemoryBuffer::Format format,
gfx::GpuMemoryBuffer::Usage usage, gfx::GpuMemoryBuffer::Usage usage,
IPC::Message* reply) { gfx::GpuMemoryBufferHandle* handle) {
// TODO(reveman): Add support for other types of GpuMemoryBuffers. // TODO(reveman): Add support for other types of GpuMemoryBuffers.
gfx::GpuMemoryBufferHandle handle;
// AllocateForChildProcess() will check if |width| and |height| are valid // AllocateForChildProcess() will check if |width| and |height| are valid
// and handle failure in a controlled way when not. We just need to make // and handle failure in a controlled way when not. We just need to make
// sure |format| and |usage| are supported here. // sure |format| and |usage| are supported here.
if (GpuMemoryBufferImplSharedMemory::IsFormatSupported(format) && if (GpuMemoryBufferImplSharedMemory::IsFormatSupported(format) &&
usage == gfx::GpuMemoryBuffer::MAP) { usage == gfx::GpuMemoryBuffer::MAP) {
handle = GpuMemoryBufferImplSharedMemory::AllocateForChildProcess( *handle = GpuMemoryBufferImplSharedMemory::AllocateForChildProcess(
g_next_gpu_memory_buffer_id.GetNext(), g_next_gpu_memory_buffer_id.GetNext(),
gfx::Size(width, height), gfx::Size(width, height),
format, format,
peer_process_.Handle()); peer_process_.Handle());
} }
ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer::WriteReplyParams(reply,
handle);
Send(reply);
} }
void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer(
......
...@@ -84,7 +84,7 @@ class CONTENT_EXPORT ChildProcessHostImpl : public ChildProcessHost, ...@@ -84,7 +84,7 @@ class CONTENT_EXPORT ChildProcessHostImpl : public ChildProcessHost,
uint32 height, uint32 height,
gfx::GpuMemoryBuffer::Format format, gfx::GpuMemoryBuffer::Format format,
gfx::GpuMemoryBuffer::Usage usage, gfx::GpuMemoryBuffer::Usage usage,
IPC::Message* reply); gfx::GpuMemoryBufferHandle* handle);
void OnDeletedGpuMemoryBuffer(gfx::GpuMemoryBufferId id, void OnDeletedGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
uint32 sync_point); uint32 sync_point);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment