summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-01-08 14:07:39 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-01-17 10:51:31 +0000
commit9efaba1b6e85008623776287169278d1195e5bf7 (patch)
tree8f3f36ac497f982daa9b26e66d0745a4d7922c9a
parentbc644233fd28942d45e25316c0fe8cfde966e33b (diff)
downloadqtwebengine-chromium-9efaba1b6e85008623776287169278d1195e5bf7.tar.gz
Make WebAuth optional
We don't use it, and the code is terrible at cross platform support, and handling it takes up most of the adaption time. Change-Id: I1ac3165f736dea9ce9b9c26aa9afbac9355305c3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--chromium/content/browser/BUILD.gn10
-rw-r--r--chromium/content/browser/frame_host/render_frame_host_impl.cc6
-rw-r--r--chromium/content/browser/frame_host/render_frame_host_impl.h2
-rw-r--r--chromium/content/common/BUILD.gn1
-rw-r--r--chromium/content/common/features.gni2
-rw-r--r--chromium/content/public/browser/BUILD.gn13
-rw-r--r--chromium/content/public/browser/content_browser_client.cc7
-rw-r--r--chromium/content/public/browser/content_browser_client.h3
8 files changed, 34 insertions, 10 deletions
diff --git a/chromium/content/browser/BUILD.gn b/chromium/content/browser/BUILD.gn
index 5aac49f25ee..6a64c23880c 100644
--- a/chromium/content/browser/BUILD.gn
+++ b/chromium/content/browser/BUILD.gn
@@ -8,6 +8,7 @@ import("//build/config/jumbo.gni")
import("//build/config/linux/pangocairo/pangocairo.gni")
import("//build/config/ui.gni")
import("//chromeos/assistant/assistant.gni")
+import("//content/common/features.gni")
import("//gpu/vulkan/features.gni")
import("//media/media_options.gni")
import("//net/features.gni")
@@ -91,7 +92,6 @@ jumbo_source_set("browser") {
"//crypto",
"//device/base",
"//device/bluetooth",
- "//device/fido",
"//device/gamepad",
"//device/vr/public/mojom",
"//google_apis",
@@ -2336,8 +2336,11 @@ jumbo_source_set("browser") {
"host_zoom_map_impl.h",
"host_zoom_map_observer.cc",
"host_zoom_map_observer.h",
+ ]
+ }
- # Most webauth code is non-Android
+ if (enable_web_auth) {
+ sources += [
"webauth/authenticator_impl.cc",
"webauth/authenticator_impl.h",
"webauth/authenticator_type_converters.cc",
@@ -2349,6 +2352,9 @@ jumbo_source_set("browser") {
"webauth/virtual_discovery.cc",
"webauth/virtual_discovery.h",
]
+ deps += [
+ "//device/fido",
+ ]
}
if (is_mac && !use_qt) {
diff --git a/chromium/content/browser/frame_host/render_frame_host_impl.cc b/chromium/content/browser/frame_host/render_frame_host_impl.cc
index a67c35a1d06..d860bd1c99e 100644
--- a/chromium/content/browser/frame_host/render_frame_host_impl.cc
+++ b/chromium/content/browser/frame_host/render_frame_host_impl.cc
@@ -3700,7 +3700,7 @@ void RenderFrameHostImpl::RegisterMojoInterfaces() {
registry_->AddInterface(base::Bind(&ImageCaptureImpl::Create));
-#if !defined(OS_ANDROID)
+#if BUILDFLAG(ENABLE_WEB_AUTH)
if (base::FeatureList::IsEnabled(features::kWebAuth)) {
registry_->AddInterface(
base::Bind(&RenderFrameHostImpl::BindAuthenticatorRequest,
@@ -3714,7 +3714,7 @@ void RenderFrameHostImpl::RegisterMojoInterfaces() {
base::Unretained(environment_singleton)));
}
}
-#endif // !defined(OS_ANDROID)
+#endif // BUILDFLAG(ENABLE_WEB_AUTH)
sensor_provider_proxy_.reset(
new SensorProviderProxyImpl(permission_controller, this));
@@ -5278,7 +5278,7 @@ void RenderFrameHostImpl::BindPresentationServiceRequest(
presentation_service_->Bind(std::move(request));
}
-#if !defined(OS_ANDROID)
+#if BUILDFLAG(ENABLE_WEB_AUTH)
void RenderFrameHostImpl::BindAuthenticatorRequest(
blink::mojom::AuthenticatorRequest request) {
if (!authenticator_impl_)
diff --git a/chromium/content/browser/frame_host/render_frame_host_impl.h b/chromium/content/browser/frame_host/render_frame_host_impl.h
index 9ab530574d5..8fb841c7ecd 100644
--- a/chromium/content/browser/frame_host/render_frame_host_impl.h
+++ b/chromium/content/browser/frame_host/render_frame_host_impl.h
@@ -1164,7 +1164,7 @@ class CONTENT_EXPORT RenderFrameHostImpl
void BindPresentationServiceRequest(
blink::mojom::PresentationServiceRequest request);
-#if !defined(OS_ANDROID)
+#if BUILDFLAG(ENABLE_WEB_AUTH)
void BindAuthenticatorRequest(blink::mojom::AuthenticatorRequest request);
#endif
diff --git a/chromium/content/common/BUILD.gn b/chromium/content/common/BUILD.gn
index decd4c5f682..f79f1be5433 100644
--- a/chromium/content/common/BUILD.gn
+++ b/chromium/content/common/BUILD.gn
@@ -23,6 +23,7 @@ buildflag_header("buildflags") {
flags = [
"USE_EXTERNAL_POPUP_MENU=$use_external_popup_menu",
+ "ENABLE_WEB_AUTH=$enable_web_auth",
"ALLOW_CRITICAL_MEMORY_PRESSURE_HANDLING_IN_FOREGROUND=$allow_critical_memory_pressure_handling_in_foreground",
]
}
diff --git a/chromium/content/common/features.gni b/chromium/content/common/features.gni
index b1bcb83306b..5c87cf9f9ef 100644
--- a/chromium/content/common/features.gni
+++ b/chromium/content/common/features.gni
@@ -11,4 +11,6 @@ declare_args() {
# Whether to perform critical memory pressure handling when in foreground (if
# false, critical memory pressure is treated like moderate pressure in foreground).
allow_critical_memory_pressure_handling_in_foreground = is_chromecast
+
+ enable_web_auth = !is_android
}
diff --git a/chromium/content/public/browser/BUILD.gn b/chromium/content/public/browser/BUILD.gn
index b8e2f2126b1..19ae957f59f 100644
--- a/chromium/content/public/browser/BUILD.gn
+++ b/chromium/content/public/browser/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/jumbo.gni")
import("//build/config/ui.gni")
+import("//content/common/features.gni")
import("//media/media_options.gni")
# See //content/BUILD.gn for how this works.
@@ -42,8 +43,6 @@ jumbo_source_set("browser_sources") {
"audio_loopback_stream_creator.h",
"audio_service_info.cc",
"audio_service_info.h",
- "authenticator_request_client_delegate.cc",
- "authenticator_request_client_delegate.h",
"ax_event_notification_details.cc",
"ax_event_notification_details.h",
"background_fetch_delegate.cc",
@@ -360,7 +359,6 @@ jumbo_source_set("browser_sources") {
"//cc",
"//components/viz/host",
"//content/browser", # Must not be public_deps!
- "//device/fido",
"//gpu",
"//gpu/command_buffer/service:gles2",
"//media",
@@ -417,6 +415,15 @@ jumbo_source_set("browser_sources") {
]
}
+ if (enable_web_auth) {
+ sources += [
+ "authenticator_request_client_delegate.cc",
+ "authenticator_request_client_delegate.h",
+ ]
+ deps += [ "//device/fido" ]
+ }
+
+
if (enable_webrtc) {
sources += [
"desktop_capture.cc",
diff --git a/chromium/content/public/browser/content_browser_client.cc b/chromium/content/public/browser/content_browser_client.cc
index 6ed69effde7..47057d8700c 100644
--- a/chromium/content/public/browser/content_browser_client.cc
+++ b/chromium/content/public/browser/content_browser_client.cc
@@ -12,7 +12,6 @@
#include "base/logging.h"
#include "base/no_destructor.h"
#include "build/build_config.h"
-#include "content/public/browser/authenticator_request_client_delegate.h"
#include "content/public/browser/client_certificate_delegate.h"
#include "content/public/browser/login_delegate.h"
#include "content/public/browser/memory_coordinator_delegate.h"
@@ -40,6 +39,10 @@
#include "url/gurl.h"
#include "url/origin.h"
+#if BUILDFLAG(ENABLE_WEB_AUTH)
+#include "content/public/browser/authenticator_request_client_delegate.h"
+#endif
+
namespace content {
void OverrideOnBindInterface(const service_manager::BindSourceInfo& remote_info,
@@ -758,11 +761,13 @@ bool ContentBrowserClient::ShouldCreateTaskScheduler() {
return true;
}
+#if BUILDFLAG(ENABLE_WEB_AUTH)
std::unique_ptr<AuthenticatorRequestClientDelegate>
ContentBrowserClient::GetWebAuthenticationRequestDelegate(
RenderFrameHost* render_frame_host) {
return std::make_unique<AuthenticatorRequestClientDelegate>();
}
+#endif
#if defined(OS_MACOSX)
bool ContentBrowserClient::IsWebAuthenticationTouchIdAuthenticatorSupported() {
diff --git a/chromium/content/public/browser/content_browser_client.h b/chromium/content/public/browser/content_browser_client.h
index e65508a9405..ed14c8b3e3c 100644
--- a/chromium/content/public/browser/content_browser_client.h
+++ b/chromium/content/public/browser/content_browser_client.h
@@ -20,6 +20,7 @@
#include "base/task/task_scheduler/task_scheduler.h"
#include "base/values.h"
#include "build/build_config.h"
+#include "content/common/buildflags.h"
#include "content/public/browser/certificate_request_result_type.h"
#include "content/public/browser/global_request_id.h"
#include "content/public/browser/global_routing_id.h"
@@ -1294,8 +1295,10 @@ class CONTENT_EXPORT ContentBrowserClient {
// destroyed before the RenderFrame goes out of scope. The embedder may choose
// to return nullptr to indicate that the request cannot be serviced right
// now.
+#if BUILDFLAG(ENABLE_WEB_AUTH)
virtual std::unique_ptr<AuthenticatorRequestClientDelegate>
GetWebAuthenticationRequestDelegate(RenderFrameHost* render_frame_host);
+#endif
#if defined(OS_MACOSX)
// Returns whether WebAuthn supports the built-in Touch ID platform