summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-10-30 15:45:50 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-10-30 16:17:37 +0100
commit4cf520d67f0619330bbf53a743818924d476d95f (patch)
tree58e13e6747affa06bf495c25c8dc7e272a428ba3
parent21f10e777ee2faf41196d0263d4e5134d0ec216a (diff)
parent91fc86bef3b9eb9467f6ac251d1953483da93185 (diff)
Merge branch '5.13' into 5.14
-rw-r--r--configure.pri5
-rw-r--r--dist/changes-5.13.281
-rw-r--r--src/buildtools/config/linux.pri2
-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/configure.json6
-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_contents_adapter.cpp3
-rw-r--r--src/core/web_engine_context.cpp2
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp41
16 files changed, 206 insertions, 72 deletions
diff --git a/configure.pri b/configure.pri
index 13ceb8cdc..3a144e3f8 100644
--- a/configure.pri
+++ b/configure.pri
@@ -367,11 +367,6 @@ defineTest(qtConfTest_hasThumbFlag) {
return(true)
}
-defineTest(qtConfTest_hasGcc6OrNewer) {
- greaterThan(QMAKE_GCC_MAJOR_VERSION, 5):return(true)
- return(false)
-}
-
defineTest(qtConfTest_detectSubmodule) {
isEmpty(QTWEBENGINE_ROOT) {
# topLevel build , add poor man's workaround
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/buildtools/config/linux.pri b/src/buildtools/config/linux.pri
index 493ea9766..f3c4fc953 100644
--- a/src/buildtools/config/linux.pri
+++ b/src/buildtools/config/linux.pri
@@ -179,7 +179,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/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/configure.json b/src/core/configure.json
index 9ee66bf61..d7f5a92f1 100644
--- a/src/core/configure.json
+++ b/src/core/configure.json
@@ -94,10 +94,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",
@@ -194,7 +190,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/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp
index 04c68de4c..c94ff7eee 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -90,22 +90,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,
+ MediaStreamType videoType,
+ MediaStreamType audioType)
{
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Add selected desktop source to the list.
- devices->push_back(blink::MediaStreamDevice(MediaStreamType::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(MediaStreamType::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(
- MediaStreamType::GUM_DESKTOP_AUDIO_CAPTURE,
+ audioType,
media::AudioDeviceDescription::kLoopbackInputDeviceId,
"System Audio"));
}
@@ -154,19 +157,27 @@ content::DesktopMediaID getDefaultScreenId()
WebContentsAdapterClient::MediaRequestFlags mediaRequestFlagsForRequest(const content::MediaStreamRequest &request)
{
- WebContentsAdapterClient::MediaRequestFlags requestFlags = WebContentsAdapterClient::MediaNone;
+ if (request.audio_type == MediaStreamType::DEVICE_AUDIO_CAPTURE &&
+ request.video_type == MediaStreamType::DEVICE_VIDEO_CAPTURE)
+ return {WebContentsAdapterClient::MediaAudioCapture, WebContentsAdapterClient::MediaVideoCapture};
- if (request.audio_type == MediaStreamType::DEVICE_AUDIO_CAPTURE)
- requestFlags |= WebContentsAdapterClient::MediaAudioCapture;
- else if (request.audio_type == MediaStreamType::GUM_DESKTOP_AUDIO_CAPTURE)
- requestFlags |= WebContentsAdapterClient::MediaDesktopAudioCapture;
+ if (request.audio_type == MediaStreamType::DEVICE_AUDIO_CAPTURE &&
+ request.video_type == MediaStreamType::NO_SERVICE)
+ return {WebContentsAdapterClient::MediaAudioCapture};
- if (request.video_type == MediaStreamType::DEVICE_VIDEO_CAPTURE)
- requestFlags |= WebContentsAdapterClient::MediaVideoCapture;
- else if (request.video_type == MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE)
- requestFlags |= WebContentsAdapterClient::MediaDesktopVideoCapture;
+ if (request.audio_type == MediaStreamType::NO_SERVICE &&
+ request.video_type == MediaStreamType::DEVICE_VIDEO_CAPTURE)
+ return {WebContentsAdapterClient::MediaVideoCapture};
- return requestFlags;
+ if (request.audio_type == MediaStreamType::GUM_DESKTOP_AUDIO_CAPTURE &&
+ request.video_type == MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE)
+ return {WebContentsAdapterClient::MediaDesktopAudioCapture, WebContentsAdapterClient::MediaDesktopVideoCapture};
+
+ if (request.video_type == MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE ||
+ request.video_type == MediaStreamType::DISPLAY_VIDEO_CAPTURE)
+ return {WebContentsAdapterClient::MediaDesktopVideoCapture};
+
+ return {};
}
// Based on MediaStreamCaptureIndicator::UIDelegate
@@ -235,14 +246,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 != MediaStreamType::NO_SERVICE && (authorizationFlags & WebContentsAdapterClient::MediaAudioCapture));
- bool webcamRequested =
- (request.video_type != MediaStreamType::NO_SERVICE && (authorizationFlags & WebContentsAdapterClient::MediaVideoCapture));
- bool desktopAudioRequested =
- (request.audio_type != MediaStreamType::NO_SERVICE && (authorizationFlags & WebContentsAdapterClient::MediaDesktopAudioCapture));
- bool desktopVideoRequested =
- (request.video_type != MediaStreamType::NO_SERVICE && (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) {
@@ -258,7 +268,8 @@ void MediaCaptureDevicesDispatcher::handleMediaAccessPermissionResponse(content:
break;
}
} else if (desktopVideoRequested) {
- getDevicesForDesktopCapture(&devices, getDefaultScreenId(), desktopAudioRequested);
+ getDevicesForDesktopCapture(&devices, getDefaultScreenId(), desktopAudioRequested,
+ request.video_type, request.audio_type);
}
}
@@ -315,13 +326,13 @@ void MediaCaptureDevicesDispatcher::processMediaAccessRequest(WebContentsAdapter
{
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- // Let's not support tab capture for now.
- if (request.video_type == MediaStreamType::GUM_TAB_VIDEO_CAPTURE || request.audio_type == MediaStreamType::GUM_TAB_AUDIO_CAPTURE) {
+ WebContentsAdapterClient::MediaRequestFlags flags = mediaRequestFlagsForRequest(request);
+ if (!flags) {
std::move(callback).Run(blink::MediaStreamDevices(), MediaStreamRequestResult::NOT_SUPPORTED, std::unique_ptr<content::MediaStreamUI>());
return;
}
- if (request.video_type == MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE || request.audio_type == MediaStreamType::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);
@@ -339,18 +350,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 != MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE || request.requested_video_device_id.empty()) {
- std::move(callback).Run(devices, MediaStreamRequestResult::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;
@@ -375,7 +381,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 == MediaStreamType::GUM_DESKTOP_AUDIO_CAPTURE);
- getDevicesForDesktopCapture(&devices, mediaId, capture_audio);
+ getDevicesForDesktopCapture(&devices, mediaId, capture_audio, request.video_type, request.audio_type);
if (devices.empty())
std::move(callback).Run(devices, MediaStreamRequestResult::INVALID_STATE,
diff --git a/src/core/net/network_delegate_qt.cpp b/src/core/net/network_delegate_qt.cpp
index 68bf34d31..772ef06aa 100644
--- a/src/core/net/network_delegate_qt.cpp
+++ b/src/core/net/network_delegate_qt.cpp
@@ -139,11 +139,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;
@@ -177,7 +177,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();
@@ -188,7 +190,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 551663cf0..d421edf00 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -183,7 +183,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 2e0e378ac..68be09ad2 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -613,7 +613,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_httpAcceptLanguage = m_profileAdapter->httpAcceptLanguage();
@@ -738,9 +737,18 @@ void ProfileIODataQt::updateRequestInterceptor()
const std::lock_guard<QRecursiveMutex> 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 8f11a9ce2..ec0a3dac9 100644
--- a/src/core/profile_io_data_qt.h
+++ b/src/core/profile_io_data_qt.h
@@ -130,7 +130,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();
@@ -220,6 +221,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 94b22fbea..be55e7c49 100644
--- a/src/core/profile_qt.cpp
+++ b/src/core/profile_qt.cpp
@@ -235,6 +235,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_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 3eb52409d..3ad2d54d2 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1439,8 +1439,7 @@ void WebContentsAdapter::startDragging(QObject *dragSource, const content::DropD
});
QMimeData *mimeData = mimeDataFromDropData(*m_currentDropData);
- if (handleDropDataFileContents(dropData, mimeData))
- allowedActions = Qt::MoveAction;
+ handleDropDataFileContents(dropData, mimeData);
drag->setMimeData(mimeData);
if (!pixmap.isNull()) {
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 243774fb7..a4ceb3a97 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -378,6 +378,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)
{
@@ -508,6 +509,7 @@ WebEngineContext::WebEngineContext()
#ifndef QT_NO_OPENGL
threadedGpu = QOpenGLContext::supportsThreadedOpenGL();
#endif
+ threadedGpu = threadedGpu && !qEnvironmentVariableIsSet(kDisableInProcGpuThread);
bool enableViz = ((threadedGpu && !parsedCommandLine->HasSwitch("disable-viz-display-compositor"))
|| parsedCommandLine->HasSwitch("enable-viz-display-compositor"));
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 1b3295abb..931dbf7f0 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -1177,6 +1177,12 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterMove()
auto jsViewPosition = [&view]() {
QLatin1String script("(function() { return [window.screenX, window.screenY]; })()");
QVariantList posList = evaluateJavaScriptSync(view.page(), script).toList();
+
+ if (posList.count() != 2) {
+ qWarning("jsViewPosition failed.");
+ return QPoint();
+ }
+
return QPoint(posList.at(0).toInt(), posList.at(1).toInt());
};
@@ -1375,16 +1381,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()
@@ -1441,32 +1452,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();
@@ -1477,7 +1490,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());
@@ -1487,13 +1500,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());