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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 12356002: [NOT FOR COMMIT] Hacks to merge render compositor thread with UI thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New thread restriction allows (incomplete patch) Created 7 years, 10 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/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;
}

Powered by Google App Engine
This is Rietveld 408576698