Title: [142219] trunk/Source/WebCore
Revision
142219
Author
[email protected]
Date
2013-02-07 18:41:21 -0800 (Thu, 07 Feb 2013)

Log Message

[Gtk] RunLoop::run shuold run current thread's run loop.
https://bugs.webkit.org/show_bug.cgi?id=107887

Patch by Seulgi Kim <[email protected]> on 2013-02-07
Reviewed by Martin Robinson.

Currently, RunLoop in Gtk can use just main thread's event loop.
But the other ports are implemented to use RunLoop in sub threads.

This patch makes RunLoop constructor create new context, not use default
context.
But in the main thread still uses default context to use main event loop
since there is some codes using glib directly (e.g. in
LayerTreeHostGtk::scheduleLayerFlush).

No new tests. There is no case that uses RunLoop in off the main thread
yet.

* platform/gtk/RunLoopGtk.cpp:
(WebCore::RunLoop::RunLoop):
(WebCore::RunLoop::run):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (142218 => 142219)


--- trunk/Source/WebCore/ChangeLog	2013-02-08 02:29:58 UTC (rev 142218)
+++ trunk/Source/WebCore/ChangeLog	2013-02-08 02:41:21 UTC (rev 142219)
@@ -1,3 +1,26 @@
+2013-02-07  Seulgi Kim  <[email protected]>
+
+        [Gtk] RunLoop::run shuold run current thread's run loop.
+        https://bugs.webkit.org/show_bug.cgi?id=107887
+
+        Reviewed by Martin Robinson.
+
+        Currently, RunLoop in Gtk can use just main thread's event loop.
+        But the other ports are implemented to use RunLoop in sub threads.
+
+        This patch makes RunLoop constructor create new context, not use default
+        context.
+        But in the main thread still uses default context to use main event loop
+        since there is some codes using glib directly (e.g. in
+        LayerTreeHostGtk::scheduleLayerFlush).
+
+        No new tests. There is no case that uses RunLoop in off the main thread
+        yet.
+
+        * platform/gtk/RunLoopGtk.cpp:
+        (WebCore::RunLoop::RunLoop):
+        (WebCore::RunLoop::run):
+
 2013-02-07  Kentaro Hara  <[email protected]>
 
         [V8] Move V8DOMWrapper::setNamedHiddenReference() to V8HiddenPropertyName.h

Modified: trunk/Source/WebCore/platform/gtk/RunLoopGtk.cpp (142218 => 142219)


--- trunk/Source/WebCore/platform/gtk/RunLoopGtk.cpp	2013-02-08 02:29:58 UTC (rev 142218)
+++ trunk/Source/WebCore/platform/gtk/RunLoopGtk.cpp	2013-02-08 02:41:21 UTC (rev 142219)
@@ -30,12 +30,14 @@
 #include <gdk/gdk.h>
 #include <glib.h>
 
+#include <wtf/MainThread.h>
+
 namespace WebCore {
 
 RunLoop::RunLoop()
 {
     // g_main_context_default() doesn't add an extra reference.
-    m_runLoopContext = g_main_context_default();
+    m_runLoopContext = isMainThread() ? g_main_context_default() : adoptGRef(g_main_context_new());
     ASSERT(m_runLoopContext);
     GRefPtr<GMainLoop> innermostLoop = adoptGRef(g_main_loop_new(m_runLoopContext.get(), FALSE));
     ASSERT(innermostLoop);
@@ -53,7 +55,7 @@
 
 void RunLoop::run()
 {
-    RunLoop* mainRunLoop = RunLoop::main();
+    RunLoop* mainRunLoop = RunLoop::current();
     GMainLoop* innermostLoop = mainRunLoop->innermostLoop();
     if (!g_main_loop_is_running(innermostLoop)) {
         g_main_loop_run(innermostLoop);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to