From 9db27320eda70ec4e4948ae0853dd3f2dd08912b Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 5 Feb 2016 13:27:14 +0100 Subject: Fix double LoadFinished on URL errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RenderFrameDeleted was called before DidFinishLoad, which meant m_loadingErrorFrameList was empty and wouldn't detect the page loaded was an error page. Instead this patch relies on the chromium error-page url which we already asserted. Additonally we delay emitting the loadFinished signal until the error page is also done loading, since the error-page can be considered part of the load, and we otherwise have a race condition on toPlainText. Finally we were not getting error-pages when blocking requests because we reported them as aborted them instead of blocked. Change-Id: I945eb838b7f080d4e146f18354e8986e1b88b5cd Task-number: QTBUG-50752 Reviewed-by: Michael BrĂ¼ning --- src/core/network_delegate_qt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/network_delegate_qt.cpp') diff --git a/src/core/network_delegate_qt.cpp b/src/core/network_delegate_qt.cpp index 6fdabcd4c..0c0de64fd 100644 --- a/src/core/network_delegate_qt.cpp +++ b/src/core/network_delegate_qt.cpp @@ -111,7 +111,7 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, const net::C QWebEngineUrlRequestInfo requestInfo(infoPrivate); interceptor->interceptRequest(requestInfo); if (requestInfo.changed()) { - int result = infoPrivate->shouldBlockRequest ? net::ERR_ABORTED : net::OK; + int result = infoPrivate->shouldBlockRequest ? net::ERR_BLOCKED_BY_CLIENT : net::OK; if (qUrl != infoPrivate->url) *newUrl = toGurl(infoPrivate->url); -- cgit v1.2.3