Changeset 89433 in webkit


Ignore:
Timestamp:
Jun 22, 2011 8:44:04 AM (13 years ago)
Author:
Carlos Garcia Campos
Message:

2011-06-22 Carlos Garcia Campos <cgarcia@igalia.com>

Reviewed by Martin Robinson.

[GTK] Remove Connection::setShouldCloseConnectionOnProcessTermination()
https://bugs.webkit.org/show_bug.cgi?id=61627

Don't use Connection::setShouldCloseConnectionOnProcessTermination() for the
GTK port, when the process finishes the connection is closed and
the other process is already notified. We still need to monitor
the child process so that it doesn't become a zombie when it dntabi

  • Platform/CoreIPC/Connection.h:
  • Platform/CoreIPC/unix/ConnectionUnix.cpp:
  • UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp: (WebKit::childFinishedFunction): (WebKit::ProcessLauncher::launchProcess):
  • UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didFinishLaunching):
Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r89430 r89433  
     12011-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        [GTK] Remove Connection::setShouldCloseConnectionOnProcessTermination()
     6        https://bugs.webkit.org/show_bug.cgi?id=61627
     7
     8        Don't use Connection::setShouldCloseConnectionOnProcessTermination() for the
     9        GTK port, when the process finishes the connection is closed and
     10        the other process is already notified. We still need to monitor
     11        the child process so that it doesn't become a zombie when it dntabi
     12
     13        * Platform/CoreIPC/Connection.h:
     14        * Platform/CoreIPC/unix/ConnectionUnix.cpp:
     15        * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
     16        (WebKit::childFinishedFunction):
     17        (WebKit::ProcessLauncher::launchProcess):
     18        * UIProcess/WebProcessProxy.cpp:
     19        (WebKit::WebProcessProxy::didFinishLaunching):
     20
    1212011-06-20  Dimitri Glazkov  <dglazkov@chromium.org>
    222
  • trunk/Source/WebKit2/Platform/CoreIPC/Connection.h

    r88588 r89433  
    119119#if PLATFORM(MAC)
    120120    void setShouldCloseConnectionOnMachExceptions();
    121 #elif PLATFORM(QT) || PLATFORM(GTK)
     121#elif PLATFORM(QT)
    122122    void setShouldCloseConnectionOnProcessTermination(WebKit::PlatformProcessIdentifier);
    123123#endif
  • trunk/Source/WebKit2/Platform/CoreIPC/unix/ConnectionUnix.cpp

    r88147 r89433  
    458458}
    459459
    460 #if PLATFORM(QT) || PLATFORM(GTK)
     460#if PLATFORM(QT)
    461461void Connection::setShouldCloseConnectionOnProcessTermination(WebKit::PlatformProcessIdentifier process)
    462462{
  • trunk/Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp

    r88147 r89433  
    5757}
    5858
     59static void childFinishedFunction(GPid, gint status, gpointer userData)
     60{
     61    if (WIFEXITED(status) && !WEXITSTATUS(status))
     62        return;
     63
     64    close(GPOINTER_TO_INT(userData));
     65}
     66
    5967void ProcessLauncher::launchProcess()
    6068{
     
    8492    close(sockets[0]);
    8593    m_processIdentifier = pid;
     94
     95    // Monitor the child process, it calls waitpid to prevent the child process from becomming a zombie,
     96    // and it allows us to close the socket when the child process crashes.
     97    g_child_watch_add(m_processIdentifier, childFinishedFunction, GINT_TO_POINTER(sockets[1]));
     98
    8699    // We've finished launching the process, message back to the main run loop.
    87100    RunLoop::main()->scheduleWork(WorkItem::create(this, &ProcessLauncher::didFinishLaunchingProcess, m_processIdentifier, sockets[1]));
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp

    r86945 r89433  
    353353#if PLATFORM(MAC)
    354354    m_connection->setShouldCloseConnectionOnMachExceptions();
    355 #elif PLATFORM(QT) || PLATFORM(GTK)
     355#elif PLATFORM(QT)
    356356    m_connection->setShouldCloseConnectionOnProcessTermination(processIdentifier());
    357357#endif
Note: See TracChangeset for help on using the changeset viewer.