Changeset 90572 in webkit
- Timestamp:
- Jul 7, 2011 10:27:33 AM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r90550 r90572 1 2011-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 1 33 2011-07-07 Benjamin Poulain <benjamin@webkit.org> 2 34 -
trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp
r90458 r90572 31 31 : q(q) 32 32 , page(this, contextRef ? new QWKContext(contextRef) : defaultWKContext(), pageGroupRef) 33 , isCrashed(false) 33 34 { 34 35 } … … 190 191 } 191 192 193 static 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 192 199 void QDesktopWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget*) 193 200 { 201 if (d->isCrashed) { 202 paintCrashedPage(painter, option); 203 return; 204 } 205 194 206 d->page.paint(painter, option->exposedRect.toAlignedRect()); 195 207 } … … 206 218 return d->page.pageRef(); 207 219 } 220 221 void QDesktopWebViewPrivate::processDidCrash() 222 { 223 isCrashed = true; 224 q->update(); 225 } 226 227 void QDesktopWebViewPrivate::didRelaunchProcess() 228 { 229 isCrashed = false; 230 q->update(); 231 } -
trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview_p.h
r90458 r90572 37 37 QDesktopWebPageProxy page; 38 38 39 bool isCrashed; 40 39 41 private: 40 42 /* Implementation of ViewInterface */ … … 64 66 virtual void hideContextMenu(); 65 67 68 virtual void processDidCrash(); 69 virtual void didRelaunchProcess(); 70 66 71 QSharedPointer<QMenu> activeMenu; 67 72 }; -
trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp
r90458 r90572 125 125 , m_preferences(0) 126 126 , m_createNewPageFn(0) 127 , m_isConnectedToEngine(true)128 127 #ifndef QT_NO_UNDOSTACK 129 128 , m_undoStack(adoptPtr(new QUndoStack(this))) … … 546 545 void QtWebPageProxy::didRelaunchProcess() 547 546 { 547 m_viewInterface->didRelaunchProcess(); 548 548 setDrawingAreaSize(m_viewInterface->drawingAreaSize()); 549 550 m_isConnectedToEngine = true;551 549 } 552 550 553 551 void QtWebPageProxy::processDidCrash() 554 552 { 555 m_ isConnectedToEngine = false;553 m_viewInterface->processDidCrash(); 556 554 } 557 555 … … 804 802 } 805 803 806 bool QtWebPageProxy::isConnectedToEngine() const807 {808 return m_isConnectedToEngine;809 }810 811 804 void QtWebPageProxy::setPageIsVisible(bool isVisible) 812 805 { -
trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.h
r90458 r90572 190 190 void findZoomableAreaForPoint(const QPoint&); 191 191 192 bool isConnectedToEngine() const;193 194 192 void setPageIsVisible(bool); 195 193 … … 224 222 CreateNewPageFn m_createNewPageFn; 225 223 226 bool m_isConnectedToEngine;227 228 224 #ifndef QT_NO_UNDOSTACK 229 225 OwnPtr<QUndoStack> m_undoStack; -
trunk/Source/WebKit2/UIProcess/qt/TouchViewInterface.cpp
r90458 r90572 113 113 void TouchViewInterface::showContextMenu(QSharedPointer<QMenu>) 114 114 { 115 // TODO115 // FIXME 116 116 } 117 117 118 118 void TouchViewInterface::hideContextMenu() 119 119 { 120 // TODO 120 // FIXME 121 } 122 123 void TouchViewInterface::processDidCrash() 124 { 125 // FIXME 126 } 127 128 void TouchViewInterface::didRelaunchProcess() 129 { 130 // FIXME 121 131 } 122 132 -
trunk/Source/WebKit2/UIProcess/qt/TouchViewInterface.h
r90458 r90572 61 61 virtual void showContextMenu(QSharedPointer<QMenu>); 62 62 virtual void hideContextMenu(); 63 64 virtual void processDidCrash(); 65 virtual void didRelaunchProcess(); 66 63 67 private: 64 68 QTouchWebView* const m_viewportView; -
trunk/Source/WebKit2/UIProcess/qt/ViewInterface.h
r90458 r90572 67 67 virtual void hideContextMenu() = 0; 68 68 69 virtual void processDidCrash() = 0; 70 virtual void didRelaunchProcess() = 0; 71 69 72 protected: 70 73 /* Utility functions for the implementations. */
Note: See TracChangeset
for help on using the changeset viewer.