[Qt] Restore URL Scheme Delegates after QtWebProcess crash
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2013 15:33:57 +0000 (15:33 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2013 15:33:57 +0000 (15:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=108808

When the QtWebProcess crashes, the registered URL Scheme
Delegates are not properly restored over IPC in the newly
launched process instance.

Patch by Milian Wolff <milian.wolff@kdab.com> on 2013-02-15
Reviewed by Simon Hausmann.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::didRelaunchProcess):
(QQuickWebViewPrivate::updateSchemeDelegates):
* UIProcess/API/qt/qquickwebview_p_p.h:
(QQuickWebViewPrivate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142997 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h

index 5da21f4..343a659 100644 (file)
@@ -1,3 +1,20 @@
+2013-02-15  Milian Wolff  <milian.wolff@kdab.com>
+
+        [Qt] Restore URL Scheme Delegates after QtWebProcess crash
+        https://bugs.webkit.org/show_bug.cgi?id=108808
+
+        When the QtWebProcess crashes, the registered URL Scheme
+        Delegates are not properly restored over IPC in the newly
+        launched process instance.
+
+        Reviewed by Simon Hausmann.
+
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebViewPrivate::didRelaunchProcess):
+        (QQuickWebViewPrivate::updateSchemeDelegates):
+        * UIProcess/API/qt/qquickwebview_p_p.h:
+        (QQuickWebViewPrivate):
+
 2013-02-15  Allan Sandfeld Jensen  <allan.jensen@digia.com>
 
         Simplify hitTestResultAtPoint and nodesFromRect APIs
index 3a8010a..1a7da43 100644 (file)
@@ -589,6 +589,7 @@ void QQuickWebViewPrivate::didRelaunchProcess()
 
     updateViewportSize();
     updateUserScripts();
+    updateSchemeDelegates();
 }
 
 PassOwnPtr<DrawingAreaProxy> QQuickWebViewPrivate::createDrawingAreaProxy()
@@ -869,6 +870,17 @@ void QQuickWebViewPrivate::updateUserScripts()
     }
 }
 
+void QQuickWebViewPrivate::updateSchemeDelegates()
+{
+    webPageProxy->registerApplicationScheme(ASCIILiteral("qrc"));
+
+    QQmlListProperty<QQuickUrlSchemeDelegate> schemes = experimental->schemeDelegates();
+    for (int i = 0, numSchemes = experimental->schemeDelegates_Count(&schemes); i < numSchemes; ++i) {
+        QQuickUrlSchemeDelegate* scheme = experimental->schemeDelegates_At(&schemes, i);
+        webPageProxy->registerApplicationScheme(scheme->scheme());
+    }
+}
+
 QPointF QQuickWebViewPrivate::contentPos() const
 {
     Q_Q(const QQuickWebView);
index b916614..8ad53e3 100644 (file)
@@ -115,6 +115,7 @@ public:
     bool transparentBackground() const;
     void setNavigatorQtObjectEnabled(bool);
     void updateUserScripts();
+    void updateSchemeDelegates();
 
     QPointF contentPos() const;
     void setContentPos(const QPointF&);