summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r--src/core/web_contents_adapter.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 16e91e6c7..4c156644d 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -55,6 +55,7 @@
#include "profile_adapter.h"
#include "profile_qt.h"
#include "qwebenginecallback_p.h"
+#include "qwebengineloadinginfo.h"
#include "renderer_host/web_engine_page_host.h"
#include "render_widget_host_view_qt.h"
#include "type_conversion.h"
@@ -721,10 +722,11 @@ void WebContentsAdapter::load(const QWebEngineHttpRequest &request)
params.load_type = content::NavigationController::LOAD_TYPE_HTTP_POST;
// chromium accepts LOAD_TYPE_HTTP_POST only for the HTTP and HTTPS protocols
if (!params.url.SchemeIsHTTPOrHTTPS()) {
- m_adapterClient->loadFinished(false, request.url(), false,
- net::ERR_DISALLOWED_URL_SCHEME,
- QCoreApplication::translate("WebContentsAdapter",
- "HTTP-POST data can only be sent over HTTP(S) protocol"));
+ m_adapterClient->loadFinished(QWebEngineLoadingInfo(
+ request.url(), QWebEngineLoadingInfo::LoadFailedStatus, false,
+ QCoreApplication::translate("WebContentsAdapter",
+ "HTTP-POST data can only be sent over HTTP(S) protocol"),
+ net::ERR_DISALLOWED_URL_SCHEME));
return;
}
params.post_data = network::ResourceRequestBody::CreateFromBytes(
@@ -779,7 +781,8 @@ void WebContentsAdapter::setContent(const QByteArray &data, const QString &mimeT
GURL dataUrlToLoad(urlString);
if (dataUrlToLoad.spec().size() > url::kMaxURLChars) {
- m_adapterClient->loadFinished(false, baseUrl, false, net::ERR_ABORTED, QString());
+ m_adapterClient->loadFinished(QWebEngineLoadingInfo(baseUrl, QWebEngineLoadingInfo::LoadFailedStatus,
+ false, QString(), net::ERR_ABORTED));
return;
}
content::NavigationController::LoadURLParams params((dataUrlToLoad));