summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2018-10-12 11:58:16 +0200
committerMichal Klocek <michal.klocek@qt.io>2018-10-18 07:48:55 +0000
commit5be48d4238465b4efd36ed4bbb96ec407be9f217 (patch)
tree3d41907c39b0cb13861af01ee4d2385414a1b47d
parent267dd7fa09855bd0b8dedf7edcb126e034d8e1f8 (diff)
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 <allan.jensen@qt.io>
m---------src/3rdparty0
-rw-r--r--src/core/content_browser_client_qt.cpp7
-rw-r--r--src/core/content_browser_client_qt.h1
-rw-r--r--src/core/content_main_delegate_qt.cpp6
-rw-r--r--src/core/content_main_delegate_qt.h4
-rw-r--r--src/core/content_utility_client_qt.cpp60
-rw-r--r--src/core/content_utility_client_qt.h56
-rw-r--r--src/core/core_chromium.pri2
-rw-r--r--src/core/qtwebengine.gni1
9 files changed, 136 insertions, 1 deletions
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 4b6a9b086ba762ed07408f0ac5b748ae57b3f05
+Subproject b8ddfcac420ee4bb1e294c95c14afef559bcb2d
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<base::Value> 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<base::Value> 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<ContentBrowserClientQt> m_browserClient;
+ std::unique_ptr<ContentUtilityClientQt> 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"
]