summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-05-09 19:13:21 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-05-09 19:13:21 +0200
commitef48edf051b24496f4e30ceb867997568ef425e3 (patch)
treeb2e08d4ba1bf317445f05e640ec7eaeab08ad5ef
parentf8898170a77593e314d3cd187f259223e9bff0f8 (diff)
parent28e0320235d33f00c6c141a549dc0553ee0043a5 (diff)
Merge remote-tracking branch 'origin/5.11.0' into 5.11
-rw-r--r--dist/changes-5.11.0121
m---------src/3rdparty0
-rw-r--r--src/core/api/qwebenginecookiestore.cpp12
-rw-r--r--src/core/api/qwebenginecookiestore.h4
-rw-r--r--src/core/content_browser_client_qt.cpp22
-rw-r--r--src/core/content_browser_client_qt.h2
-rw-r--r--src/core/gl_surface_qt.cpp24
-rw-r--r--src/core/quota_request_controller_impl.cpp5
-rw-r--r--src/core/quota_request_controller_impl.h2
-rw-r--r--src/core/register_protocol_handler_request_controller_impl.cpp5
-rw-r--r--src/core/register_protocol_handler_request_controller_impl.h2
-rw-r--r--src/core/request_controller.h5
-rw-r--r--src/core/web_contents_delegate_qt.cpp13
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp28
14 files changed, 233 insertions, 12 deletions
diff --git a/dist/changes-5.11.0 b/dist/changes-5.11.0
new file mode 100644
index 000000000..cf721de9f
--- /dev/null
+++ b/dist/changes-5.11.0
@@ -0,0 +1,121 @@
+Qt 5.11 introduces many new features and improvements as well as bugfixes
+over the 5.10.x series. For more details, refer to the online documentation
+included in this distribution. The documentation is also available online:
+
+http://doc.qt.io/qt-5/index.html
+
+The Qt version 5.11 series is binary compatible with the 5.10.x series.
+Applications compiled for 5.10 will continue to run with 5.11.
+
+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.
+
+****************************************************************************
+* General *
+****************************************************************************
+
+Chromium Snapshot
+-----------------
+
+- Updated the Chromium version to 65.0.3325.151.
+- Applied security fixes from Chrome up to version 66.0.3359.139.
+ * Including: CVE-2018-6085, CVE-2018-6086, CVE-2018-6087, CVE-2018-6088,
+ CVE-2018-6089, CVE-2018-6090, CVE-2018-6091, CVE-2018-6092,
+ CVE-2018-6093, CVE-2018-6094, CVE-2018-6096, CVE-2018-6099,
+ CVE-2018-6100, CVE-2018-6101, CVE-2018-6102, CVE-2018-6103,
+ CVE-2018-6104, CVE-2018-6105, CVE-2018-6106, CVE-2018-6108,
+ CVE-2018-6110, CVE-2018-6111, CVE-2018-6115, CVE-2018-6116 and
+ CVE-2018-6118
+
+Behavioral Changes
+------------------
+
+- [QTBUG-65484] User script metadata parsing now supports regular
+ expressions in @include and @exclude rules.
+- Enabled chrome://quota-internals, chrome://taskscheduler-internals,
+ and on Linux, chrome://sandbox.
+- [QTBUG-62414] Default context menus for Qt Quick and Qt Widgets got
+ a revamp and are now unified.
+
+Build System
+------------
+
+- [QTBUG-66596] QtWebEngine now requires Visual Studio 2017 on Windows.
+- Building with -no-feature-draganddrop configure option got fixed.
+
+Command Line
+------------
+
+- Process per Site model is now supported via --process-per-site.
+- There's now an option to hide internal IP addresses from WebRTC via
+ --force-webrtc-ip-handling-policy=default_public_interface_only.
+
+****************************************************************************
+* Libraries *
+****************************************************************************
+
+Deprecation Notice
+------------------
+
+- [QTBUG-62640] [Q]WebEngineDownloadItem::type got deprecated. Use newly
+ introduced [Q]WebEngineDownloadItem::isSavePageDownload instead.
+
+Qt WebEngineCore
+----------------
+
+- [QTBUG-62897] Added QWebEngineCookieStore::setCookieFilter()
+ to allow blocking cookie access.
+- Added QWebEngineQuotaRequest, QWebEngineQuotaRequest classes.
+- Added QWebEngineUrlRequestJob::initiator() accessor.
+
+Qt WebEngine (QML)
+------------------
+
+- Added WebEngineContextMenuRequest::editFlags,
+ WebEngineContextMenuRequest::mediaFlags properties to allow further tailoring
+ custom context menus.
+- [QTBUG-57505] Added WebEngineSettings::webRTCPublicInterfacesOnly property
+ to enable hiding private IP addresses from WebRTC services.
+- [QTBUG-64056] Added WebEngineSettings::javaScriptCanPaste property
+ to enable 'execCommand("paste")'.
+- Added WebEngineSettings::playbackRequiresUserGesture property
+ to inhibit playback of media content until the user interacts with the page.
+- Added WebEngineSettings::unknownUrlSchemePolicy property
+ to specify how navigation requests to URLs with unknown schemes should be
+ handled.
+- [QTBUG-51181] Added WebEngineView.geometryChangeRequested signal.
+- [QTBUG-47899, QTBUG-50725, QTBUG-50766] WebEngineView::inspectedView,
+ WebEngineView::devToolsView properties can be used to programmatically set up
+ a devtools page.
+- Added WebEngineView::quotaRequested() signal to handle requests for bigger
+ file system quotas (navigator.webkitPersistentStorage.requestQuota).
+- Added WebEngineView::registerProtocolHandlerRequested() signal to handle
+ requests from window.navigator.registerProtocolHandler API.
+
+Qt WebEngineWidgets
+-------------------
+
+- Added QWebEngineContextMenuData::editFlags(),
+ QWebEngineContextMenuData::mediaFlags() properties to allow further tailoring
+ custom context menus.
+- [QTBUG-57505] Added QWebEngineSettings::WebRTCPublicInterfacesOnly attribute
+ to enable hiding private IP addresses from WebRTC services.
+- [QTBUG-64056] Added QWebEngineSettings::JavaScriptCanPaste attribute
+ to enable 'execCommand("paste")'.
+- Added QWebEngineSettings::PlaybackRequiresUserGesture attribute
+ to inhibit playback of media content until the user interacts with the page.
+- Added QWebEngineSettings::unknownUrlSchemePolicy property
+ to specify how navigation requests to URLs with unknown schemes should be
+ handled.
+- [QTBUG-47899, QTBUG-50725, QTBUG-50766] QWebEnginePage::setInspectedPage(),
+ QWebEnginePage::setDevToolsPage() can be set to programmatically set up
+ a devtools page.
+- Added QWebEnginePage::quotaRequested() signal to handle requests for bigger
+ file system quotas (navigator.webkitPersistentStorage.requestQuota).
+- Added QWebEnginePage::registerProtocolHandlerRequested() signal to handle
+ requests from window.navigator.registerProtocolHandler API.
diff --git a/src/3rdparty b/src/3rdparty
-Subproject de120c712b755a45687b4f3a7fd01bb7d334669
+Subproject 1785e2c1eb5a3b9a9a97ef3125c8f444d9b62af
diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp
index 600a55a8c..9a07c7c7b 100644
--- a/src/core/api/qwebenginecookiestore.cpp
+++ b/src/core/api/qwebenginecookiestore.cpp
@@ -201,7 +201,7 @@ bool QWebEngineCookieStorePrivate::canAccessCookies(const QUrl &firstPartyUrl, c
toGurl(firstPartyUrl),
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
- QWebEngineCookieStore::FilterRequest request = { thirdParty, firstPartyUrl, url };
+ QWebEngineCookieStore::FilterRequest request = { firstPartyUrl, url, thirdParty, false, 0};
return filterCallback(request);
}
@@ -408,6 +408,16 @@ void QWebEngineCookieStore::setCookieFilter(std::function<bool(const FilterReque
*/
/*!
+ \variable QWebEngineCookieStore::FilterRequest::_reservedFlag
+ \internal
+*/
+
+/*!
+ \variable QWebEngineCookieStore::FilterRequest::_reservedType
+ \internal
+*/
+
+/*!
\variable QWebEngineCookieStore::FilterRequest::origin
\brief The URL of the script or content accessing a cookie.
diff --git a/src/core/api/qwebenginecookiestore.h b/src/core/api/qwebenginecookiestore.h
index a62765f77..87d7390a3 100644
--- a/src/core/api/qwebenginecookiestore.h
+++ b/src/core/api/qwebenginecookiestore.h
@@ -62,9 +62,11 @@ class QWEBENGINE_EXPORT QWebEngineCookieStore : public QObject {
public:
struct FilterRequest {
- bool thirdParty;
QUrl firstPartyUrl;
QUrl origin;
+ bool thirdParty;
+ bool _reservedFlag;
+ ushort _reservedType;
};
virtual ~QWebEngineCookieStore();
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 60d7e3fdf..30ec43ca0 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -53,6 +53,7 @@
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/common/url_schemes.h"
#include "content/public/browser/browser_main_parts.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/client_certificate_delegate.h"
#include "content/public/browser/media_observer.h"
@@ -92,6 +93,7 @@
#include "certificate_error_controller_p.h"
#include "desktop_screen_qt.h"
#include "devtools_manager_delegate_qt.h"
+#include "location_provider_qt.h"
#include "media_capture_devices_dispatcher.h"
#include "net/network_delegate_qt.h"
#include "net/qrc_protocol_handler_qt.h"
@@ -733,6 +735,26 @@ bool ContentBrowserClientQt::CanCreateWindow(
return (settings && settings->getJavaScriptCanOpenWindowsAutomatically()) || user_gesture;
}
+std::unique_ptr<device::LocationProvider> ContentBrowserClientQt::OverrideSystemLocationProvider()
+{
+ return base::WrapUnique(new LocationProviderQt());
+}
+
+scoped_refptr<net::URLRequestContextGetter> GetSystemRequestContextOnUIThread()
+{
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ return scoped_refptr<net::URLRequestContextGetter>(
+ BrowserContextAdapter::defaultContext()->browserContext()->GetRequestContext());
+}
+
+void ContentBrowserClientQt::GetGeolocationRequestContext(
+ base::OnceCallback<void(scoped_refptr<net::URLRequestContextGetter>)> callback)
+{
+ content::BrowserThread::PostTaskAndReplyWithResult(
+ content::BrowserThread::UI, FROM_HERE,
+ base::BindOnce(&GetSystemRequestContextOnUIThread), std::move(callback));
+}
+
bool ContentBrowserClientQt::AllowGetCookie(const GURL &url,
const GURL &first_party,
const net::CookieList & /*cookie_list*/,
diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
index 5ef2cddfb..d803c856e 100644
--- a/src/core/content_browser_client_qt.h
+++ b/src/core/content_browser_client_qt.h
@@ -169,6 +169,8 @@ public:
content::ResourceContext *context,
const std::vector<std::pair<int, int> > &render_frames) override;
+ std::unique_ptr<device::LocationProvider> OverrideSystemLocationProvider() override;
+ void GetGeolocationRequestContext(base::OnceCallback<void(scoped_refptr<net::URLRequestContextGetter>)> callback) override;
#if defined(Q_OS_LINUX)
void GetAdditionalMappedFilesForChildProcess(const base::CommandLine& command_line, int child_process_id, content::PosixFileDescriptorInfo* mappings) override;
#endif
diff --git a/src/core/gl_surface_qt.cpp b/src/core/gl_surface_qt.cpp
index 8bfbd865c..0d143ee18 100644
--- a/src/core/gl_surface_qt.cpp
+++ b/src/core/gl_surface_qt.cpp
@@ -72,6 +72,14 @@
#include "ozone/gl_surface_glx_qt.h"
#include "ui/gl/gl_glx_api_implementation.h"
#include <dlfcn.h>
+
+#ifndef QT_NO_OPENGL
+#include <QOpenGLContext>
+QT_BEGIN_NAMESPACE
+Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
+QT_END_NAMESPACE
+#endif
+
#endif
#include "ozone/gl_surface_egl_qt.h"
@@ -195,10 +203,20 @@ bool InitializeStaticGLBindings(GLImplementation implementation) {
reinterpret_cast<GLGetProcAddressProc>(
base::GetFunctionPointerFromNativeLibrary(library,
"glXGetProcAddress"));
+
+#ifndef QT_NO_OPENGL
if (!get_proc_address) {
- LOG(ERROR) << "glxGetProcAddress not found.";
- base::UnloadNativeLibrary(library);
- return false;
+ // glx handle not loaded , fallback to qpa
+ if (QOpenGLContext *context = qt_gl_global_share_context()) {
+ get_proc_address = reinterpret_cast<gl::GLGetProcAddressProc>(
+ context->getProcAddress("glXGetProcAddress"));
+ }
+ }
+#endif
+ if (!get_proc_address) {
+ LOG(ERROR) << "glxGetProcAddress not found.";
+ base::UnloadNativeLibrary(library);
+ return false;
}
SetGLGetProcAddressProc(get_proc_address);
diff --git a/src/core/quota_request_controller_impl.cpp b/src/core/quota_request_controller_impl.cpp
index ee94e1cdd..a18ad761d 100644
--- a/src/core/quota_request_controller_impl.cpp
+++ b/src/core/quota_request_controller_impl.cpp
@@ -54,6 +54,11 @@ QuotaRequestControllerImpl::QuotaRequestControllerImpl(
, m_callback(callback)
{}
+QuotaRequestControllerImpl::~QuotaRequestControllerImpl()
+{
+ reject();
+}
+
void QuotaRequestControllerImpl::accepted()
{
m_context->dispatchCallbackOnIOThread(m_callback, QuotaPermissionContextQt::QUOTA_PERMISSION_RESPONSE_ALLOW);
diff --git a/src/core/quota_request_controller_impl.h b/src/core/quota_request_controller_impl.h
index dacdce72f..5814895f3 100644
--- a/src/core/quota_request_controller_impl.h
+++ b/src/core/quota_request_controller_impl.h
@@ -52,6 +52,8 @@ public:
const content::StorageQuotaParams &params,
const content::QuotaPermissionContext::PermissionCallback &callback);
+ ~QuotaRequestControllerImpl();
+
protected:
void accepted() override;
void rejected() override;
diff --git a/src/core/register_protocol_handler_request_controller_impl.cpp b/src/core/register_protocol_handler_request_controller_impl.cpp
index 1e3a15c93..0f24d8812 100644
--- a/src/core/register_protocol_handler_request_controller_impl.cpp
+++ b/src/core/register_protocol_handler_request_controller_impl.cpp
@@ -54,6 +54,11 @@ RegisterProtocolHandlerRequestControllerImpl::RegisterProtocolHandlerRequestCont
, m_handler(handler)
{}
+RegisterProtocolHandlerRequestControllerImpl::~RegisterProtocolHandlerRequestControllerImpl()
+{
+ reject();
+}
+
ProtocolHandlerRegistry *RegisterProtocolHandlerRequestControllerImpl::protocolHandlerRegistry()
{
content::WebContents *webContents = web_contents();
diff --git a/src/core/register_protocol_handler_request_controller_impl.h b/src/core/register_protocol_handler_request_controller_impl.h
index 5ad64210c..64f229ac4 100644
--- a/src/core/register_protocol_handler_request_controller_impl.h
+++ b/src/core/register_protocol_handler_request_controller_impl.h
@@ -57,6 +57,8 @@ public:
content::WebContents *webContents,
ProtocolHandler handler);
+ ~RegisterProtocolHandlerRequestControllerImpl();
+
protected:
void accepted() override;
void rejected() override;
diff --git a/src/core/request_controller.h b/src/core/request_controller.h
index a15c601d7..ffcf9edac 100644
--- a/src/core/request_controller.h
+++ b/src/core/request_controller.h
@@ -70,10 +70,7 @@ public:
}
}
- virtual ~RequestController()
- {
- reject();
- }
+ virtual ~RequestController() {}
protected:
virtual void accepted() = 0;
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 335c65880..aae7f4a43 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -44,6 +44,7 @@
#include "web_contents_delegate_qt.h"
#include "browser_context_adapter.h"
+#include "browser_context_qt.h"
#include "color_chooser_qt.h"
#include "color_chooser_controller.h"
#include "favicon_manager.h"
@@ -116,19 +117,25 @@ WebContentsDelegateQt::~WebContentsDelegateQt()
content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents *source, const content::OpenURLParams &params)
{
content::WebContents *target = source;
+ content::SiteInstance *target_site_instance = params.source_site_instance.get();
+ content::Referrer referrer = params.referrer;
if (params.disposition != WindowOpenDisposition::CURRENT_TAB) {
QSharedPointer<WebContentsAdapter> targetAdapter = createWindow(0, params.disposition, gfx::Rect(), params.user_gesture);
if (targetAdapter) {
+ if (targetAdapter->browserContext() != source->GetBrowserContext()) {
+ target_site_instance = nullptr;
+ referrer = content::Referrer();
+ }
if (!targetAdapter->isInitialized())
- targetAdapter->initialize(params.source_site_instance.get());
+ targetAdapter->initialize(target_site_instance);
target = targetAdapter->webContents();
}
}
Q_ASSERT(target);
content::NavigationController::LoadURLParams load_url_params(params.url);
- load_url_params.source_site_instance = params.source_site_instance;
- load_url_params.referrer = params.referrer;
+ load_url_params.source_site_instance = target_site_instance;
+ load_url_params.referrer = referrer;
load_url_params.frame_tree_node_id = params.frame_tree_node_id;
load_url_params.redirect_chain = params.redirect_chain;
load_url_params.transition_type = params.transition;
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index ffc0b6989..025df76c7 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -217,6 +217,7 @@ private Q_SLOTS:
void registerProtocolHandler();
void dataURLFragment();
void devTools();
+ void openLinkInDifferentProfile();
private:
static QPoint elementCenter(QWebEnginePage *page, const QString &id);
@@ -4373,6 +4374,33 @@ void tst_QWebEnginePage::devTools()
QCOMPARE(devToolsPage.inspectedPage(), nullptr);
}
+void tst_QWebEnginePage::openLinkInDifferentProfile()
+{
+ class Page : public QWebEnginePage {
+ public:
+ QWebEnginePage *targetPage = nullptr;
+ Page(QWebEngineProfile *profile) : QWebEnginePage(profile) {}
+ private:
+ QWebEnginePage *createWindow(WebWindowType) override { return targetPage; }
+ };
+ QWebEngineProfile profile1, profile2;
+ Page page1(&profile1), page2(&profile2);
+ QWebEngineView view;
+ view.setPage(&page1);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QSignalSpy spy1(&page1, &QWebEnginePage::loadFinished), spy2(&page2, &QWebEnginePage::loadFinished);
+ page1.setHtml("<html><body>"
+ "<a id='link' href='data:,hello'>link</a>"
+ "</body></html>");
+ QTRY_COMPARE(spy1.count(), 1);
+ QVERIFY(spy1.takeFirst().value(0).toBool());
+ page1.targetPage = &page2;
+ QTest::mouseClick(view.focusProxy(), Qt::MiddleButton, 0, elementCenter(&page1, "link"));
+ QTRY_COMPARE(spy2.count(), 1);
+ QVERIFY(spy2.takeFirst().value(0).toBool());
+}
+
static QByteArrayList params = {QByteArrayLiteral("--use-fake-device-for-media-stream")};
W_QTEST_MAIN(tst_QWebEnginePage, params)