[Qt][WK2] WebViews are emitting loadFailed for "private" error codes
authorjesus@webkit.org <jesus@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Oct 2011 21:16:27 +0000 (21:16 +0000)
committerjesus@webkit.org <jesus@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Oct 2011 21:16:27 +0000 (21:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=70047

Reviewed by Kenneth Rohde Christiansen.

Both QDesktopWebView and QTouchWebView are emitting loadFailed for private errors
like the ones defined in Source/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp.

We now filter these by not emitting this signal for FrameLoadInterruptedByPolicyChange,
PlugInWillHandleLoad and Cancellation, following previous decisions from WebKit 1.

* UIProcess/qt/ClientImpl.cpp:
(dispatchLoadFailed):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/qt/ClientImpl.cpp

index 4aae95e..f16762e 100644 (file)
@@ -1,3 +1,19 @@
+2011-10-13  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        [Qt][WK2] WebViews are emitting loadFailed for "private" error codes
+        https://bugs.webkit.org/show_bug.cgi?id=70047
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Both QDesktopWebView and QTouchWebView are emitting loadFailed for private errors
+        like the ones defined in Source/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp.
+
+        We now filter these by not emitting this signal for FrameLoadInterruptedByPolicyChange,
+        PlugInWillHandleLoad and Cancellation, following previous decisions from WebKit 1.
+
+        * UIProcess/qt/ClientImpl.cpp:
+        (dispatchLoadFailed):
+
 2011-10-13  Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com>
 
         Implement TextChecker for WebKit2 GTK+
index 8ff8ed8..c003dfc 100644 (file)
@@ -74,6 +74,11 @@ static void dispatchLoadFailed(WKFrameRef frame, const void* clientInfo, WKError
         return;
 
     toQtWebPageProxy(clientInfo)->updateNavigationActions();
+
+    int errorCode = WKErrorGetErrorCode(error);
+    if (toImpl(error)->platformError().isCancellation() || errorCode == kWKErrorCodeFrameLoadInterruptedByPolicyChange || errorCode == kWKErrorCodePlugInWillHandleLoad)
+        return;
+
     toQtWebPageProxy(clientInfo)->loadDidFail(QWebErrorPrivate::createQWebError(error));
 }