OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/render_message_filter.h" | 5 #include "content/browser/renderer_host/render_message_filter.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 149 |
150 RenderMessageFilter::~RenderMessageFilter() { | 150 RenderMessageFilter::~RenderMessageFilter() { |
151 // This function should be called on the IO thread. | 151 // This function should be called on the IO thread. |
152 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 152 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
153 } | 153 } |
154 | 154 |
155 bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message) { | 155 bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message) { |
156 bool handled = true; | 156 bool handled = true; |
157 IPC_BEGIN_MESSAGE_MAP(RenderMessageFilter, message) | 157 IPC_BEGIN_MESSAGE_MAP(RenderMessageFilter, message) |
158 #if defined(OS_MACOSX) | 158 #if defined(OS_MACOSX) |
159 // On Mac, ViewHostMsg_UpdateRect needs to be handled in a nested message | 159 // On Mac, the IPCs ViewHostMsg_SwapCompositorFrame, ViewHostMsg_UpdateRect, |
160 // loop during resize. | 160 // and GpuCommandBufferMsg_SwapBuffersCompleted need to be handled in a |
| 161 // nested message loop during resize. |
| 162 IPC_MESSAGE_HANDLER_GENERIC( |
| 163 ViewHostMsg_SwapCompositorFrame, |
| 164 ResizeHelperPostMsgToUIThread(render_process_id_, message)) |
161 IPC_MESSAGE_HANDLER_GENERIC( | 165 IPC_MESSAGE_HANDLER_GENERIC( |
162 ViewHostMsg_UpdateRect, | 166 ViewHostMsg_UpdateRect, |
163 ResizeHelperPostMsgToUIThread(render_process_id_, message)) | 167 ResizeHelperPostMsgToUIThread(render_process_id_, message)) |
| 168 IPC_MESSAGE_HANDLER_GENERIC( |
| 169 ViewHostMsg_SetNeedsBeginFrames, |
| 170 ResizeHelperPostMsgToUIThread(render_process_id_, message)) |
164 #endif | 171 #endif |
165 IPC_MESSAGE_HANDLER_DELAY_REPLY(ChildProcessHostMsg_HasGpuProcess, | 172 IPC_MESSAGE_HANDLER_DELAY_REPLY(ChildProcessHostMsg_HasGpuProcess, |
166 OnHasGpuProcess) | 173 OnHasGpuProcess) |
167 #if defined(OS_LINUX) | 174 #if defined(OS_LINUX) |
168 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SetThreadPriority, | 175 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SetThreadPriority, |
169 OnSetThreadPriority) | 176 OnSetThreadPriority) |
170 #endif | 177 #endif |
171 IPC_MESSAGE_HANDLER(RenderProcessHostMsg_DidGenerateCacheableMetadata, | 178 IPC_MESSAGE_HANDLER(RenderProcessHostMsg_DidGenerateCacheableMetadata, |
172 OnCacheableMetadataAvailable) | 179 OnCacheableMetadataAvailable) |
173 IPC_MESSAGE_HANDLER( | 180 IPC_MESSAGE_HANDLER( |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 } | 359 } |
353 | 360 |
354 void RenderMessageFilter::GetHasGpuProcessCallback( | 361 void RenderMessageFilter::GetHasGpuProcessCallback( |
355 std::unique_ptr<IPC::Message> reply, | 362 std::unique_ptr<IPC::Message> reply, |
356 bool has_gpu) { | 363 bool has_gpu) { |
357 ChildProcessHostMsg_HasGpuProcess::WriteReplyParams(reply.get(), has_gpu); | 364 ChildProcessHostMsg_HasGpuProcess::WriteReplyParams(reply.get(), has_gpu); |
358 Send(reply.release()); | 365 Send(reply.release()); |
359 } | 366 } |
360 | 367 |
361 } // namespace content | 368 } // namespace content |
OLD | NEW |