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

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

Issue 1018953005: Do AllocateSharedMemory on FILE_USER_BLOCKING thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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') | no next file » | 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 9b61d528db3af68f620adf06233d50dd546a7f94..bca2643ff9ce3e00801f3e4c7f4c38512e515032 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -405,8 +405,8 @@ bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message) {
RenderWidgetResizeHelper::Get()->PostRendererProcessMsg(
render_process_id_, message))
#endif
- IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateSharedMemory,
- OnAllocateSharedMemory)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(
+ ChildProcessHostMsg_SyncAllocateSharedMemory, OnAllocateSharedMemory)
IPC_MESSAGE_HANDLER_DELAY_REPLY(
ChildProcessHostMsg_SyncAllocateSharedBitmap, OnAllocateSharedBitmap)
IPC_MESSAGE_HANDLER_DELAY_REPLY(
@@ -909,11 +909,23 @@ void RenderMessageFilter::OnSaveImageFromDataURL(int render_view_id,
DownloadUrl(render_view_id, data_url, Referrer(), base::string16(), true);
}
-void RenderMessageFilter::OnAllocateSharedMemory(
+void RenderMessageFilter::AllocateSharedMemoryOnFileThread(
uint32 buffer_size,
- base::SharedMemoryHandle* handle) {
- ChildProcessHostImpl::AllocateSharedMemory(
- buffer_size, PeerHandle(), handle);
+ 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 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(
« no previous file with comments | « content/browser/renderer_host/render_message_filter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698