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

Unified Diff: content/common/child_thread.cc

Issue 11410019: ********** Chromium Blob hacking (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years 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/common/child_thread.cc
===================================================================
--- content/common/child_thread.cc (revision 171309)
+++ content/common/child_thread.cc (working copy)
@@ -192,6 +192,13 @@
return resource_dispatcher()->CreateBridge(request_info);
}
+static bool SendFromAnyThread(ChildThread* child_thread, IPC::Message* msg) {
+ if (child_thread->message_loop() == MessageLoop::current())
+ child_thread->Send(msg);
+ else
+ child_thread->sync_message_filter()->Send(msg);
+}
kinuko 2013/01/07 08:52:01 This change can probably be landed independently?
+
base::SharedMemory* ChildThread::AllocateSharedMemory(
size_t buf_size) {
scoped_ptr<base::SharedMemory> shared_buf;
@@ -205,7 +212,7 @@
// On POSIX, we need to ask the browser to create the shared memory for us,
// since this is blocked by the sandbox.
base::SharedMemoryHandle shared_mem_handle;
- if (Send(new ChildProcessHostMsg_SyncAllocateSharedMemory(
+ if (SendFromAnyThread(new ChildProcessHostMsg_SyncAllocateSharedMemory(
buf_size, &shared_mem_handle))) {
if (base::SharedMemory::IsHandleValid(shared_mem_handle)) {
shared_buf.reset(new base::SharedMemory(shared_mem_handle, false));

Powered by Google App Engine
This is Rietveld 408576698