summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-10-28 16:28:29 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-10-28 16:28:29 +0100
commit91fc86bef3b9eb9467f6ac251d1953483da93185 (patch)
tree616f5dd534f4ddc86675047bac4eb3f4287085d1
parent51228eb249a178ada6ebd2ccd5e662bcd7bd2c60 (diff)
parent556576b55f6b4404c71c74a5ef8e21f87ed09854 (diff)
Merge remote-tracking branch 'origin/5.13.2' into 5.13
-rw-r--r--.qmake.conf2
-rw-r--r--configure.pri5
-rw-r--r--dist/changes-5.13.281
m---------src/3rdparty0
-rw-r--r--src/core/browser_accessibility_manager_qt.cpp18
-rw-r--r--src/core/browser_accessibility_manager_qt.h2
-rw-r--r--src/core/config/linux.pri2
-rw-r--r--src/core/configure.json6
-rw-r--r--src/core/content_browser_client_qt.cpp2
-rw-r--r--src/core/media_capture_devices_dispatcher.cpp76
-rw-r--r--src/core/net/network_delegate_qt.cpp16
-rw-r--r--src/core/net/url_request_notification.cpp2
-rw-r--r--src/core/profile_adapter.cpp9
-rw-r--r--src/core/profile_io_data_qt.cpp10
-rw-r--r--src/core/profile_io_data_qt.h4
-rw-r--r--src/core/profile_qt.cpp1
-rw-r--r--src/core/web_engine_context.cpp2
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp35
18 files changed, 201 insertions, 72 deletions
diff --git a/.qmake.conf b/.qmake.conf
index dceae50da..d804257e8 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -5,4 +5,4 @@ QTWEBENGINE_OUT_ROOT = $$shadowed($$PWD)
load(qt_build_config)
CONFIG += warning_clean
-MODULE_VERSION = 5.13.1
+MODULE_VERSION = 5.13.2
diff --git a/configure.pri b/configure.pri
index 23f72c5c6..1e7e35178 100644
--- a/configure.pri
+++ b/configure.pri
@@ -294,8 +294,3 @@ defineTest(qtConfTest_hasThumbFlag) {
# no flag assume mthumb
return(true)
}
-
-defineTest(qtConfTest_hasGcc6OrNewer) {
- greaterThan(QMAKE_GCC_MAJOR_VERSION, 5):return(true)
- return(false)
-}
diff --git a/dist/changes-5.13.2 b/dist/changes-5.13.2
new file mode 100644
index 000000000..aeac5b000
--- /dev/null
+++ b/dist/changes-5.13.2
@@ -0,0 +1,81 @@
+Qt 5.13.2 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.13.0 through 5.13.1.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.13 series is binary compatible with the 5.12.x series.
+Applications compiled for 5.12 will continue to run with 5.13.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Qt 5.13.2 Changes *
+****************************************************************************
+
+General
+-------
+
+ - [QTBUG-76329] Fixes extensions and PDF viewer when building with GCC 5.
+ - [QTBUG-77072, QTBUG-78084] Fixed flashing when closing combo box on
+ macOS.
+ - [QTBUG-77827] Fixed unbundling of libjpeg on Linux.
+ - [QTBUG-77977] Fixed invalid URL on profile change.
+ - [QTBUG-78016] Fixed crash with desktop sharing.
+ - [QTBUG-78206] Fixed accessibility events for combo boxes.
+ - [QTBUG-78316] Fixed XMLHttpRequest status with custom schemes.
+
+
+Chromium
+--------
+
+ - Security fixes from Chromium up to version 77.0.3865.120, including:
+
+ - CVE-2019-5869
+ - CVE-2019-5870
+ - CVE-2019-5872
+ - CVE-2019-5875
+ - CVE-2019-5876
+ - CVE-2019-13659
+ - CVE-2019-13660
+ - CVE-2019-13663
+ - CVE-2019-13664
+ - CVE-2019-13665
+ - CVE-2019-13673
+ - CVE-2019-13674
+ - CVE-2019-13675
+ - CVE-2019-13678/CVE-2019-13681
+ - CVE-2019-13687
+ - CVE-2019-13688
+ - CVE-2019-13691
+ - CVE-2019-13692
+ - CVE-2019-13693
+ - CVE-2019-13694
+ - CVE-2019-13695
+ - CVE-2019-13697
+ - Security issue 946351
+ - Security issue 946978
+ - Security issue 957160
+ - Security issue 960354
+ - Security issue 964938
+ - Security issue 971904
+ - Security issue 973628
+ - Security issue 974354
+ - Security issue 979373
+ - Security issue 981459
+ - Security issue 981597
+ - Security issue 986727
+ - Security issue 990234
+
+Qt WebEngine Widgets
+--------------------
+
+ - [QTBUG-77209] Fixed QWebEnginePage visibility state.
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 8c785066d987b663ed7d3386151ec8144c31cdc
+Subproject 843d70ac87de7482c1c1195aa73899bc05efc8f
diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp
index 7fb1386c5..8e3ee5940 100644
--- a/src/core/browser_accessibility_manager_qt.cpp
+++ b/src/core/browser_accessibility_manager_qt.cpp
@@ -146,6 +146,24 @@ void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type,
break;
}
}
+
+void BrowserAccessibilityManagerQt::FireGeneratedEvent(ui::AXEventGenerator::Event event_type,
+ BrowserAccessibility* node)
+{
+ BrowserAccessibilityQt *iface = static_cast<BrowserAccessibilityQt*>(node);
+
+ switch (event_type) {
+ case ui::AXEventGenerator::Event::VALUE_CHANGED:
+ if (iface->role() == QAccessible::EditableText) {
+ QAccessibleTextUpdateEvent event(iface, -1, QString(), QString());
+ QAccessible::updateAccessibility(&event);
+ }
+ break;
+ default:
+ break;
+ }
+}
+
#endif // QT_NO_ACCESSIBILITY
}
diff --git a/src/core/browser_accessibility_manager_qt.h b/src/core/browser_accessibility_manager_qt.h
index 87c8875ba..16e2d1fe7 100644
--- a/src/core/browser_accessibility_manager_qt.h
+++ b/src/core/browser_accessibility_manager_qt.h
@@ -60,6 +60,8 @@ public:
~BrowserAccessibilityManagerQt() override;
void FireBlinkEvent(ax::mojom::Event event_type,
BrowserAccessibility* node) override;
+ void FireGeneratedEvent(ui::AXEventGenerator::Event event_type,
+ BrowserAccessibility* node) override;
QAccessibleInterface *rootParentAccessible();
bool isValid() const { return m_valid; }
diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri
index 22cb5991f..f45c418fe 100644
--- a/src/core/config/linux.pri
+++ b/src/core/config/linux.pri
@@ -178,7 +178,7 @@ host_build {
} else {
gn_args += use_system_harfbuzz=false
}
- !qtConfig(webengine-system-glib): gn_args += use_glib=false
+ gn_args += use_glib=false
qtConfig(webengine-pulseaudio) {
gn_args += use_pulseaudio=true
} else {
diff --git a/src/core/configure.json b/src/core/configure.json
index be686850b..cd3c5c661 100644
--- a/src/core/configure.json
+++ b/src/core/configure.json
@@ -334,10 +334,6 @@
"label": "thumb instruction set",
"type": "hasThumbFlag"
},
- "webengine-extensions-gcc-version" : {
- "label": "GCC 6 or newer",
- "type": "hasGcc6OrNewer"
- },
"webengine-noexecstack" : {
"label": "linker supports -z noexecstack",
"type": "linkerSupportsFlag",
@@ -566,7 +562,7 @@
"label": "Extensions",
"purpose": "Enables Chromium extensions within certain limits. Currently used for enabling the pdf viewer.",
"section": "WebEngine",
- "condition": "features.webengine-printing-and-pdf && (tests.webengine-extensions-gcc-version || config.clang || !config.gcc)",
+ "condition": "features.webengine-printing-and-pdf",
"autoDetect": "features.webengine-printing-and-pdf",
"output": [ "publicFeature" ]
},
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 04a8fc363..6d1bf07a9 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -196,7 +196,7 @@ public:
void* GetHandle() override { return m_handle; }
// Qt currently never creates contexts using robustness attributes.
- bool WasAllocatedUsingRobustnessExtension() override { return false; }
+ unsigned int CheckStickyGraphicsResetStatus() override { return 0 /*GL_NO_ERROR*/; }
// We don't care about the rest, this context shouldn't be used except for its handle.
bool Initialize(gl::GLSurface *, const gl::GLContextAttribs &) override { Q_UNREACHABLE(); return false; }
diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp
index ecc46f244..29230c27b 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -87,22 +87,25 @@ const blink::MediaStreamDevice *findDeviceWithId(const blink::MediaStreamDevices
return 0;
}
-// Based on chrome/browser/media/desktop_capture_access_handler.cc:
-void getDevicesForDesktopCapture(blink::MediaStreamDevices *devices, content::DesktopMediaID mediaId, bool captureAudio)
+// Based on chrome/browser/media/webrtc/desktop_capture_devices_util.cc:
+void getDevicesForDesktopCapture(blink::MediaStreamDevices *devices,
+ content::DesktopMediaID mediaId,
+ bool captureAudio,
+ blink::MediaStreamType videoType,
+ blink::MediaStreamType audioType)
{
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Add selected desktop source to the list.
- devices->push_back(blink::MediaStreamDevice(blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE, mediaId.ToString(), "Screen"));
+ devices->push_back(blink::MediaStreamDevice(videoType, mediaId.ToString(), mediaId.ToString()));
if (captureAudio) {
if (mediaId.type == content::DesktopMediaID::TYPE_WEB_CONTENTS) {
devices->push_back(
- blink::MediaStreamDevice(blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE,
- mediaId.ToString(), "Tab audio"));
+ blink::MediaStreamDevice(audioType, mediaId.ToString(), "Tab audio"));
} else {
// Use the special loopback device ID for system audio capture.
devices->push_back(blink::MediaStreamDevice(
- blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE,
+ audioType,
media::AudioDeviceDescription::kLoopbackInputDeviceId,
"System Audio"));
}
@@ -151,19 +154,27 @@ content::DesktopMediaID getDefaultScreenId()
WebContentsAdapterClient::MediaRequestFlags mediaRequestFlagsForRequest(const content::MediaStreamRequest &request)
{
- WebContentsAdapterClient::MediaRequestFlags requestFlags = WebContentsAdapterClient::MediaNone;
+ if (request.audio_type == blink::MEDIA_DEVICE_AUDIO_CAPTURE &&
+ request.video_type == blink::MEDIA_DEVICE_VIDEO_CAPTURE)
+ return {WebContentsAdapterClient::MediaAudioCapture, WebContentsAdapterClient::MediaVideoCapture};
- if (request.audio_type == blink::MEDIA_DEVICE_AUDIO_CAPTURE)
- requestFlags |= WebContentsAdapterClient::MediaAudioCapture;
- else if (request.audio_type == blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE)
- requestFlags |= WebContentsAdapterClient::MediaDesktopAudioCapture;
+ if (request.audio_type == blink::MEDIA_DEVICE_AUDIO_CAPTURE &&
+ request.video_type == blink::MEDIA_NO_SERVICE)
+ return {WebContentsAdapterClient::MediaAudioCapture};
- if (request.video_type == blink::MEDIA_DEVICE_VIDEO_CAPTURE)
- requestFlags |= WebContentsAdapterClient::MediaVideoCapture;
- else if (request.video_type == blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE)
- requestFlags |= WebContentsAdapterClient::MediaDesktopVideoCapture;
+ if (request.audio_type == blink::MEDIA_NO_SERVICE &&
+ request.video_type == blink::MEDIA_DEVICE_VIDEO_CAPTURE)
+ return {WebContentsAdapterClient::MediaVideoCapture};
- return requestFlags;
+ if (request.audio_type == blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE &&
+ request.video_type == blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE)
+ return {WebContentsAdapterClient::MediaDesktopAudioCapture, WebContentsAdapterClient::MediaDesktopVideoCapture};
+
+ if (request.video_type == blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE ||
+ request.video_type == blink::MEDIA_DISPLAY_VIDEO_CAPTURE)
+ return {WebContentsAdapterClient::MediaDesktopVideoCapture};
+
+ return {};
}
} // namespace
@@ -198,14 +209,13 @@ void MediaCaptureDevicesDispatcher::handleMediaAccessPermissionResponse(content:
if (!securityOriginsMatch)
qWarning("Security origin mismatch for media access permission: %s requested and %s provided\n", qPrintable(requestSecurityOrigin.toString()), qPrintable(securityOrigin.toString()));
- bool microphoneRequested =
- (request.audio_type && authorizationFlags & WebContentsAdapterClient::MediaAudioCapture);
- bool webcamRequested =
- (request.video_type && authorizationFlags & WebContentsAdapterClient::MediaVideoCapture);
- bool desktopAudioRequested =
- (request.audio_type && authorizationFlags & WebContentsAdapterClient::MediaDesktopAudioCapture);
- bool desktopVideoRequested =
- (request.video_type && authorizationFlags & WebContentsAdapterClient::MediaDesktopVideoCapture);
+ WebContentsAdapterClient::MediaRequestFlags requestFlags = mediaRequestFlagsForRequest(request);
+ WebContentsAdapterClient::MediaRequestFlags finalFlags = requestFlags & authorizationFlags;
+
+ bool microphoneRequested = finalFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture);
+ bool webcamRequested = finalFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture);
+ bool desktopAudioRequested = finalFlags.testFlag(WebContentsAdapterClient::MediaDesktopAudioCapture);
+ bool desktopVideoRequested = finalFlags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture);
if (securityOriginsMatch) {
if (microphoneRequested || webcamRequested) {
@@ -221,7 +231,8 @@ void MediaCaptureDevicesDispatcher::handleMediaAccessPermissionResponse(content:
break;
}
} else if (desktopVideoRequested) {
- getDevicesForDesktopCapture(&devices, getDefaultScreenId(), desktopAudioRequested);
+ getDevicesForDesktopCapture(&devices, getDefaultScreenId(), desktopAudioRequested,
+ request.video_type, request.audio_type);
}
}
@@ -274,13 +285,13 @@ void MediaCaptureDevicesDispatcher::processMediaAccessRequest(WebContentsAdapter
{
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- // Let's not support tab capture for now.
- if (request.video_type == blink::MEDIA_GUM_TAB_VIDEO_CAPTURE || request.audio_type == blink::MEDIA_GUM_TAB_AUDIO_CAPTURE) {
+ WebContentsAdapterClient::MediaRequestFlags flags = mediaRequestFlagsForRequest(request);
+ if (!flags) {
std::move(callback).Run(blink::MediaStreamDevices(), blink::MEDIA_DEVICE_NOT_SUPPORTED, std::unique_ptr<content::MediaStreamUI>());
return;
}
- if (request.video_type == blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE || request.audio_type == blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE) {
+ if (flags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture)) {
const bool screenCaptureEnabled =
adapterClient->webEngineSettings()->testAttribute(WebEngineSettings::ScreenCaptureEnabled);
const bool originIsSecure = content::IsOriginSecure(request.security_origin);
@@ -298,18 +309,13 @@ void MediaCaptureDevicesDispatcher::processMediaAccessRequest(WebContentsAdapter
enqueueMediaAccessRequest(webContents, request, std::move(callback));
// We might not require this approval for pepper requests.
- adapterClient->runMediaAccessPermissionRequest(toQt(request.security_origin), mediaRequestFlagsForRequest(request));
+ adapterClient->runMediaAccessPermissionRequest(toQt(request.security_origin), flags);
}
void MediaCaptureDevicesDispatcher::processDesktopCaptureAccessRequest(content::WebContents *webContents, const content::MediaStreamRequest &request, content::MediaResponseCallback callback)
{
blink::MediaStreamDevices devices;
- if (request.video_type != blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE || request.requested_video_device_id.empty()) {
- std::move(callback).Run(devices, blink::MEDIA_DEVICE_INVALID_STATE, std::unique_ptr<content::MediaStreamUI>());
- return;
- }
-
content::WebContents *const web_contents_for_stream = content::WebContents::FromRenderFrameHost(
content::RenderFrameHost::FromID(request.render_process_id, request.render_frame_id));
content::RenderFrameHost *const main_frame = web_contents_for_stream ? web_contents_for_stream->GetMainFrame() : NULL;
@@ -334,7 +340,7 @@ void MediaCaptureDevicesDispatcher::processDesktopCaptureAccessRequest(content::
// Audio is only supported for screen capture streams.
bool capture_audio = (mediaId.type == content::DesktopMediaID::TYPE_SCREEN && request.audio_type == blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE);
- getDevicesForDesktopCapture(&devices, mediaId, capture_audio);
+ getDevicesForDesktopCapture(&devices, mediaId, capture_audio, request.video_type, request.audio_type);
std::move(callback).Run(devices, devices.empty() ? blink::MEDIA_DEVICE_INVALID_STATE : blink::MEDIA_DEVICE_OK,
std::unique_ptr<content::MediaStreamUI>());
diff --git a/src/core/net/network_delegate_qt.cpp b/src/core/net/network_delegate_qt.cpp
index 7f278fd92..2cca152e6 100644
--- a/src/core/net/network_delegate_qt.cpp
+++ b/src/core/net/network_delegate_qt.cpp
@@ -136,11 +136,11 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, net::Complet
// Deprecated =begin
// quick peek if deprecated
- QWebEngineUrlRequestInterceptor* profileInterceptor = m_profileIOData->requestInterceptor();
- if (profileInterceptor && profileInterceptor->property("deprecated").toBool()) {
- profileInterceptor = nullptr;
- if (QWebEngineUrlRequestInterceptor* interceptor = m_profileIOData->acquireInterceptor()) {
- interceptor->interceptRequest(requestInfo);
+
+ if (m_profileIOData->isInterceptorDeprecated()) {
+ QWebEngineUrlRequestInterceptor* profileInterceptor = m_profileIOData->acquireInterceptor();
+ if (profileInterceptor && m_profileIOData->isInterceptorDeprecated()) {
+ profileInterceptor->interceptRequest(requestInfo);
m_profileIOData->releaseInterceptor();
if (requestInfo.changed()) {
int result = infoPrivate->shouldBlockRequest ? net::ERR_BLOCKED_BY_CLIENT : net::OK;
@@ -174,7 +174,9 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, net::Complet
if (!resourceInfo)
return net::OK;
- if (!m_profileIOData->hasPageInterceptors() && !profileInterceptor && !content::IsResourceTypeFrame(resourceType))
+ // try to bail out
+ if (!m_profileIOData->hasPageInterceptors() && (!m_profileIOData->requestInterceptor() || m_profileIOData->isInterceptorDeprecated()) &&
+ !content::IsResourceTypeFrame(resourceType))
return net::OK;
auto webContentsGetter = resourceInfo->GetWebContentsGetterForRequest();
@@ -185,7 +187,7 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, net::Complet
std::move(requestInfo),
webContentsGetter,
std::move(callback),
- profileInterceptor ? m_profileIOData->profileAdapter() : nullptr
+ m_profileIOData->profileAdapter()
);
// We'll run the callback after we notified the UI thread.
diff --git a/src/core/net/url_request_notification.cpp b/src/core/net/url_request_notification.cpp
index e37ad35bc..9d309e314 100644
--- a/src/core/net/url_request_notification.cpp
+++ b/src/core/net/url_request_notification.cpp
@@ -107,7 +107,7 @@ void URLRequestNotification::notify()
if (webContents) {
- if (m_profileAdapter) {
+ if (m_profileAdapter && m_profileAdapter->requestInterceptor()) {
QWebEngineUrlRequestInterceptor* interceptor = m_profileAdapter->requestInterceptor();
if (!interceptor->property("deprecated").toBool())
interceptor->interceptRequest(m_requestInfo);
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index ebb533206..dbe76f0d1 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -179,7 +179,16 @@ void ProfileAdapter::setRequestInterceptor(QWebEngineUrlRequestInterceptor *inte
{
if (m_requestInterceptor == interceptor)
return;
+
+ if (m_requestInterceptor)
+ disconnect(m_requestInterceptor, &QObject::destroyed, this, nullptr);
m_requestInterceptor = interceptor;
+ if (m_requestInterceptor)
+ connect(m_requestInterceptor, &QObject::destroyed, this, [this] () {
+ m_profile->m_profileIOData->updateRequestInterceptor();
+ Q_ASSERT(!m_profile->m_profileIOData->requestInterceptor());
+ });
+
if (m_profile->m_urlRequestContextGetter.get())
m_profile->m_profileIOData->updateRequestInterceptor();
}
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp
index 27c97a986..a2613d3fc 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -614,7 +614,6 @@ void ProfileIODataQt::setRequestContextData(content::ProtocolHandlerMap *protoco
void ProfileIODataQt::setFullConfiguration()
{
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
- m_requestInterceptor = m_profileAdapter->requestInterceptor();
m_persistentCookiesPolicy = m_profileAdapter->persistentCookiesPolicy();
m_cookiesPath = m_profileAdapter->cookiesPath();
m_channelIdPath = m_profileAdapter->channelIdPath();
@@ -741,9 +740,18 @@ void ProfileIODataQt::updateRequestInterceptor()
QMutexLocker lock(&m_mutex);
m_requestInterceptor = m_profileAdapter->requestInterceptor();
m_hasPageInterceptors = m_profileAdapter->hasPageRequestInterceptor();
+ if (m_requestInterceptor)
+ m_isInterceptorDeprecated = m_requestInterceptor->property("deprecated").toBool();
+ else
+ m_isInterceptorDeprecated = false;
// We in this case do not need to regenerate any Chromium classes.
}
+bool ProfileIODataQt::isInterceptorDeprecated() const
+{
+ return m_isInterceptorDeprecated;
+}
+
QWebEngineUrlRequestInterceptor *ProfileIODataQt::acquireInterceptor()
{
m_mutex.lock();
diff --git a/src/core/profile_io_data_qt.h b/src/core/profile_io_data_qt.h
index 570365085..a1b123771 100644
--- a/src/core/profile_io_data_qt.h
+++ b/src/core/profile_io_data_qt.h
@@ -120,7 +120,8 @@ public:
void setGlobalCertificateVerification();
// Used in NetworkDelegateQt::OnBeforeURLRequest.
- QWebEngineUrlRequestInterceptor *acquireInterceptor();
+ bool isInterceptorDeprecated() const; // Remove for Qt6
+ QWebEngineUrlRequestInterceptor *acquireInterceptor(); // Remove for Qt6
void releaseInterceptor();
QWebEngineUrlRequestInterceptor *requestInterceptor();
@@ -191,6 +192,7 @@ private:
base::WeakPtrFactory<ProfileIODataQt> m_weakPtrFactory; // this should be always the last member
QString m_dataPath;
bool m_pendingStorageRequestGeneration = false;
+ volatile bool m_isInterceptorDeprecated = false; // Remove for Qt6
DISALLOW_COPY_AND_ASSIGN(ProfileIODataQt);
friend class BrowsingDataRemoverObserverQt;
diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp
index 5977a28a8..cd8ee8110 100644
--- a/src/core/profile_qt.cpp
+++ b/src/core/profile_qt.cpp
@@ -272,6 +272,7 @@ net::URLRequestContextGetter *ProfileQt::CreateRequestContext(
m_profileIOData->setRequestContextData(protocol_handlers, std::move(request_interceptors));
m_profileIOData->updateStorageSettings();
+ m_profileIOData->updateRequestInterceptor();
m_urlRequestContextGetter = new URLRequestContextGetterQt(m_profileIOData.get());
return m_urlRequestContextGetter.get();
}
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index a3a5881bf..07e0d3ba8 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -362,6 +362,7 @@ ProxyAuthentication WebEngineContext::qProxyNetworkAuthentication(QString host,
const static char kChromiumFlagsEnv[] = "QTWEBENGINE_CHROMIUM_FLAGS";
const static char kDisableSandboxEnv[] = "QTWEBENGINE_DISABLE_SANDBOX";
+const static char kDisableInProcGpuThread[] = "QTWEBENGINE_DISABLE_GPU_THREAD";
static void appendToFeatureList(std::string &featureList, const char *feature)
{
@@ -608,6 +609,7 @@ WebEngineContext::WebEngineContext()
#ifndef QT_NO_OPENGL
threadedGpu = QOpenGLContext::supportsThreadedOpenGL();
#endif
+ threadedGpu = threadedGpu && !qEnvironmentVariableIsSet(kDisableInProcGpuThread);
registerMainThreadFactories(threadedGpu);
SetContentClient(new ContentClientQt);
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 818439e46..8d5b486b2 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -1253,16 +1253,21 @@ public:
load(QUrl("qrc:///resources/content.html"));
}
- void jsGetUserMedia(const QString & constraints)
+ void jsGetMedia(const QString &call)
{
evaluateJavaScriptSync(this,
QStringLiteral(
"var promiseFulfilled = false;"
"var promiseRejected = false;"
- "navigator.mediaDevices.getUserMedia(%1)"
+ "navigator.mediaDevices.%1"
".then(stream => { promiseFulfilled = true})"
".catch(err => { promiseRejected = true})")
- .arg(constraints));
+ .arg(call));
+ }
+
+ void jsGetUserMedia(const QString &constraints)
+ {
+ jsGetMedia(QStringLiteral("getUserMedia(%1)").arg(constraints));
}
bool jsPromiseFulfilled()
@@ -1319,32 +1324,34 @@ private:
void tst_QWebEnginePage::getUserMediaRequest_data()
{
- QTest::addColumn<QString>("constraints");
+ QTest::addColumn<QString>("call");
QTest::addColumn<QWebEnginePage::Feature>("feature");
QTest::addRow("device audio")
- << "{audio: true}" << QWebEnginePage::MediaAudioCapture;
+ << "getUserMedia({audio: true})" << QWebEnginePage::MediaAudioCapture;
QTest::addRow("device video")
- << "{video: true}" << QWebEnginePage::MediaVideoCapture;
+ << "getUserMedia({video: true})" << QWebEnginePage::MediaVideoCapture;
QTest::addRow("device audio+video")
- << "{audio: true, video: true}" << QWebEnginePage::MediaAudioVideoCapture;
+ << "getUserMedia({audio: true, video: true})" << QWebEnginePage::MediaAudioVideoCapture;
QTest::addRow("desktop video")
- << "{video: { mandatory: { chromeMediaSource: 'desktop' }}}"
+ << "getUserMedia({video: { mandatory: { chromeMediaSource: 'desktop' }}})"
<< QWebEnginePage::DesktopVideoCapture;
QTest::addRow("desktop audio+video")
- << "{audio: { mandatory: { chromeMediaSource: 'desktop' }}, video: { mandatory: { chromeMediaSource: 'desktop' }}}"
+ << "getUserMedia({audio: { mandatory: { chromeMediaSource: 'desktop' }}, video: { mandatory: { chromeMediaSource: 'desktop' }}})"
<< QWebEnginePage::DesktopAudioVideoCapture;
+ QTest::addRow("display video")
+ << "getDisplayMedia()" << QWebEnginePage::DesktopVideoCapture;
}
void tst_QWebEnginePage::getUserMediaRequest()
{
- QFETCH(QString, constraints);
+ QFETCH(QString, call);
QFETCH(QWebEnginePage::Feature, feature);
GetUserMediaTestPage page;
+ QWebEngineView view;
if (feature == QWebEnginePage::DesktopVideoCapture || feature == QWebEnginePage::DesktopAudioVideoCapture) {
// Desktop capture needs to be on a desktop.
- QWebEngineView view;
view.setPage(&page);
view.resize(640, 480);
view.show();
@@ -1355,7 +1362,7 @@ void tst_QWebEnginePage::getUserMediaRequest()
page.settings()->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, true);
// 1. Rejecting request on C++ side should reject promise on JS side.
- page.jsGetUserMedia(constraints);
+ page.jsGetMedia(call);
QTRY_VERIFY(page.gotFeatureRequest(feature));
page.rejectPendingRequest();
QTRY_VERIFY(!page.jsPromiseFulfilled() && page.jsPromiseRejected());
@@ -1365,13 +1372,13 @@ void tst_QWebEnginePage::getUserMediaRequest()
// deeper in the content layer we cannot guarantee that the promise will
// always be fulfilled, however in this case an error should be returned to
// JS instead of leaving the Promise in limbo.
- page.jsGetUserMedia(constraints);
+ page.jsGetMedia(call);
QTRY_VERIFY(page.gotFeatureRequest(feature));
page.acceptPendingRequest();
QTRY_VERIFY(page.jsPromiseFulfilled() || page.jsPromiseRejected());
// 3. Media feature permissions are not remembered.
- page.jsGetUserMedia(constraints);
+ page.jsGetMedia(call);
QTRY_VERIFY(page.gotFeatureRequest(feature));
page.acceptPendingRequest();
QTRY_VERIFY(page.jsPromiseFulfilled() || page.jsPromiseRejected());