summaryrefslogtreecommitdiff
path: root/src/core/api
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-11-05 17:09:46 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-11-05 17:09:46 +0100
commit79f5361400fa91b30cc4a1b34335b49284ba3e07 (patch)
tree3c5f79b230ff4c83b441cba5df7da357bc9c4f2e /src/core/api
parentbc1529f56b8c86259c7f952b0ea9b439f5cc8d53 (diff)
parent34b714122051eae86ac49fd95c7015fb081f79eb (diff)
downloadqtwebengine-79f5361400fa91b30cc4a1b34335b49284ba3e07.tar.gz
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: src/core/render_widget_host_view_qt.cpp src/core/web_contents_adapter_client.h src/webenginewidgets/api/qwebenginepage_p.h Change-Id: Ibd011c40839c09469218ac4c71a13d0a0b1c9778
Diffstat (limited to 'src/core/api')
-rw-r--r--src/core/api/qtwebenginecoreglobal.cpp27
-rw-r--r--src/core/api/qwebenginecookiestore.cpp3
2 files changed, 28 insertions, 2 deletions
diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index d3cf72477..a415ade92 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -42,6 +42,10 @@
#include <QGuiApplication>
#ifndef QT_NO_OPENGL
# include <QOpenGLContext>
+#ifdef Q_OS_MACOS
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#endif
#endif
#include <QThread>
@@ -52,6 +56,23 @@ Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
QT_END_NAMESPACE
#endif
+#ifndef QT_NO_OPENGL
+#ifdef Q_OS_MACOS
+static bool needsOfflineRendererWorkaround() {
+ size_t hwmodelsize = 0;
+
+ if (sysctlbyname("hw.model", nullptr, &hwmodelsize, nullptr, 0) == -1)
+ return false;
+
+ char hwmodel[hwmodelsize];
+ if (sysctlbyname("hw.model", &hwmodel, &hwmodelsize, nullptr, 0) == -1)
+ return false;
+
+ return QString::fromLatin1(hwmodel) == QLatin1String("MacPro6,1");
+}
+#endif
+#endif
+
namespace QtWebEngineCore {
#ifndef QT_NO_OPENGL
static QOpenGLContext *shareContext;
@@ -74,7 +95,10 @@ QWEBENGINECORE_PRIVATE_EXPORT void initialize()
#ifdef Q_OS_WIN32
qputenv("QT_D3DCREATE_MULTITHREADED", "1");
#endif
-
+#ifdef Q_OS_MACOS
+ if (needsOfflineRendererWorkaround())
+ qputenv("QT_MAC_PRO_WEBENGINE_WORKAROUND", "1");
+#endif
// No need to override the shared context if QApplication already set one (e.g with Qt::AA_ShareOpenGLContexts).
if (qt_gl_global_share_context())
return;
@@ -107,3 +131,4 @@ QWEBENGINECORE_PRIVATE_EXPORT void initialize()
#endif // QT_NO_OPENGL
}
} // namespace QtWebEngineCore
+
diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp
index abb39f074..035c98342 100644
--- a/src/core/api/qwebenginecookiestore.cpp
+++ b/src/core/api/qwebenginecookiestore.cpp
@@ -195,7 +195,8 @@ bool QWebEngineCookieStorePrivate::canAccessCookies(const QUrl &firstPartyUrl, c
if (!filterCallback)
return true;
- bool thirdParty =
+ // Empty first-party URL indicates a first-party request (see net/base/static_cookie_policy.cc)
+ bool thirdParty = !firstPartyUrl.isEmpty() &&
!net::registry_controlled_domains::SameDomainOrHost(toGurl(url),
toGurl(firstPartyUrl),
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);