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

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

Issue 8229039: Make shared memory allocation possible for all child process types. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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
Index: content/browser/renderer_host/render_message_filter.cc
===================================================================
--- content/browser/renderer_host/render_message_filter.cc (revision 104763)
+++ content/browser/renderer_host/render_message_filter.cc (working copy)
@@ -361,8 +361,8 @@
render_widget_helper_->DidReceiveUpdateMsg(message))
IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_CheckPermission,
OnCheckNotificationPermission)
- IPC_MESSAGE_HANDLER(ViewHostMsg_AllocateSharedMemoryBuffer,
- OnAllocateSharedMemoryBuffer)
+ IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateSharedMemory,
+ OnAllocateSharedMemory)
#if defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(ViewHostMsg_AllocTransportDIB, OnAllocTransportDIB)
IPC_MESSAGE_HANDLER(ViewHostMsg_FreeTransportDIB, OnFreeTransportDIB)
@@ -651,16 +651,11 @@
CheckDesktopNotificationPermission(source_url, resource_context_);
}
-void RenderMessageFilter::OnAllocateSharedMemoryBuffer(
- uint32 buffer_size,
+void RenderMessageFilter::OnAllocateSharedMemory(
+ size_t buffer_size,
base::SharedMemoryHandle* handle) {
- base::SharedMemory shared_buf;
- if (!shared_buf.CreateAndMapAnonymous(buffer_size)) {
- *handle = base::SharedMemory::NULLHandle();
- NOTREACHED() << "Cannot map shared memory buffer";
- return;
- }
- shared_buf.GiveToProcess(peer_handle(), handle);
+ ChildProcessHost::OnAllocateSharedMemory(
+ buffer_size, peer_handle(), handle);
}
net::URLRequestContext* RenderMessageFilter::GetRequestContextForURL(

Powered by Google App Engine
This is Rietveld 408576698