Changeset 142219 in webkit


Ignore:
Timestamp:
Feb 7, 2013 6:41:21 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Seulgi Kim <seulgikim@company100.net> 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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r142217 r142219  
     12013-02-07  Seulgi Kim  <seulgikim@company100.net>
     2
     3        [Gtk] RunLoop::run shuold run current thread's run loop.
     4        https://bugs.webkit.org/show_bug.cgi?id=107887
     5
     6        Reviewed by Martin Robinson.
     7
     8        Currently, RunLoop in Gtk can use just main thread's event loop.
     9        But the other ports are implemented to use RunLoop in sub threads.
     10
     11        This patch makes RunLoop constructor create new context, not use default
     12        context.
     13        But in the main thread still uses default context to use main event loop
     14        since there is some codes using glib directly (e.g. in
     15        LayerTreeHostGtk::scheduleLayerFlush).
     16
     17        No new tests. There is no case that uses RunLoop in off the main thread
     18        yet.
     19
     20        * platform/gtk/RunLoopGtk.cpp:
     21        (WebCore::RunLoop::RunLoop):
     22        (WebCore::RunLoop::run):
     23
    1242013-02-07  Kentaro Hara  <haraken@chromium.org>
    225
  • trunk/Source/WebCore/platform/gtk/RunLoopGtk.cpp

    r109161 r142219  
    3131#include <glib.h>
    3232
     33#include <wtf/MainThread.h>
     34
    3335namespace WebCore {
    3436
     
    3638{
    3739    // g_main_context_default() doesn't add an extra reference.
    38     m_runLoopContext = g_main_context_default();
     40    m_runLoopContext = isMainThread() ? g_main_context_default() : adoptGRef(g_main_context_new());
    3941    ASSERT(m_runLoopContext);
    4042    GRefPtr<GMainLoop> innermostLoop = adoptGRef(g_main_loop_new(m_runLoopContext.get(), FALSE));
     
    5456void RunLoop::run()
    5557{
    56     RunLoop* mainRunLoop = RunLoop::main();
     58    RunLoop* mainRunLoop = RunLoop::current();
    5759    GMainLoop* innermostLoop = mainRunLoop->innermostLoop();
    5860    if (!g_main_loop_is_running(innermostLoop)) {
Note: See TracChangeset for help on using the changeset viewer.