Changeset 90572 in webkit


Ignore:
Timestamp:
Jul 7, 2011 10:27:33 AM (13 years ago)
Author:
andreas.kling@nokia.com
Message:

[Qt][WK2] Views should know about WebProcess crash/relaunch.
https://bugs.webkit.org/show_bug.cgi?id=64093

Reviewed by Benjamin Poulain.

Add processDidCrash() and didRelaunchProcess() to ViewInterface.

QDesktopWebView now displays a simple sad smiley ":(" when the
web process crashes.

  • UIProcess/API/qt/qdesktopwebview.cpp:

(QDesktopWebViewPrivate::QDesktopWebViewPrivate):
(paintCrashedPage):
(QDesktopWebView::paint):
(QDesktopWebViewPrivate::processDidCrash):
(QDesktopWebViewPrivate::didRelaunchProcess):

  • UIProcess/API/qt/qdesktopwebview_p.h:
  • UIProcess/qt/QtWebPageProxy.cpp:

(QtWebPageProxy::QtWebPageProxy):
(QtWebPageProxy::didRelaunchProcess):
(QtWebPageProxy::processDidCrash):

  • UIProcess/qt/QtWebPageProxy.h:
  • UIProcess/qt/TouchViewInterface.cpp:

(WebKit::TouchViewInterface::showContextMenu):
(WebKit::TouchViewInterface::hideContextMenu):
(WebKit::TouchViewInterface::processDidCrash):
(WebKit::TouchViewInterface::didRelaunchProcess):

  • UIProcess/qt/TouchViewInterface.h:
  • UIProcess/qt/ViewInterface.h:
