RESOLVED FIXED 64362
[Qt][WK2] Add informative loadFailed() signal to web views.
https://bugs.webkit.org/show_bug.cgi?id=64362
Summary [Qt][WK2] Add informative loadFailed() signal to web views.
Andreas Kling
Reported 2011-07-12 08:24:37 PDT
SSIA.
Attachments
Proposed patch (17.88 KB, patch)
2011-07-12 08:26 PDT, Andreas Kling
no flags
Proposed patch v2 (17.78 KB, patch)
2011-07-12 08:31 PDT, Andreas Kling
no flags
Proposed patch v3 (22.53 KB, patch)
2011-07-12 08:57 PDT, Andreas Kling
benjamin: review+
Andreas Kling
Comment 1 2011-07-12 08:26:27 PDT
Created attachment 100488 [details] Proposed patch
Andreas Kling
Comment 2 2011-07-12 08:27:44 PDT
Comment on attachment 100488 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=100488&action=review > Source/WebKit2/UIProcess/API/qt/qweberror.cpp:81 > + WKRetainPtr<WKURLRef> failingURL = adoptWK(WKErrorCopyFailingURL(d->error.get())); > + WKRetainPtr<WKStringRef> failingURLString = adoptWK(WKURLCopyString(failingURL.get())); > + return QUrl(WKStringCopyQString(failingURLString.get())); Whoops, just realized we have "QUrl WKURLCopyQUrl(WKURLRef urlRef)", will use that instead.
WebKit Review Bot
Comment 3 2011-07-12 08:29:11 PDT
Attachment 100488 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit..." exit_code: 1 Source/WebKit2/UIProcess/API/qt/qweberror_p.h:24: Header file should not contain WebCore config.h. Should be: alphabetically sorted. [build/include_order] [4] Total errors found: 1 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Andreas Kling
Comment 4 2011-07-12 08:31:50 PDT
Created attachment 100489 [details] Proposed patch v2 Fixed style complaint and use WKURLQt convenience shizzle.
Benjamin Poulain
Comment 5 2011-07-12 08:33:21 PDT
Comment on attachment 100489 [details] Proposed patch v2 Clearing the flag while Andreas add the test.
Benjamin Poulain
Comment 6 2011-07-12 08:45:22 PDT
Comment on attachment 100489 [details] Proposed patch v2 View in context: https://bugs.webkit.org/attachment.cgi?id=100489&action=review Clearing the flag while Andreas add the test. > Source/WebKit2/UIProcess/API/qt/qweberror.h:43 > + int errorCode() const; This could disappear in favor of errorCodeAsHttpStatusCode() const. > Source/WebKit2/UIProcess/API/qt/qweberror.h:51 > + QWebError(); Oops > Source/WebKit2/UIProcess/qt/ClientImpl.cpp:56 > + toQtWebPageProxy(clientInfo)->loadDidSucceed(); > + toQtWebPageProxy(clientInfo)->updateNavigationActions(); I would invert these calls. > Source/WebKit2/UIProcess/qt/ClientImpl.cpp:65 > + toQtWebPageProxy(clientInfo)->loadDidFail(QWebErrorPrivate::createQWebError(error)); > toQtWebPageProxy(clientInfo)->updateNavigationActions(); Same here, so the actions are valid in the code taking care of loadFailed().
Andreas Kling
Comment 7 2011-07-12 08:46:46 PDT
(In reply to comment #6) > (From update of attachment 100489 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=100489&action=review > > Clearing the flag while Andreas add the test. > > > Source/WebKit2/UIProcess/API/qt/qweberror.h:43 > > + int errorCode() const; > > This could disappear in favor of errorCodeAsHttpStatusCode() const. Fair enough. And we just don't make any promises about the "engine errors" for now. > > Source/WebKit2/UIProcess/API/qt/qweberror.h:51 > > + QWebError(); > > Oops D'oh. > > Source/WebKit2/UIProcess/qt/ClientImpl.cpp:56 > > + toQtWebPageProxy(clientInfo)->loadDidSucceed(); > > + toQtWebPageProxy(clientInfo)->updateNavigationActions(); > > I would invert these calls. > > > Source/WebKit2/UIProcess/qt/ClientImpl.cpp:65 > > + toQtWebPageProxy(clientInfo)->loadDidFail(QWebErrorPrivate::createQWebError(error)); > > toQtWebPageProxy(clientInfo)->updateNavigationActions(); > > Same here, so the actions are valid in the code taking care of loadFailed(). Good idea.
Andreas Kling
Comment 8 2011-07-12 08:57:07 PDT
Created attachment 100493 [details] Proposed patch v3
Benjamin Poulain
Comment 9 2011-07-12 09:08:16 PDT
Comment on attachment 100493 [details] Proposed patch v3 View in context: https://bugs.webkit.org/attachment.cgi?id=100493&action=review > Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/tst_commonviewtests.cpp:90 > + viewAbstraction->load(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/kenneth_fanclub_members.html"))); I am not sure that is solid test. I can totally such a page in the tests in the near future ;)
Andreas Kling
Comment 10 2011-07-12 09:17:48 PDT
Kenneth Rohde Christiansen
Comment 11 2011-07-12 13:05:27 PDT
Comment on attachment 100493 [details] Proposed patch v3 View in context: https://bugs.webkit.org/attachment.cgi?id=100493&action=review > Source/WebKit2/UIProcess/API/qt/qweberror.h:39 > + HttpError, So what about HTTPS? SPYDY etc ... wouldn't ProtocolError be better? > Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/tst_commonviewtests.cpp:36 > + void loadNonexistentFileUrl(); NonExisting
Benjamin Poulain
Comment 12 2011-07-12 13:15:23 PDT
(In reply to comment #11) > > Source/WebKit2/UIProcess/API/qt/qweberror.h:39 > > + HttpError, > > So what about HTTPS? SPYDY etc ... wouldn't ProtocolError be better? We had a little discussion with Andreas about how simple can this API be while still being useful. We recognized having the HTTP status code is an important use case even for a very simple view. The naming is probably not good enough if you thought that could be related to https, spydy, etc.
Andreas Kling
Comment 13 2011-07-12 13:17:17 PDT
(In reply to comment #11) > (From update of attachment 100493 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=100493&action=review > > > Source/WebKit2/UIProcess/API/qt/qweberror.h:39 > > + HttpError, > > So what about HTTPS? SPYDY etc ... wouldn't ProtocolError be better? We can certainly tweak that and/or add more error types. Do note that this kind of error will only be emitted when the QNetworkReply has the QNetworkRequest::HttpStatusCodeAttribute set. > > Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/tst_commonviewtests.cpp:36 > > + void loadNonexistentFileUrl(); > > NonExisting http://www.thefreedictionary.com/nonexistent :3
Kenneth Rohde Christiansen
Comment 14 2011-07-12 13:21:29 PDT
> We can certainly tweak that and/or add more error types. Do note that this kind of error will only be emitted when the QNetworkReply has the QNetworkRequest::HttpStatusCodeAttribute set. Anyway, if Http covers https (which I assume) this should be fine. > > NonExisting > > http://www.thefreedictionary.com/nonexistent :3 Aha
Kenneth Rohde Christiansen
Comment 15 2011-07-12 13:22:12 PDT
Though, maybe HttpProtocolError is a better name (yes, I know the p in http means protocol, but how many things about that? :-))
Note You need to log in before you can comment on or make changes to this bug.