Changeset 72077 in webkit


Ignore:
Timestamp:
Nov 16, 2010 3:50:02 AM (13 years ago)
Author:
andreas.kling@nokia.com
Message:

2010-11-15 Andreas Kling <kling@webkit.org>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Kill the web process if the UI process dies

Connect UI (parent) process death signal to SIGKILL of the web
process (child). This ensures that there's no stale web processes
after the UI process has crashed.

Original patch by Kimmo Kinnunen.

  • UIProcess/Launcher/qt/ProcessLauncherQt.cpp: (WebKit::QtWebProcess::QtWebProcess): (WebKit::QtWebProcess::setupChildProcess): (WebKit::ProcessLauncherHelper::launch):
Location:
trunk/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r72074 r72077  
     12010-11-15  Andreas Kling  <kling@webkit.org>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Kill the web process if the UI process dies
     6
     7        Connect UI (parent) process death signal to SIGKILL of the web
     8        process (child). This ensures that there's no stale web processes
     9        after the UI process has crashed.
     10
     11        Original patch by Kimmo Kinnunen.
     12
     13        * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
     14        (WebKit::QtWebProcess::QtWebProcess):
     15        (WebKit::QtWebProcess::setupChildProcess):
     16        (WebKit::ProcessLauncherHelper::launch):
     17
    1182010-11-16  Simon Hausmann  <simon.hausmann@nokia.com>
    219
  • trunk/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp

    r71409 r72077  
    4848#include <sys/resource.h>
    4949#include <unistd.h>
     50#if defined Q_OS_UNIX
     51#include <sys/prctl.h>
     52#include <signal.h>
     53#endif
    5054
    5155using namespace WebCore;
     
    6872};
    6973
     74class QtWebProcess : public QProcess
     75{
     76    Q_OBJECT
     77public:
     78    QtWebProcess(QObject* parent = 0)
     79        : QProcess(parent)
     80    {}
     81
     82protected:
     83    virtual void setupChildProcess();
     84};
     85
     86void QtWebProcess::setupChildProcess()
     87{
     88#if defined Q_OS_UNIX
     89    prctl(PR_SET_PDEATHSIG, SIGKILL);
     90#endif
     91}
     92
    7093void ProcessLauncherHelper::launch(WebKit::ProcessLauncher* launcher)
    7194{
     
    80103    QString program(applicationPath.arg(m_server.serverName()));
    81104
    82     QProcess* webProcess = new QProcess();
     105    QProcess* webProcess = new QtWebProcess();
    83106    webProcess->setProcessChannelMode(QProcess::ForwardedChannels);
    84107    webProcess->start(program);
Note: See TracChangeset for help on using the changeset viewer.