summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2019-09-10 05:01:04 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2019-09-10 05:02:49 +0300
commit5087e0ced43d813eb6f765913a6fc3958d2a7a9d (patch)
tree6acc39b8ea0165562d480f1c54608c6c4ae9f865
parent8b813e69d7764a1ad320de203fbcf17146ba469b (diff)
downloadqtwebkit-5087e0ced43d813eb6f765913a6fc3958d2a7a9d.tar.gz
Import QtWebKit commit f085f528406bf5656ce887e14c47b5e5fde4901d
Change-Id: I9bd682d60cdf85d3cca75faf84fbfd151213d98e Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
-rw-r--r--Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp6
-rw-r--r--Source/WebCore/platform/network/qt/ResourceRequestQt.cpp20
-rw-r--r--Tools/QtTestBrowser/CMakeLists.txt4
3 files changed, 26 insertions, 4 deletions
diff --git a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
index 0da45fbc7..792459558 100644
--- a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+++ b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
@@ -41,7 +41,7 @@
#include <QCoreApplication>
-#if USE(HTTP2)
+#if USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
#include <private/http2protocol_p.h>
#include <cstdlib>
@@ -62,7 +62,7 @@ ProtocolParameters::ProtocolParameters()
QT_END_NAMESPACE
-#endif // USE(HTTP2)
+#endif // USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
static const int gMaxRedirections = 10;
@@ -797,7 +797,7 @@ QNetworkReply* QNetworkReplyHandler::sendNetworkRequest(QNetworkAccessManager* m
if (!manager)
return 0;
-#if USE(HTTP2)
+#if USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
static const bool alpnIsSupported = ResourceRequest::alpnIsSupported();
if (alpnIsSupported && !manager->property(Http2::http2ParametersPropertyName).isValid()) {
Http2::ProtocolParameters params;
diff --git a/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp b/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
index 2cf2e7750..310738449 100644
--- a/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
+++ b/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
@@ -29,7 +29,10 @@
#if USE(HTTP2)
#include <QSslSocket>
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
+#include <QHttp2Configuration>
#endif
+#endif // USE(HTTP2)
namespace WebCore {
@@ -65,6 +68,16 @@ bool ResourceRequest::alpnIsSupported()
return QSslSocket::sslLibraryVersionNumber() > 0x10002000L &&
QSslSocket::sslLibraryVersionString().startsWith(QLatin1String("OpenSSL"));
}
+
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
+static QHttp2Configuration createHttp2Configuration()
+{
+ QHttp2Configuration params;
+ params.setServerPushEnabled(true);
+ return params;
+}
+#endif
+
#endif
QNetworkRequest ResourceRequest::toNetworkRequest(NetworkingContext *context) const
@@ -76,8 +89,13 @@ QNetworkRequest ResourceRequest::toNetworkRequest(NetworkingContext *context) co
#if USE(HTTP2)
static const bool NegotiateHttp2ForHttps = alpnIsSupported();
- if (originalUrl.protocolIs("https") && NegotiateHttp2ForHttps)
+ if (originalUrl.protocolIs("https") && NegotiateHttp2ForHttps) {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
+ static const auto params = createHttp2Configuration();
+ request.setHttp2Configuration(params);
+#endif
request.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true);
+ }
#endif // USE(HTTP2)
const HTTPHeaderMap &headers = httpHeaderFields();
diff --git a/Tools/QtTestBrowser/CMakeLists.txt b/Tools/QtTestBrowser/CMakeLists.txt
index ccd8e0ff2..19827fd02 100644
--- a/Tools/QtTestBrowser/CMakeLists.txt
+++ b/Tools/QtTestBrowser/CMakeLists.txt
@@ -48,6 +48,10 @@ qt_wrap_cpp(WebKit QtTestBrowser_SOURCES
webinspector.h
)
+qt5_add_resources(QtTestBrowser_SOURCES
+ QtTestBrowser.qrc
+)
+
if (Qt5OpenGL_FOUND)
list(APPEND QtTestBrowser_SYSTEM_INCLUDE_DIRECTORIES
${Qt5OpenGL_INCLUDE_DIRS}