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

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
« no previous file with comments | « content/browser/renderer_host/render_message_filter.h ('k') | content/common/child_process_host.h » ('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
===================================================================
--- content/browser/renderer_host/render_message_filter.cc (revision 105562)
+++ content/browser/renderer_host/render_message_filter.cc (working copy)
@@ -29,6 +29,8 @@
#include "content/browser/renderer_host/render_widget_helper.h"
#include "content/browser/resource_context.h"
#include "content/browser/user_metrics.h"
+#include "content/common/child_process_host.h"
+#include "content/common/child_process_messages.h"
#include "content/common/desktop_notification_messages.h"
#include "content/common/notification_service.h"
#include "content/common/view_messages.h"
@@ -62,10 +64,6 @@
#if defined(OS_POSIX)
#include "base/file_descriptor_posix.h"
#endif
-#if defined(OS_WIN)
-#include "content/common/child_process_host.h"
-#include "content/common/child_process_messages.h"
-#endif
using net::CookieStore;
using content::PluginServiceFilter;
@@ -348,8 +346,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)
@@ -638,16 +636,11 @@
CheckDesktopNotificationPermission(source_url, resource_context_);
}
-void RenderMessageFilter::OnAllocateSharedMemoryBuffer(
+void RenderMessageFilter::OnAllocateSharedMemory(
uint32 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(
« no previous file with comments | « content/browser/renderer_host/render_message_filter.h ('k') | content/common/child_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698