From 6b347edb557bf0bbcf6b7b1ef30494f2c2db2397 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 27 Sep 2018 14:51:24 +0200 Subject: Do not bind resolve proxy factory on ui thread Pass interface to io thread and bind there. Task-number: QTBUG-69281 Change-Id: Ia8630cb7ff216cecaec5274a0b3da3ef0881fcea Reviewed-by: Kai Koehne --- src/core/net/url_request_context_getter_qt.cpp | 6 ++++-- src/core/net/url_request_context_getter_qt.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/net/url_request_context_getter_qt.cpp b/src/core/net/url_request_context_getter_qt.cpp index 1bb7b080f..e964aff65 100644 --- a/src/core/net/url_request_context_getter_qt.cpp +++ b/src/core/net/url_request_context_getter_qt.cpp @@ -182,7 +182,8 @@ void URLRequestContextGetterQt::updateStorageSettings() new ProxyConfigServiceQt( net::ProxyService::CreateSystemProxyConfigService( content::BrowserThread::GetTaskRunnerForThread(BrowserThread::IO))); - m_proxyResolverFactory = ChromeMojoProxyResolverFactory::CreateWithStrongBinding(); + //pass interface to io thread + m_proxyResolverFactoryInterface = ChromeMojoProxyResolverFactory::CreateWithStrongBinding().PassInterface(); if (m_contextInitialized) content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, @@ -259,8 +260,9 @@ void URLRequestContextGetterQt::generateStorage() if (!m_dhcpProxyScriptFetcherFactory) m_dhcpProxyScriptFetcherFactory.reset(new net::DhcpProxyScriptFetcherFactory); + proxy_resolver::mojom::ProxyResolverFactoryPtr proxyResolver(std::move(m_proxyResolverFactoryInterface)); m_storage->set_proxy_service(content::CreateProxyServiceUsingMojoFactory( - std::move(m_proxyResolverFactory), + std::move(proxyResolver), std::unique_ptr(proxyConfigService), std::make_unique(m_urlRequestContext.get()), m_dhcpProxyScriptFetcherFactory->Create(m_urlRequestContext.get()), diff --git a/src/core/net/url_request_context_getter_qt.h b/src/core/net/url_request_context_getter_qt.h index 717827543..0e4e84b4a 100644 --- a/src/core/net/url_request_context_getter_qt.h +++ b/src/core/net/url_request_context_getter_qt.h @@ -126,7 +126,7 @@ private: content::URLRequestInterceptorScopedVector m_requestInterceptors; std::unique_ptr m_httpNetworkSession; std::unique_ptr m_httpAuthPreferences; - proxy_resolver::mojom::ProxyResolverFactoryPtr m_proxyResolverFactory; + mojo::InterfacePtrInfo m_proxyResolverFactoryInterface; std::unique_ptr m_transportSecurityPersister; QList m_installedCustomSchemes; -- cgit v1.2.3 From 3edd9466fb50ef817e2dffced023668c9c595bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Mon, 8 Oct 2018 17:35:57 +0200 Subject: Update Chromium Pull in fix for build failure on macOS with 10.14 Fixes: QTBUG-70981 Change-Id: Ie302e3b7f21edfe4390248c4953dbcce6525715a Reviewed-by: Alexandru Croitor --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index 13aed8009..4b6a9b086 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 13aed800921e760e1cd9dba8c77f10fda849274a +Subproject commit 4b6a9b086ba762ed07408f0ac5b748ae57b3f051 -- cgit v1.2.3 From bdb2c84ef50f316be7fde884542c10508f2a3bba Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 2 Oct 2018 17:23:08 +0200 Subject: Add content_browser manifest handling Task-number: QTBUG-69281 Change-Id: If48d1a7ad723b18d4577d675b11c0cdc5e22f758 Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Kai Koehne --- src/core/content_browser_client_qt.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 3878bd1bf..c90d365da 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -689,6 +689,8 @@ std::unique_ptr ContentBrowserClientQt::GetServiceManifestOverlay(b id = IDR_QTWEBENGINE_CONTENT_PACKAGED_SERVICES_MANIFEST_OVERLAY; else if (name == content::mojom::kRendererServiceName) id = IDR_QTWEBENGINE_CONTENT_RENDERER_MANIFEST_OVERLAY; + else if (name == content::mojom::kBrowserServiceName) + id = IDR_QTWEBENGINE_CONTENT_BROWSER_MANIFEST_OVERLAY; if (id == -1) return nullptr; -- cgit v1.2.3 From 267dd7fa09855bd0b8dedf7edcb126e034d8e1f8 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 15 Oct 2018 13:28:05 +0200 Subject: Fix race condition in ResourceDispatcherHostLoginDelegateQt Do no access m_request from ui thread. The auth request can get cancelled, this can happen for example when a new navigation interrupts the current one. Fixes: QTBUG-71128 Change-Id: I140b1a164294342bad13a76342c1f642ba0960c8 Reviewed-by: Kai Koehne --- src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp | 6 ++++-- src/core/renderer_host/resource_dispatcher_host_delegate_qt.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp b/src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp index 421b3167b..eb43f46ad 100644 --- a/src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp +++ b/src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp @@ -59,6 +59,7 @@ namespace QtWebEngineCore { ResourceDispatcherHostLoginDelegateQt::ResourceDispatcherHostLoginDelegateQt(net::AuthChallengeInfo *authInfo, net::URLRequest *request) : m_authInfo(authInfo) , m_request(request) + , m_url(request->url()) { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); const content::ResourceRequestInfo *requestInfo = content::ResourceRequestInfo::ForRequest(request); @@ -81,11 +82,12 @@ ResourceDispatcherHostLoginDelegateQt::~ResourceDispatcherHostLoginDelegateQt() void ResourceDispatcherHostLoginDelegateQt::OnRequestCancelled() { destroy(); + // TODO: this should close native dialog, since page can be navigated somewhere else } QUrl ResourceDispatcherHostLoginDelegateQt::url() const { - return toQt(m_request->url()); + return toQt(m_url); } QString ResourceDispatcherHostLoginDelegateQt::realm() const @@ -135,7 +137,7 @@ void ResourceDispatcherHostLoginDelegateQt::sendAuthToRequester(bool success, co void ResourceDispatcherHostLoginDelegateQt::destroy() { m_dialogController.reset(); - m_request = 0; + m_request = nullptr; } static void LaunchURL(const GURL& url, int render_process_id, diff --git a/src/core/renderer_host/resource_dispatcher_host_delegate_qt.h b/src/core/renderer_host/resource_dispatcher_host_delegate_qt.h index c254a60f5..fa1f8108f 100644 --- a/src/core/renderer_host/resource_dispatcher_host_delegate_qt.h +++ b/src/core/renderer_host/resource_dispatcher_host_delegate_qt.h @@ -73,7 +73,7 @@ private: // The request that wants login data. // Must only be accessed on the IO thread. net::URLRequest *m_request; - + GURL m_url; // This member is used to keep authentication dialog controller alive until // authorization is sent or cancelled. QSharedPointer m_dialogController; -- cgit v1.2.3 From 5be48d4238465b4efd36ed4bbb96ec407be9f217 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Fri, 12 Oct 2018 11:58:16 +0200 Subject: Add proxy resolver service This adds proxy resolver service as a part of content utility process and pulls in the corresponding change in Chromium. Fixes: QTBUG-69281 Change-Id: Icb2b67e1e506a5b511531322a8c13d7df0e11f9f Reviewed-by: Allan Sandfeld Jensen --- src/3rdparty | 2 +- src/core/content_browser_client_qt.cpp | 7 ++++ src/core/content_browser_client_qt.h | 1 + src/core/content_main_delegate_qt.cpp | 6 ++++ src/core/content_main_delegate_qt.h | 4 ++- src/core/content_utility_client_qt.cpp | 60 ++++++++++++++++++++++++++++++++++ src/core/content_utility_client_qt.h | 56 +++++++++++++++++++++++++++++++ src/core/core_chromium.pri | 2 ++ src/core/qtwebengine.gni | 1 + 9 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 src/core/content_utility_client_qt.cpp create mode 100644 src/core/content_utility_client_qt.h (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index 4b6a9b086..b8ddfcac4 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 4b6a9b086ba762ed07408f0ac5b748ae57b3f051 +Subproject commit b8ddfcac420ee4bb1e294c95c14afef559bcb2d2 diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index c90d365da..a1fc7116e 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -76,6 +76,7 @@ #include "services/service_manager/public/cpp/bind_source_info.h" #include "services/service_manager/public/cpp/binder_registry.h" #include "services/service_manager/public/cpp/service.h" +#include "services/proxy_resolver/proxy_resolver_service.h" #include "third_party/WebKit/public/platform/modules/insecure_input/insecure_input_service.mojom.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_switches.h" @@ -104,6 +105,7 @@ #include "quota_permission_context_qt.h" #include "renderer_host/resource_dispatcher_host_delegate_qt.h" #include "renderer_host/user_resource_controller_host.h" +#include "type_conversion.h" #include "web_contents_delegate_qt.h" #include "web_engine_context.h" #include "web_engine_library_info.h" @@ -681,6 +683,11 @@ void ContentBrowserClientQt::RegisterInProcessServices(StaticServiceMap* service services->insert(std::make_pair("qtwebengine", info)); } +void ContentBrowserClientQt::RegisterOutOfProcessServices(content::ContentBrowserClient::OutOfProcessServiceMap *services) +{ + (*services)[proxy_resolver::mojom::kProxyResolverServiceName] = toString16(QLatin1String("V8 Proxy Resolver")); +} + std::unique_ptr ContentBrowserClientQt::GetServiceManifestOverlay(base::StringPiece name) { ui::ResourceBundle &rb = ui::ResourceBundle::GetSharedInstance(); diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h index d803c856e..6b2487944 100644 --- a/src/core/content_browser_client_qt.h +++ b/src/core/content_browser_client_qt.h @@ -119,6 +119,7 @@ public: const std::string& interface_name, mojo::ScopedMessagePipeHandle interface_pipe) override; void RegisterInProcessServices(StaticServiceMap* services) override; + void RegisterOutOfProcessServices(OutOfProcessServiceMap* services) override; std::unique_ptr GetServiceManifestOverlay(base::StringPiece name) override; bool CanCreateWindow( content::RenderFrameHost* opener, diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp index 359e0b3d9..a3b8a9d64 100644 --- a/src/core/content_main_delegate_qt.cpp +++ b/src/core/content_main_delegate_qt.cpp @@ -184,6 +184,12 @@ content::ContentRendererClient *ContentMainDelegateQt::CreateContentRendererClie return new ContentRendererClientQt; } +content::ContentUtilityClient *ContentMainDelegateQt::CreateContentUtilityClient() +{ + m_utilityClient.reset(new ContentUtilityClientQt); + return m_utilityClient.get(); +} + // see icu_util.cc #define ICU_UTIL_DATA_FILE 0 #define ICU_UTIL_DATA_SHARED 1 diff --git a/src/core/content_main_delegate_qt.h b/src/core/content_main_delegate_qt.h index 407687c81..c06afb0fb 100644 --- a/src/core/content_main_delegate_qt.h +++ b/src/core/content_main_delegate_qt.h @@ -43,6 +43,7 @@ #include "content/public/app/content_main_delegate.h" #include "content_browser_client_qt.h" +#include "content_utility_client_qt.h" namespace QtWebEngineCore { @@ -56,11 +57,12 @@ public: content::ContentBrowserClient* CreateContentBrowserClient() override; content::ContentRendererClient* CreateContentRendererClient() override; - + content::ContentUtilityClient* CreateContentUtilityClient() override; bool BasicStartupComplete(int* /*exit_code*/) override; private: std::unique_ptr m_browserClient; + std::unique_ptr m_utilityClient; }; } // namespace QtWebEngineCore diff --git a/src/core/content_utility_client_qt.cpp b/src/core/content_utility_client_qt.cpp new file mode 100644 index 000000000..9e86826fe --- /dev/null +++ b/src/core/content_utility_client_qt.cpp @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "content_utility_client_qt.h" + +#include "content/public/utility/utility_thread.h" +#include "services/proxy_resolver/proxy_resolver_service.h" + +ContentUtilityClientQt::ContentUtilityClientQt() { +} + +ContentUtilityClientQt::~ContentUtilityClientQt() = default; + + +void ContentUtilityClientQt::RegisterServices( + ContentUtilityClient::StaticServiceMap* services) { + service_manager::EmbeddedServiceInfo proxy_resolver_info; + proxy_resolver_info.task_runner = + content::ChildThread::Get()->GetIOTaskRunner(); + proxy_resolver_info.factory = + base::Bind(&proxy_resolver::ProxyResolverService::CreateService); + services->emplace(proxy_resolver::mojom::kProxyResolverServiceName, + proxy_resolver_info); +} diff --git a/src/core/content_utility_client_qt.h b/src/core/content_utility_client_qt.h new file mode 100644 index 000000000..df1eb5557 --- /dev/null +++ b/src/core/content_utility_client_qt.h @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef CONTENT_UTILITY_CLIENT_QT_H +#define CONTENT_UTILITY_CLIENT_QT_H +#include "content/public/utility/content_utility_client.h" + +class MashServiceFactory; +class UtilityMessageHandler; + +class ContentUtilityClientQt : public content::ContentUtilityClient { + public: + ContentUtilityClientQt(); + ~ContentUtilityClientQt() override; + + // content::ContentUtilityClient: + void RegisterServices(StaticServiceMap* services) override; +}; + +#endif diff --git a/src/core/core_chromium.pri b/src/core/core_chromium.pri index 73e07c156..bbe30a33b 100644 --- a/src/core/core_chromium.pri +++ b/src/core/core_chromium.pri @@ -55,6 +55,7 @@ SOURCES = \ content_client_qt.cpp \ content_browser_client_qt.cpp \ content_main_delegate_qt.cpp \ + content_utility_client_qt.cpp \ delegated_frame_node.cpp \ desktop_screen_qt.cpp \ devtools_frontend_qt.cpp \ @@ -140,6 +141,7 @@ HEADERS = \ content_client_qt.h \ content_browser_client_qt.h \ content_main_delegate_qt.h \ + content_utility_client_qt.h \ delegated_frame_node.h \ desktop_screen_qt.h \ devtools_frontend_qt.h \ diff --git a/src/core/qtwebengine.gni b/src/core/qtwebengine.gni index 60165f320..909bbed62 100644 --- a/src/core/qtwebengine.gni +++ b/src/core/qtwebengine.gni @@ -31,6 +31,7 @@ deps = [ "//third_party/WebKit/public:blink", "//ui/accessibility", "//third_party/mesa:mesa_headers", + "//services/proxy_resolver:lib", ":qtwebengine_sources", ":qtwebengine_resources" ] -- cgit v1.2.3