From nobody Sat Oct 29 13:53:29 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N018p09Vnz4fswL; Sat, 29 Oct 2022 13:53:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N018n59h9z3dFW; Sat, 29 Oct 2022 13:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667051609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kddFTolrY5FiPZ3VqQ+J0J8lTtNS/g4sft9QXIdA7AM=; b=QseMPwbbNDhu+1SUfFYJ5Mra45X6KrIodLkPo6WhjIh2/SHAgcENDIYRj4VVtcF3PNJxxp aIOsd7ReZyNKdlpWOCMe7FC2yfNaaJe9CuRd/CPtbakPAvlyCkaxzCT/TrfYxowterMPrd 2+WMHqNlhug02LGzQcLb1Eyq3HnZx7W3IyyB/Ja976yO65fCwLC8MkBbHaSBJlVH/JTVkR EB8myQXICMBtkS8TK+NaugjEFBiFDotvLzYB7gO5E3ntsANJCp0ynvWFobTFCAQffCSzJD 34HDak6uztWboMFh3kBNDK94Hy9Il9GRkQGIQiiNZ1X2w3kqtmZmmEy1jIckTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4N018n4DlCzJxg; Sat, 29 Oct 2022 13:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 29TDrThk048591; Sat, 29 Oct 2022 13:53:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29TDrTkV048590; Sat, 29 Oct 2022 13:53:29 GMT (envelope-from git) Date: Sat, 29 Oct 2022 13:53:29 GMT Message-Id: <202210291353.29TDrTkV048590@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Rene Ladan Subject: git: b92dcd07c7b1 - main - www/chromium: unbreak WebAuthn USB FIDO support by implementing a fake USB service List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rene X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b92dcd07c7b1066c536dd24a8129dafe503f7fc9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667051609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kddFTolrY5FiPZ3VqQ+J0J8lTtNS/g4sft9QXIdA7AM=; b=C9/vqoWvrPP8xB95GgR1GnEFcOHU1cOlRXLf3FqJWVAztEPEi72uKzwGWJX0RjTEYxHNjn s3H0IU7Uv52Bc7EJZoumZVoI2l3E7x8s5EfE9SqzcvPtd/vOAODpZr3BaCN+JmNblQneQ2 jzRhtQ/AbLqSkN8YIi+S9a1asnKX3+5NWF46lfHB9+Uu9JY9UwgkyVIoFr6q2qQDiVFgZG e9hxgHWjHkKT91zYuqzzr+nGImfFpj25n4/Xqe5JsDPuFErjTH0vdX2Ks+r5ySERteDbfS z12yZflRSTE3Rjg9IRCtrpyKz6Nhrslb+zFVe+5rTatn4Xi807naNLNmzTt93A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667051609; a=rsa-sha256; cv=none; b=Gl/swca44IeojKrB8H2dJguPcFl2cyyfoIjAvQvy5obrX8Fi8S2GzSopCiY38TihVbuj+n sw10y8OH05+oMEX1ImYf2NDRH1H7FCURP2TeCFnDcETXerM6bbzJwdDU50Jx7CecrFez/K y5/VSCs/5d/1QbCO9xR35Li+q21bza4KAXlEhU71rV6gFBQ+0axdn+C1wACv/0HKcWIqlf +mwSOMUPPZGaYJEtxwt9epcpgJl7YpZsgsZRthPbMTlOuRc+MMcmeAFJln9EjuGJ/tU5xW LxPgHtVG5jVyPYuAbdWHuTEZ0AY6pUxRscRjfuoWx55glR4ObnNSajCHoyO5hA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rene: URL: https://cgit.FreeBSD.org/ports/commit/?id=b92dcd07c7b1066c536dd24a8129dafe503f7fc9 commit b92dcd07c7b1066c536dd24a8129dafe503f7fc9 Author: Robert Nagy AuthorDate: 2022-10-29 13:32:44 +0000 Commit: Rene Ladan CommitDate: 2022-10-29 13:52:29 +0000 www/chromium: unbreak WebAuthn USB FIDO support by implementing a fake USB service PR: 263790 --- www/chromium/Makefile | 1 + .../files/patch-services_device_usb_BUILD.gn | 20 ++++++-- .../patch-services_device_usb_usb__service.cc | 22 +++++++++ ...patch-services_device_usb_usb__service__fake.cc | 54 ++++++++++++++++++++++ .../patch-services_device_usb_usb__service__fake.h | 51 ++++++++++++++++++++ 5 files changed, 145 insertions(+), 3 deletions(-) diff --git a/www/chromium/Makefile b/www/chromium/Makefile index c6bae9d7775a..322244388162 100644 --- a/www/chromium/Makefile +++ b/www/chromium/Makefile @@ -1,5 +1,6 @@ PORTNAME= chromium PORTVERSION= 107.0.5304.87 +PORTREVISION= 1 CATEGORIES= www wayland MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/ \ https://nerd.hu/distfiles/:external diff --git a/www/chromium/files/patch-services_device_usb_BUILD.gn b/www/chromium/files/patch-services_device_usb_BUILD.gn index 9e9f692c95ad..d731f6cf42b4 100644 --- a/www/chromium/files/patch-services_device_usb_BUILD.gn +++ b/www/chromium/files/patch-services_device_usb_BUILD.gn @@ -1,4 +1,4 @@ ---- services/device/usb/BUILD.gn.orig 2022-02-28 16:54:41 UTC +--- services/device/usb/BUILD.gn.orig 2022-10-29 13:32:26 UTC +++ services/device/usb/BUILD.gn @@ -103,15 +103,17 @@ static_library("usb") { deps += [ "//third_party/re2" ] @@ -13,7 +13,7 @@ - "usb_service_mac.cc", - "usb_service_mac.h", - ] -+ if (is_mac || is_bsd) { ++ if (is_mac || is_openbsd) { + if (is_mac) { + sources += [ + "usb_device_handle_mac.cc", @@ -27,7 +27,21 @@ # These sources and deps are required for libusb. # TODO(https://crbug.com/1096743) Remove these sources. -@@ -152,7 +154,7 @@ static_library("usb") { +@@ -135,6 +137,13 @@ static_library("usb") { + deps += [ "//third_party/libusb" ] + } + ++ if (is_freebsd) { ++ sources += [ ++ "usb_service_fake.cc", ++ "usb_service_fake.h", ++ ] ++ } ++ + if (is_linux || is_chromeos) { + sources += [ + "usb_device_linux.cc", +@@ -152,7 +161,7 @@ static_library("usb") { deps += [ "//device/udev_linux" ] } diff --git a/www/chromium/files/patch-services_device_usb_usb__service.cc b/www/chromium/files/patch-services_device_usb_usb__service.cc new file mode 100644 index 000000000000..296a4d907b0a --- /dev/null +++ b/www/chromium/files/patch-services_device_usb_usb__service.cc @@ -0,0 +1,22 @@ +--- services/device/usb/usb_service.cc.orig 2022-10-29 13:32:26 UTC ++++ services/device/usb/usb_service.cc +@@ -29,6 +29,10 @@ + #include "services/device/usb/usb_service_mac.h" + #elif BUILDFLAG(IS_WIN) + #include "services/device/usb/usb_service_win.h" ++#elif BUILDFLAG(IS_OPENBSD) ++#include "services/device/usb/usb_service_impl.h" ++#elif BUILDFLAG(IS_FREEBSD) ++#include "services/device/usb/usb_service_fake.h" + #endif + + namespace device { +@@ -60,6 +64,8 @@ std::unique_ptr UsbService::Create() { + return base::WrapUnique(new UsbServiceMac()); + else + return base::WrapUnique(new UsbServiceImpl()); ++#elif BUILDFLAG(IS_BSD) ++ return base::WrapUnique(new UsbServiceImpl()); + #else + return nullptr; + #endif diff --git a/www/chromium/files/patch-services_device_usb_usb__service__fake.cc b/www/chromium/files/patch-services_device_usb_usb__service__fake.cc new file mode 100644 index 000000000000..0ca04b12762e --- /dev/null +++ b/www/chromium/files/patch-services_device_usb_usb__service__fake.cc @@ -0,0 +1,54 @@ +--- services/device/usb/usb_service_fake.cc.orig 2022-10-29 13:32:26 UTC ++++ services/device/usb/usb_service_fake.cc +@@ -0,0 +1,51 @@ ++// Copyright 2014 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "services/device/usb/usb_service_fake.h" ++ ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include "base/barrier_closure.h" ++#include "base/bind.h" ++#include "base/callback_helpers.h" ++#include "base/containers/contains.h" ++#include "base/location.h" ++#include "base/memory/ref_counted_memory.h" ++#include "base/memory/weak_ptr.h" ++#include "base/strings/string_number_conversions.h" ++#include "base/strings/utf_string_conversions.h" ++#include "base/task/sequenced_task_runner.h" ++#include "base/task/single_thread_task_runner.h" ++#include "base/task/thread_pool.h" ++#include "base/threading/scoped_blocking_call.h" ++#include "build/build_config.h" ++#include "components/device_event_log/device_event_log.h" ++#include "services/device/usb/usb_device_handle.h" ++#include "services/device/usb/usb_error.h" ++#include "services/device/usb/webusb_descriptors.h" ++ ++namespace device { ++ ++UsbServiceImpl::UsbServiceImpl() ++ : task_runner_(base::SequencedTaskRunnerHandle::Get()) { ++ NOTIMPLEMENTED(); ++} ++ ++UsbServiceImpl::~UsbServiceImpl() { ++ NOTIMPLEMENTED(); ++ NotifyWillDestroyUsbService(); ++} ++ ++void UsbServiceImpl::GetDevices(GetDevicesCallback callback) { ++ NOTIMPLEMENTED(); ++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); ++ UsbService::GetDevices(std::move(callback)); ++} ++ ++} // namespace device diff --git a/www/chromium/files/patch-services_device_usb_usb__service__fake.h b/www/chromium/files/patch-services_device_usb_usb__service__fake.h new file mode 100644 index 000000000000..2e123db7f3be --- /dev/null +++ b/www/chromium/files/patch-services_device_usb_usb__service__fake.h @@ -0,0 +1,51 @@ +--- services/device/usb/usb_service_fake.h.orig 2022-10-29 13:32:26 UTC ++++ services/device/usb/usb_service_fake.h +@@ -0,0 +1,48 @@ ++// Copyright 2015 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef SERVICES_DEVICE_USB_USB_SERVICE_IMPL_H_ ++#define SERVICES_DEVICE_USB_USB_SERVICE_IMPL_H_ ++ ++#include "services/device/usb/usb_service.h" ++ ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include "base/containers/queue.h" ++#include "base/memory/weak_ptr.h" ++#include "build/build_config.h" ++#include "services/device/usb/usb_context.h" ++#include "services/device/usb/usb_device_impl.h" ++#include "third_party/abseil-cpp/absl/types/optional.h" ++ ++namespace device { ++ ++class UsbDeviceImpl; ++ ++class UsbServiceImpl final : public UsbService { ++ public: ++ UsbServiceImpl(); ++ ++ UsbServiceImpl(const UsbServiceImpl&) = delete; ++ UsbServiceImpl& operator=(const UsbServiceImpl&) = delete; ++ ++ ~UsbServiceImpl() override; ++ ++ private: ++ // device::UsbService implementation ++ void GetDevices(GetDevicesCallback callback) override; ++ ++ void OnUsbContext(scoped_refptr context); ++ ++ scoped_refptr task_runner_; ++}; ++ ++} // namespace device ++ ++#endif // SERVICES_DEVICE_USB_USB_SERVICE_IMPL_H_