Location:
trunk/Source/WebKit2
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r90550 r90572  
     12011-07-07  Andreas Kling  <kling@webkit.org>
     2
     3        [Qt][WK2] Views should know about WebProcess crash/relaunch.
     4        https://bugs.webkit.org/show_bug.cgi?id=64093
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Add processDidCrash() and didRelaunchProcess() to ViewInterface.
     9
     10        QDesktopWebView now displays a simple sad smiley ":(" when the
     11        web process crashes.
     12
     13        * UIProcess/API/qt/qdesktopwebview.cpp:
     14        (QDesktopWebViewPrivate::QDesktopWebViewPrivate):
     15        (paintCrashedPage):
     16        (QDesktopWebView::paint):
     17        (QDesktopWebViewPrivate::processDidCrash):
     18        (QDesktopWebViewPrivate::didRelaunchProcess):
     19        * UIProcess/API/qt/qdesktopwebview_p.h:
     20        * UIProcess/qt/QtWebPageProxy.cpp:
     21        (QtWebPageProxy::QtWebPageProxy):
     22        (QtWebPageProxy::didRelaunchProcess):
     23        (QtWebPageProxy::processDidCrash):
     24        * UIProcess/qt/QtWebPageProxy.h:
     25        * UIProcess/qt/TouchViewInterface.cpp:
     26        (WebKit::TouchViewInterface::showContextMenu):
     27        (WebKit::TouchViewInterface::hideContextMenu):
     28        (WebKit::TouchViewInterface::processDidCrash):
     29        (WebKit::TouchViewInterface::didRelaunchProcess):
     30        * UIProcess/qt/TouchViewInterface.h:
     31        * UIProcess/qt/ViewInterface.h:
     32
    1332011-07-07  Benjamin Poulain  <benjamin@webkit.org>
    234
  • trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp

    r90458 r90572  
    3131    : q(q)
    3232    , page(this, contextRef ? new QWKContext(contextRef) : defaultWKContext(), pageGroupRef)
     33    , isCrashed(false)
    3334{
    3435}
     
    190191}
    191192
     193static void paintCrashedPage(QPainter* painter, const QStyleOptionGraphicsItem* option)
     194{
     195    painter->fillRect(option->rect, Qt::gray);
     196    painter->drawText(option->rect, Qt::AlignCenter, QLatin1String(":("));
     197}
     198
    192199void QDesktopWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget*)
    193200{
     201    if (d->isCrashed) {
     202        paintCrashedPage(painter, option);
     203        return;
     204    }
     205
    194206    d->page.paint(painter, option->exposedRect.toAlignedRect());
    195207}
     
    206218    return d->page.pageRef();
    207219}
     220
     221void QDesktopWebViewPrivate::processDidCrash()
     222{
     223    isCrashed = true;
     224    q->update();
     225}
     226
     227void QDesktopWebViewPrivate::didRelaunchProcess()
     228{
     229    isCrashed = false;
     230    q->update();
     231}
  • trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview_p.h

    r90458 r90572  
    3737    QDesktopWebPageProxy page;
    3838
     39    bool isCrashed;
     40
    3941private:
    4042    /* Implementation of ViewInterface */
     
    6466    virtual void hideContextMenu();
    6567
     68    virtual void processDidCrash();
     69    virtual void didRelaunchProcess();
     70
    6671    QSharedPointer<QMenu> activeMenu;
    6772};
  • trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp

    r90458 r90572  
    125125    , m_preferences(0)
    126126    , m_createNewPageFn(0)
    127     , m_isConnectedToEngine(true)
    128127#ifndef QT_NO_UNDOSTACK
    129128    , m_undoStack(adoptPtr(new QUndoStack(this)))
     
    546545void QtWebPageProxy::didRelaunchProcess()
    547546{
     547    m_viewInterface->didRelaunchProcess();
    548548    setDrawingAreaSize(m_viewInterface->drawingAreaSize());
    549 
    550     m_isConnectedToEngine = true;
    551549}
    552550
    553551void QtWebPageProxy::processDidCrash()
    554552{
    555     m_isConnectedToEngine = false;
     553    m_viewInterface->processDidCrash();
    556554}
    557555
     
    804802}
    805803
    806 bool QtWebPageProxy::isConnectedToEngine() const
    807 {
    808     return m_isConnectedToEngine;
    809 }
    810 
    811804void QtWebPageProxy::setPageIsVisible(bool isVisible)
    812805{
  • trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.h

    r90458 r90572  
    190190    void findZoomableAreaForPoint(const QPoint&);
    191191
    192     bool isConnectedToEngine() const;
    193 
    194192    void setPageIsVisible(bool);
    195193
     
    224222    CreateNewPageFn m_createNewPageFn;
    225223
    226     bool m_isConnectedToEngine;
    227 
    228224#ifndef QT_NO_UNDOSTACK
    229225    OwnPtr<QUndoStack> m_undoStack;
  • trunk/Source/WebKit2/UIProcess/qt/TouchViewInterface.cpp

    r90458 r90572  
    113113void TouchViewInterface::showContextMenu(QSharedPointer<QMenu>)
    114114{
    115     // TODO
     115    // FIXME
    116116}
    117117
    118118void TouchViewInterface::hideContextMenu()
    119119{
    120     // TODO
     120    // FIXME
     121}
     122
     123void TouchViewInterface::processDidCrash()
     124{
     125    // FIXME
     126}
     127
     128void TouchViewInterface::didRelaunchProcess()
     129{
     130    // FIXME
    121131}
    122132
  • trunk/Source/WebKit2/UIProcess/qt/TouchViewInterface.h

    r90458 r90572  
    6161    virtual void showContextMenu(QSharedPointer<QMenu>);
    6262    virtual void hideContextMenu();
     63
     64    virtual void processDidCrash();
     65    virtual void didRelaunchProcess();
     66
    6367private:
    6468    QTouchWebView* const m_viewportView;
  • trunk/Source/WebKit2/UIProcess/qt/ViewInterface.h

    r90458 r90572  
    6767    virtual void hideContextMenu() = 0;
    6868
     69    virtual void processDidCrash() = 0;
     70    virtual void didRelaunchProcess() = 0;
     71
    6972protected:
    7073    /* Utility functions for the implementations. */
Note: See TracChangeset for help on using the changeset viewer.