Commit a5af4027 authored by kenneth@webkit.org's avatar kenneth@webkit.org

Print warning for the Qt port when a process crashes and is relaunched

https://bugs.webkit.org/show_bug.cgi?id=72607

Reviewed by Antonio Gomes.

Make the QtViewInterface::processDidCrash take a URL string argument,
for being able to say which url was the origin of the crash.

We now additionally store the load state and url at process exit. This
is needed for printing the warning and for further crash handling.

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidCrash):
* UIProcess/qt/QtViewInterface.cpp:
(WebKit::QtViewInterface::processDidCrash):
(WebKit::QtViewInterface::didRelaunchProcess):
* UIProcess/qt/QtViewInterface.h:
* UIProcess/qt/QtWebPageProxy.cpp:
(QtWebPageProxy::processDidCrash):
* UIProcess/qt/QtWebPageProxy.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 93943475
2011-11-17 Kenneth Rohde Christiansen <kenneth@webkit.org>
Print warning for the Qt port when a process crashes and is relaunched
https://bugs.webkit.org/show_bug.cgi?id=72607
Reviewed by Antonio Gomes.
Make the QtViewInterface::processDidCrash take a URL string argument,
for being able to say which url was the origin of the crash.
We now additionally store the load state and url at process exit. This
is needed for printing the warning and for further crash handling.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidCrash):
* UIProcess/qt/QtViewInterface.cpp:
(WebKit::QtViewInterface::processDidCrash):
(WebKit::QtViewInterface::didRelaunchProcess):
* UIProcess/qt/QtViewInterface.h:
* UIProcess/qt/QtWebPageProxy.cpp:
(QtWebPageProxy::processDidCrash):
* UIProcess/qt/QtWebPageProxy.h:
2011-11-17 Alexis Menard <alexis.menard@openbossa.org>
[Qt][WK2] Cleanup dead code in QtWebPageProxy.
......
......@@ -150,6 +150,7 @@ WebPageProxy::WebPageProxy(PageClient* pageClient, PassRefPtr<WebProcessProxy> p
, m_isInWindow(m_pageClient->isViewInWindow())
, m_isVisible(m_pageClient->isViewVisible())
, m_backForwardList(WebBackForwardList::create(this))
, m_loadStateAtProcessExit(WebFrameProxy::LoadStateFinished)
, m_textZoomFactor(1)
, m_pageZoomFactor(1)
, m_pageScaleFactor(1)
......@@ -3077,6 +3078,11 @@ void WebPageProxy::processDidCrash()
m_isValid = false;
if (m_mainFrame) {
m_urlAtProcessExit = m_mainFrame->url();
m_loadStateAtProcessExit = m_mainFrame->loadState();
}
m_mainFrame = nullptr;
m_drawingArea = nullptr;
......
......@@ -512,7 +512,10 @@ public:
WebPageGroup* pageGroup() const { return m_pageGroup.get(); }
bool isValid();
const String& urlAtProcessExit() const { return m_urlAtProcessExit; }
WebFrameProxy::LoadState loadStateAtProcessExit() const { return m_loadStateAtProcessExit; }
WebCore::DragSession dragSession() const { return m_currentDragSession; }
void resetDragOperation() { m_currentDragSession = WebCore::DragSession(); }
......@@ -876,6 +879,9 @@ private:
String m_toolTip;
String m_urlAtProcessExit;
WebFrameProxy::LoadState m_loadStateAtProcessExit;
EditorState m_editorState;
double m_textZoomFactor;
......
......@@ -214,14 +214,15 @@ QString QtViewInterface::runJavaScriptPrompt(const QString& message, const QStri
return m_viewportView->d_func()->runJavaScriptPrompt(message, defaultValue, ok);
}
void QtViewInterface::processDidCrash()
void QtViewInterface::processDidCrash(const QUrl& url)
{
// FIXME
qWarning("WARNING: The web process experienced a crash on '%s'.", qPrintable(url.toString(QUrl::RemoveUserInfo)));
}
void QtViewInterface::didRelaunchProcess()
{
// FIXME
qWarning("WARNING: The web process has been successfully restarted.");
}
QJSEngine* QtViewInterface::engine()
......
......@@ -95,7 +95,7 @@ public:
virtual bool runJavaScriptConfirm(const QString&);
virtual QString runJavaScriptPrompt(const QString&, const QString& defaultValue, bool& ok);
virtual void processDidCrash();
virtual void processDidCrash(const QUrl&);
virtual void didRelaunchProcess();
virtual QJSEngine* engine();
......
......@@ -669,7 +669,9 @@ void QtWebPageProxy::processDidCrash()
m_panGestureRecognizer.reset();
m_pinchGestureRecognizer.reset();
m_tapGestureRecognizer.reset();
m_viewInterface->processDidCrash();
WebCore::KURL url(WebCore::ParsedURLString, m_webPageProxy->urlAtProcessExit());
m_viewInterface->processDidCrash(QUrl(url));
}
QWebPreferences* QtWebPageProxy::preferences() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment