Chromium Code Reviews| Index: content/renderer/render_thread_impl.cc |
| diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc |
| index 0e3e9c866bc958e597206a3aa7f09df11e3550ee..b101bf415d15edc3f938c964921b604b59a551fd 100644 |
| --- a/content/renderer/render_thread_impl.cc |
| +++ b/content/renderer/render_thread_impl.cc |
| @@ -99,6 +99,8 @@ |
| #include "v8/include/v8.h" |
| #include "webkit/glue/webkit_glue.h" |
| +#include "base/threading/thread_restrictions.h" |
| + |
| #if defined(OS_WIN) |
| #include <windows.h> |
| #include <objbase.h> |
| @@ -765,10 +767,13 @@ scoped_ptr<base::SharedMemory> |
| new ChildProcessHostMsg_SyncAllocateSharedMemory(size, &handle); |
| // Allow calling this from the compositor thread. |
| - if (MessageLoop::current() == message_loop()) |
| + if (MessageLoop::current() == message_loop()) { |
| success = ChildThread::Send(message); |
| - else |
| + } else { |
| + // This one should be ok... |
| + base::ThreadRestrictions::ScopedAllowWait allow_wait; |
|
boliu
2013/03/01 00:19:12
This one just allocates shared mem and does not us
|
| success = sync_message_filter()->Send(message); |
| + } |
| if (!success) |
| return scoped_ptr<base::SharedMemory>(); |
| @@ -1005,10 +1010,12 @@ int32 RenderThreadImpl::CreateViewCommandBuffer( |
| &route_id); |
| // Allow calling this from the compositor thread. |
| - if (MessageLoop::current() == message_loop()) |
| + if (MessageLoop::current() == message_loop()) { |
| ChildThread::Send(message); |
| - else |
| + } else { |
| + base::ThreadRestrictions::ScopedAllowWait allow_wait; |
|
boliu
2013/03/01 00:19:12
potential deadlock? See comment in gpu_message_fil
|
| sync_message_filter()->Send(message); |
| + } |
| return route_id; |
| } |