diff options
Diffstat (limited to 'src')
m--------- | src/3rdparty | 0 | ||||
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 10 | ||||
-rw-r--r-- | src/webenginewidgets/api/qwebenginepage.cpp | 1 |
3 files changed, 4 insertions, 7 deletions
diff --git a/src/3rdparty b/src/3rdparty -Subproject 25db271c9b53e576cbb2cdc84d2c56ca5e8633a +Subproject f5a93d251cca15cb24a3acacd2fc0f645513c56 diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index fb3eb2ab3..532d9653b 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -374,8 +374,6 @@ void WebContentsDelegateQt::DidStartNavigation(content::NavigationHandle *naviga if (!navigation_handle->IsInMainFrame()) return; - // Error-pages are not reported as separate started navigations. - Q_ASSERT(!navigation_handle->IsErrorPage()); m_loadingErrorFrameList.clear(); m_faviconManager->resetCandidates(); @@ -384,6 +382,8 @@ void WebContentsDelegateQt::DidStartNavigation(content::NavigationHandle *naviga void WebContentsDelegateQt::EmitLoadFinished(bool success, const QUrl &url, bool isErrorPage, int errorCode, const QString &errorDescription) { + Q_ASSERT(!isErrorPage || webEngineSettings()->testAttribute(WebEngineSettings::ErrorPageEnabled)); + // When error page enabled we don't need to send the error page load finished signal if (m_loadProgressMap[url] == 100) return; @@ -538,10 +538,8 @@ void WebContentsDelegateQt::DidFinishLoad(content::RenderFrameHost* render_frame m_viewClient->iconChanged(QUrl()); content::NavigationEntry *entry = web_contents()->GetController().GetActiveEntry(); - int http_statuscode = 0; - if (entry) - http_statuscode = entry->GetHttpStatusCode(); - EmitLoadFinished(true /* success */ , toQt(validated_url), false /* isErrorPage */, http_statuscode); + int http_statuscode = entry ? http_statuscode = entry->GetHttpStatusCode() : 0; + EmitLoadFinished(http_statuscode < 400, toQt(validated_url), false /* isErrorPage */, http_statuscode); } void WebContentsDelegateQt::DidUpdateFaviconURL(const std::vector<blink::mojom::FaviconURLPtr> &candidates) diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 828a1ca79..72311f1a8 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -290,7 +290,6 @@ void QWebEnginePagePrivate::loadFinished(bool success, const QUrl &url, bool isE Q_UNUSED(errorDescription); if (isErrorPage) { - Q_ASSERT(settings->testAttribute(QWebEngineSettings::ErrorPageEnabled)); QTimer::singleShot(0, q, [q](){ emit q->loadFinished(false); }); |