diff options
Diffstat (limited to 'src/core/api')
-rw-r--r-- | src/core/api/qtwebenginecoreglobal.cpp | 27 | ||||
-rw-r--r-- | src/core/api/qwebenginecookiestore.cpp | 3 |
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); |