summaryrefslogtreecommitdiffstats
path: root/src/core
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 /src/core
parentf8898170a77593e314d3cd187f259223e9bff0f8 (diff)
parent28e0320235d33f00c6c141a549dc0553ee0043a5 (diff)
Merge remote-tracking branch 'origin/5.11.0' into 5.11
Diffstat (limited to 'src/core')
-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
11 files changed, 84 insertions, 12 deletions
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;