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

Unified Diff: content/browser/renderer_host/render_message_filter.cc

Issue 2491763003: Revert of Removing the ChildProcessHostMsg_SyncAllocateSharedMemory IPC message. (Closed)
Patch Set: Created 4 years, 1 month 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 | « content/browser/renderer_host/render_message_filter.h ('k') | content/child/child_thread_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_message_filter.cc
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index ca45695628440e106c60e128fab4b823730398f2..78db5e2017cdbf8747b73a848798e8fdcbcf9c7c 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -183,9 +183,11 @@
ViewHostMsg_SetNeedsBeginFrames,
ResizeHelperPostMsgToUIThread(render_process_id_, message))
#endif
- // NB: The SyncAllocateGpuMemoryBuffer and DeletedGpuMemoryBuffer IPCs are
- // handled here for renderer processes. For non-renderer child processes,
- // they are handled in ChildProcessHostImpl.
+ // NB: The SyncAllocateSharedMemory, SyncAllocateGpuMemoryBuffer, and
+ // DeletedGpuMemoryBuffer IPCs are handled here for renderer processes. For
+ // non-renderer child processes, they are handled in ChildProcessHostImpl.
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(
+ ChildProcessHostMsg_SyncAllocateSharedMemory, OnAllocateSharedMemory)
IPC_MESSAGE_HANDLER_DELAY_REPLY(
ChildProcessHostMsg_SyncAllocateSharedBitmap, OnAllocateSharedBitmap)
IPC_MESSAGE_HANDLER_DELAY_REPLY(
@@ -334,6 +336,25 @@
#endif // defined(OS_MACOSX)
+void RenderMessageFilter::AllocateSharedMemoryOnFileThread(
+ uint32_t buffer_size,
+ IPC::Message* reply_msg) {
+ base::SharedMemoryHandle handle;
+ ChildProcessHostImpl::AllocateSharedMemory(buffer_size, PeerHandle(),
+ &handle);
+ ChildProcessHostMsg_SyncAllocateSharedMemory::WriteReplyParams(reply_msg,
+ handle);
+ Send(reply_msg);
+}
+
+void RenderMessageFilter::OnAllocateSharedMemory(uint32_t buffer_size,
+ IPC::Message* reply_msg) {
+ BrowserThread::PostTask(
+ BrowserThread::FILE_USER_BLOCKING, FROM_HERE,
+ base::Bind(&RenderMessageFilter::AllocateSharedMemoryOnFileThread, this,
+ buffer_size, reply_msg));
+}
+
void RenderMessageFilter::AllocateSharedBitmapOnFileThread(
uint32_t buffer_size,
const cc::SharedBitmapId& id,
« no previous file with comments | « content/browser/renderer_host/render_message_filter.h ('k') | content/child/child_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698