- drop clang workaround for el8

- update to 113.0.5672.126
epel8
Than Ngo 2 years ago
parent 72b84c52e7
commit 5027d01233

@ -1,312 +0,0 @@
diff -up chromium-112.0.5615.49/base/clang_work_around.h.me chromium-112.0.5615.49/base/clang_work_around.h
--- chromium-112.0.5615.49/base/clang_work_around.h.me 2023-04-10 12:10:42.229455956 +0200
+++ chromium-112.0.5615.49/base/clang_work_around.h 2023-04-10 12:16:41.191744766 +0200
@@ -0,0 +1,10 @@
+//
+// workaound for clang-14 in c++20 mode
+//
+
+#ifndef WORKAROUND_CLANG14_IN_C_PLUS_PLUS_20_H
+#define WORKAROUND_CLANG14_IN_C_PLUS_PLUS_20_H
+
+static std::u16string clang_string_workaround(const char16_t* a, const char16_t* b) { return {a, b}; }
+
+#endif // WORKAROUND_CLANG14_IN_C_PLUS_PLUS_20_H
diff -up chromium-112.0.5615.49/base/i18n/number_formatting.cc.me chromium-112.0.5615.49/base/i18n/number_formatting.cc
--- chromium-112.0.5615.49/base/i18n/number_formatting.cc.me 2023-04-10 11:26:58.126271434 +0200
+++ chromium-112.0.5615.49/base/i18n/number_formatting.cc 2023-04-10 12:13:17.573209444 +0200
@@ -18,6 +18,7 @@
#include "base/strings/utf_string_conversions.h"
#include "third_party/icu/source/common/unicode/ustring.h"
#include "third_party/icu/source/i18n/unicode/numfmt.h"
+#include "base/clang_work_around.h"
namespace base {
diff -up chromium-112.0.5615.49/base/i18n/time_formatting.cc.me chromium-112.0.5615.49/base/i18n/time_formatting.cc
--- chromium-112.0.5615.49/base/i18n/time_formatting.cc.me 2023-04-10 10:21:25.360079525 +0200
+++ chromium-112.0.5615.49/base/i18n/time_formatting.cc 2023-04-10 12:13:36.373485371 +0200
@@ -22,6 +22,7 @@
#include "third_party/icu/source/i18n/unicode/fmtable.h"
#include "third_party/icu/source/i18n/unicode/measfmt.h"
#include "third_party/icu/source/i18n/unicode/smpdtfmt.h"
+#include "base/clang_work_around.h"
namespace base {
namespace {
diff -up chromium-112.0.5615.49/base/strings/string_piece.cc.me chromium-112.0.5615.49/base/strings/string_piece.cc
--- chromium-112.0.5615.49/base/strings/string_piece.cc.me 2023-04-10 10:20:40.230277808 +0200
+++ chromium-112.0.5615.49/base/strings/string_piece.cc 2023-04-10 12:14:00.262863956 +0200
@@ -12,6 +12,7 @@
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
+#include "base/clang_work_around.h"
namespace base {
namespace {
diff -up chromium-112.0.5615.49/components/url_formatter/spoof_checks/skeleton_generator.cc.me chromium-112.0.5615.49/components/url_formatter/spoof_checks/skeleton_generator.cc
--- chromium-112.0.5615.49/components/url_formatter/spoof_checks/skeleton_generator.cc.me 2023-04-10 11:27:36.207948830 +0200
+++ chromium-112.0.5615.49/components/url_formatter/spoof_checks/skeleton_generator.cc 2023-04-10 12:17:36.338730147 +0200
@@ -15,6 +15,7 @@
#include "third_party/icu/source/i18n/unicode/regex.h"
#include "third_party/icu/source/i18n/unicode/translit.h"
#include "third_party/icu/source/i18n/unicode/uspoof.h"
+#include "base/clang_work_around.h"
namespace {
diff -up chromium-112.0.5615.49/content/child/browser_font_resource_trusted.cc.me chromium-112.0.5615.49/content/child/browser_font_resource_trusted.cc
--- chromium-112.0.5615.49/content/child/browser_font_resource_trusted.cc.me 2023-04-10 11:28:09.962549271 +0200
+++ chromium-112.0.5615.49/content/child/browser_font_resource_trusted.cc 2023-04-10 12:12:14.242145968 +0200
@@ -26,6 +26,7 @@
#include "third_party/skia/include/core/SkRect.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/ubidi_deleter.h"
+#include "base/clang_work_around.h"
using ppapi::StringVar;
using ppapi::thunk::EnterResourceNoLock;
diff -up chromium-112.0.5615.49/content/common/zygote/zygote_communication_linux.cc.me chromium-112.0.5615.49/content/common/zygote/zygote_communication_linux.cc
--- chromium-112.0.5615.49/content/common/zygote/zygote_communication_linux.cc.me 2023-04-10 10:19:32.223069670 +0200
+++ chromium-112.0.5615.49/content/common/zygote/zygote_communication_linux.cc 2023-04-10 12:12:31.315438868 +0200
@@ -22,6 +22,7 @@
#include "content/public/common/result_codes.h"
#include "sandbox/policy/switches.h"
#include "third_party/icu/source/i18n/unicode/timezone.h"
+#include "base/clang_work_around.h"
namespace content {
diff -up chromium-112.0.5615.49/mojo/public/cpp/base/string16_mojom_traits.cc.me chromium-112.0.5615.49/mojo/public/cpp/base/string16_mojom_traits.cc
--- chromium-112.0.5615.49/mojo/public/cpp/base/string16_mojom_traits.cc.me 2023-04-10 11:26:20.277598168 +0200
+++ chromium-112.0.5615.49/mojo/public/cpp/base/string16_mojom_traits.cc 2023-04-10 12:12:56.706874472 +0200
@@ -6,6 +6,8 @@
#include "mojo/public/cpp/base/big_buffer_mojom_traits.h"
+#include "base/clang_work_around.h"
+
namespace mojo {
// static
diff -up chromium-112.0.5615.49/third_party/blink/common/page_state/page_state_serialization.cc.me chromium-112.0.5615.49/third_party/blink/common/page_state/page_state_serialization.cc
--- chromium-112.0.5615.49/third_party/blink/common/page_state/page_state_serialization.cc.me 2023-04-10 11:22:27.525457904 +0200
+++ chromium-112.0.5615.49/third_party/blink/common/page_state/page_state_serialization.cc 2023-04-10 12:14:21.584248718 +0200
@@ -24,6 +24,7 @@
#include "ui/display/screen.h"
#include "ui/gfx/geometry/mojom/geometry_mojom_traits.h"
#include "url/mojom/url_gurl_mojom_traits.h"
+#include "base/clang_work_around.h"
namespace blink {
diff -up chromium-112.0.5615.49/base/strings/escape.cc.me chromium-112.0.5615.49/base/strings/escape.cc
--- chromium-112.0.5615.49/base/strings/escape.cc.me 2023-04-10 16:10:08.298906995 +0200
+++ chromium-112.0.5615.49/base/strings/escape.cc 2023-04-10 16:10:17.751072552 +0200
@@ -14,6 +14,7 @@
#include "base/strings/utf_string_conversion_utils.h"
#include "base/strings/utf_string_conversions.h"
#include "base/third_party/icu/icu_utf.h"
+#include "base/clang_work_around.h"
namespace base {
diff -up chromium-112.0.5615.49/base/strings/string_split.cc.me chromium-112.0.5615.49/base/strings/string_split.cc
--- chromium-112.0.5615.49/base/strings/string_split.cc.me 2023-04-10 16:17:49.702245206 +0200
+++ chromium-112.0.5615.49/base/strings/string_split.cc 2023-04-10 16:17:56.420471079 +0200
@@ -10,6 +10,7 @@
#include "base/strings/string_split_internal.h"
#include "base/strings/string_util.h"
#include "base/third_party/icu/icu_utf.h"
+#include "base/clang_work_around.h"
namespace base {
diff -up chromium-112.0.5615.49/chrome/browser/sharing/click_to_call/click_to_call_utils.cc.me chromium-112.0.5615.49/chrome/browser/sharing/click_to_call/click_to_call_utils.cc
--- chromium-112.0.5615.49/chrome/browser/sharing/click_to_call/click_to_call_utils.cc.me 2023-04-10 16:09:21.861093623 +0200
+++ chromium-112.0.5615.49/chrome/browser/sharing/click_to_call/click_to_call_utils.cc 2023-04-10 16:09:31.428261186 +0200
@@ -21,6 +21,7 @@
#include "third_party/re2/src/re2/re2.h"
#include "url/url_constants.h"
#include "url/url_util.h"
+#include "base/clang_work_around.h"
namespace {
diff -up chromium-112.0.5615.49/ui/ozone/platform/wayland/host/wayland_exchange_data_provider.cc.me chromium-112.0.5615.49/ui/ozone/platform/wayland/host/wayland_exchange_data_provider.cc
--- chromium-112.0.5615.49/ui/ozone/platform/wayland/host/wayland_exchange_data_provider.cc.me 2023-04-10 16:05:55.155357863 +0200
+++ chromium-112.0.5615.49/ui/ozone/platform/wayland/host/wayland_exchange_data_provider.cc 2023-04-10 16:06:09.726629617 +0200
@@ -27,6 +27,7 @@
#include "url/gurl.h"
#include "url/url_canon.h"
#include "url/url_util.h"
+#include "base/clang_work_around.h"
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "ui/base/data_transfer_policy/data_transfer_endpoint_serializer.h"
diff -up chromium-112.0.5615.49/base/i18n/break_iterator.cc.me chromium-112.0.5615.49/base/i18n/break_iterator.cc
--- chromium-112.0.5615.49/base/i18n/break_iterator.cc.me 2023-04-11 09:19:54.124933361 +0200
+++ chromium-112.0.5615.49/base/i18n/break_iterator.cc 2023-04-11 09:20:14.790301819 +0200
@@ -15,6 +15,7 @@
#include "third_party/icu/source/common/unicode/ubrk.h"
#include "third_party/icu/source/common/unicode/uchar.h"
#include "third_party/icu/source/common/unicode/ustring.h"
+#include "base/clang_work_around.h"
namespace base {
namespace i18n {
diff -up chromium-112.0.5615.49/base/i18n/message_formatter.cc.me chromium-112.0.5615.49/base/i18n/message_formatter.cc
--- chromium-112.0.5615.49/base/i18n/message_formatter.cc.me 2023-04-11 09:20:34.687657454 +0200
+++ chromium-112.0.5615.49/base/i18n/message_formatter.cc 2023-04-11 09:21:28.617663963 +0200
@@ -13,6 +13,7 @@
#include "third_party/icu/source/common/unicode/utypes.h"
#include "third_party/icu/source/i18n/unicode/fmtable.h"
#include "third_party/icu/source/i18n/unicode/msgfmt.h"
+#include "base/clang_work_around.h"
using icu::UnicodeString;
diff -up chromium-112.0.5615.49/base/time/time.cc.me chromium-112.0.5615.49/base/time/time.cc
--- chromium-112.0.5615.49/base/time/time.cc.me 2023-04-11 09:23:22.732757775 +0200
+++ chromium-112.0.5615.49/base/time/time.cc 2023-04-11 09:23:33.655958193 +0200
@@ -17,6 +17,7 @@
#include "base/time/time_override.h"
#include "build/build_config.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "base/clang_work_around.h"
namespace base {
diff -up chromium-112.0.5615.49/chrome/browser/ui/webui/downloads/downloads_list_tracker.cc.me chromium-112.0.5615.49/chrome/browser/ui/webui/downloads/downloads_list_tracker.cc
--- chromium-112.0.5615.49/chrome/browser/ui/webui/downloads/downloads_list_tracker.cc.me 2023-04-11 09:36:50.646409434 +0200
+++ chromium-112.0.5615.49/chrome/browser/ui/webui/downloads/downloads_list_tracker.cc 2023-04-11 09:37:07.977731153 +0200
@@ -36,6 +36,7 @@
#include "net/base/filename_util.h"
#include "third_party/icu/source/i18n/unicode/datefmt.h"
#include "ui/base/l10n/time_format.h"
+#include "base/clang_work_around.h"
using content::BrowserContext;
using content::DownloadManager;
diff -up chromium-112.0.5615.49/chrome/browser/ui/webui/new_tab_page/untrusted_source.cc.me chromium-112.0.5615.49/chrome/browser/ui/webui/new_tab_page/untrusted_source.cc
--- chromium-112.0.5615.49/chrome/browser/ui/webui/new_tab_page/untrusted_source.cc.me 2023-04-11 09:37:21.262977759 +0200
+++ chromium-112.0.5615.49/chrome/browser/ui/webui/new_tab_page/untrusted_source.cc 2023-04-11 09:37:27.594095277 +0200
@@ -33,6 +33,7 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/template_expressions.h"
#include "url/url_util.h"
+#include "base/clang_work_around.h"
namespace {
diff -up chromium-112.0.5615.49/components/autofill/content/renderer/html_based_username_detector.cc.me chromium-112.0.5615.49/components/autofill/content/renderer/html_based_username_detector.cc
--- chromium-112.0.5615.49/components/autofill/content/renderer/html_based_username_detector.cc.me 2023-04-11 09:38:01.297776504 +0200
+++ chromium-112.0.5615.49/components/autofill/content/renderer/html_based_username_detector.cc 2023-04-11 09:38:07.899908357 +0200
@@ -18,6 +18,7 @@
#include "components/autofill/content/renderer/html_based_username_detector_vocabulary.h"
#include "components/autofill/core/common/form_data.h"
#include "third_party/blink/public/web/web_form_element.h"
+#include "base/clang_work_around.h"
using blink::WebFormControlElement;
using blink::WebFormElement;
diff -up chromium-112.0.5615.49/components/autofill/core/browser/autofill_data_util.cc.me chromium-112.0.5615.49/components/autofill/core/browser/autofill_data_util.cc
--- chromium-112.0.5615.49/components/autofill/core/browser/autofill_data_util.cc.me 2023-04-11 09:33:59.637234801 +0200
+++ chromium-112.0.5615.49/components/autofill/core/browser/autofill_data_util.cc 2023-04-11 09:34:08.353412198 +0200
@@ -25,6 +25,7 @@
#include "components/strings/grit/components_strings.h"
#include "third_party/icu/source/common/unicode/uscript.h"
#include "third_party/re2/src/re2/re2.h"
+#include "base/clang_work_around.h"
namespace autofill {
namespace data_util {
diff -up chromium-112.0.5615.49/components/autofill/core/browser/data_model/borrowed_transliterator.cc.me chromium-112.0.5615.49/components/autofill/core/browser/data_model/borrowed_transliterator.cc
--- chromium-112.0.5615.49/components/autofill/core/browser/data_model/borrowed_transliterator.cc.me 2023-04-11 09:33:33.683706577 +0200
+++ chromium-112.0.5615.49/components/autofill/core/browser/data_model/borrowed_transliterator.cc 2023-04-11 09:33:40.115837491 +0200
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/no_destructor.h"
+#include "base/clang_work_around.h"
namespace autofill {
diff -up chromium-112.0.5615.49/components/autofill/core/browser/form_processing/label_processing_util.cc.me chromium-112.0.5615.49/components/autofill/core/browser/form_processing/label_processing_util.cc
--- chromium-112.0.5615.49/components/autofill/core/browser/form_processing/label_processing_util.cc.me 2023-04-11 09:35:15.569558729 +0200
+++ chromium-112.0.5615.49/components/autofill/core/browser/form_processing/label_processing_util.cc 2023-04-11 09:35:22.156704236 +0200
@@ -7,6 +7,7 @@
#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/clang_work_around.h"
namespace autofill {
diff -up chromium-112.0.5615.49/components/autofill/core/common/autofill_regexes.cc.me chromium-112.0.5615.49/components/autofill/core/common/autofill_regexes.cc
--- chromium-112.0.5615.49/components/autofill/core/common/autofill_regexes.cc.me 2023-04-11 09:24:03.442503498 +0200
+++ chromium-112.0.5615.49/components/autofill/core/common/autofill_regexes.cc 2023-04-11 09:24:10.633634865 +0200
@@ -12,6 +12,7 @@
#include "base/check.h"
#include "base/i18n/unicodestring.h"
#include "base/memory/ptr_util.h"
+#include "base/clang_work_around.h"
namespace {
diff -up chromium-112.0.5615.49/components/bookmarks/browser/titled_url_index.cc.me chromium-112.0.5615.49/components/bookmarks/browser/titled_url_index.cc
--- chromium-112.0.5615.49/components/bookmarks/browser/titled_url_index.cc.me 2023-04-11 09:35:47.419224388 +0200
+++ chromium-112.0.5615.49/components/bookmarks/browser/titled_url_index.cc 2023-04-11 09:35:53.917341490 +0200
@@ -29,6 +29,7 @@
#include "components/query_parser/snippet.h"
#include "third_party/icu/source/common/unicode/normalizer2.h"
#include "third_party/icu/source/common/unicode/utypes.h"
+#include "base/clang_work_around.h"
namespace bookmarks {
diff -up chromium-112.0.5615.49/components/omnibox/browser/tailored_word_break_iterator.cc.me chromium-112.0.5615.49/components/omnibox/browser/tailored_word_break_iterator.cc
--- chromium-112.0.5615.49/components/omnibox/browser/tailored_word_break_iterator.cc.me 2023-04-11 09:36:26.323925501 +0200
+++ chromium-112.0.5615.49/components/omnibox/browser/tailored_word_break_iterator.cc 2023-04-11 09:36:32.480043078 +0200
@@ -5,6 +5,7 @@
#include "components/omnibox/browser/tailored_word_break_iterator.h"
#include "base/strings/string_piece.h"
+#include "base/clang_work_around.h"
namespace {
constexpr char16_t kUnderscore = '_';
diff -up chromium-112.0.5615.49/components/sync/base/time.cc.me chromium-112.0.5615.49/components/sync/base/time.cc
--- chromium-112.0.5615.49/components/sync/base/time.cc.me 2023-04-11 09:32:48.709645320 +0200
+++ chromium-112.0.5615.49/components/sync/base/time.cc 2023-04-11 09:32:56.044820918 +0200
@@ -11,6 +11,7 @@
#include "base/strings/utf_string_conversions.h"
#include "third_party/icu/source/common/unicode/utypes.h"
#include "third_party/icu/source/i18n/unicode/smpdtfmt.h"
+#include "base/clang_work_around.h"
namespace syncer {
diff -up chromium-112.0.5615.49/ui/base/x/selection_utils.cc.me chromium-112.0.5615.49/ui/base/x/selection_utils.cc
--- chromium-112.0.5615.49/ui/base/x/selection_utils.cc.me 2023-04-11 09:22:42.734023876 +0200
+++ chromium-112.0.5615.49/ui/base/x/selection_utils.cc 2023-04-11 09:22:51.565185914 +0200
@@ -18,6 +18,7 @@
#include "base/strings/utf_string_conversions.h"
#include "ui/base/clipboard/clipboard_constants.h"
#include "ui/gfx/x/x11_atom_cache.h"
+#include "base/clang_work_around.h"
namespace ui {
diff -up chromium-112.0.5615.49/chrome/test/chromedriver/server/http_handler.cc.me chromium-112.0.5615.49/chrome/test/chromedriver/server/http_handler.cc
--- chromium-112.0.5615.49/chrome/test/chromedriver/server/http_handler.cc.me 2023-04-11 09:43:01.795293420 +0200
+++ chromium-112.0.5615.49/chrome/test/chromedriver/server/http_handler.cc 2023-04-11 09:43:13.763545992 +0200
@@ -46,6 +46,7 @@
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "services/network/transitional_url_loader_factory_owner.h"
#include "url/url_util.h"
+#include "base/clang_work_around.h"
#if BUILDFLAG(IS_MAC)
#include "base/mac/scoped_nsautorelease_pool.h"

@ -1,277 +1,62 @@
diff --git a/components/version_info/version_info.cc b/components/version_info/version_info.cc diff -up chromium-114.0.5735.26/components/version_info/version_info.cc.constexpr-el7 chromium-114.0.5735.26/components/version_info/version_info.cc
index c5b6a9ea17be1..9b1f5e4478f53 100644 diff -up chromium-114.0.5735.26/components/version_info/version_info.h.constexpr-el7 chromium-114.0.5735.26/components/version_info/version_info.h
--- a/components/version_info/version_info.cc --- chromium-114.0.5735.26/components/version_info/version_info.h.constexpr-el7 2023-05-11 03:36:19.000000000 +0200
+++ b/components/version_info/version_info.cc +++ chromium-114.0.5735.26/components/version_info/version_info.h 2023-05-14 10:59:19.921578645 +0200
@@ -4,26 +4,15 @@ @@ -27,18 +27,18 @@ const std::string GetProductNameAndVersi
#include "components/version_info/version_info.h"
-#include "base/check.h"
+#include <string>
+
#include "base/no_destructor.h"
-#include "base/notreached.h"
-#include "base/sanitizer_buildflags.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/version.h"
-#include "build/branding_buildflags.h"
-#include "build/build_config.h"
-#include "build/chromeos_buildflags.h"
-#include "components/version_info/version_info_values.h"
namespace version_info {
-const std::string& GetProductNameAndVersionForUserAgent() {
- static const base::NoDestructor<std::string> product_and_version(
- "Chrome/" + GetVersionNumber());
- return *product_and_version;
-}
-
const std::string GetProductNameAndVersionForReducedUserAgent(
const std::string& build_version) {
std::string product_and_version;
@@ -32,14 +21,6 @@ const std::string GetProductNameAndVersionForReducedUserAgent(
return product_and_version;
}
-std::string GetProductName() {
- return PRODUCT_NAME;
-}
-
-std::string GetVersionNumber() {
- return PRODUCT_VERSION;
-}
-
int GetMajorVersionNumberAsInt() {
DCHECK(GetVersion().IsValid());
return GetVersion().components()[0];
@@ -54,82 +35,4 @@ const base::Version& GetVersion() {
return *version;
}
-std::string GetLastChange() {
- return LAST_CHANGE;
-}
-
-bool IsOfficialBuild() {
- return IS_OFFICIAL_BUILD;
-}
-
-std::string GetOSType() {
-#if BUILDFLAG(IS_WIN)
- return "Windows";
-#elif BUILDFLAG(IS_IOS)
- return "iOS";
-#elif BUILDFLAG(IS_MAC)
- return "Mac OS X";
-#elif BUILDFLAG(IS_CHROMEOS)
-# if BUILDFLAG(GOOGLE_CHROME_BRANDING)
- return "ChromeOS";
-# else
- return "ChromiumOS";
-# endif
-#elif BUILDFLAG(IS_ANDROID)
- return "Android";
-#elif BUILDFLAG(IS_LINUX)
- return "Linux";
-#elif BUILDFLAG(IS_FREEBSD)
- return "FreeBSD";
-#elif BUILDFLAG(IS_OPENBSD)
- return "OpenBSD";
-#elif BUILDFLAG(IS_SOLARIS)
- return "Solaris";
-#elif BUILDFLAG(IS_FUCHSIA)
- return "Fuchsia";
-#else
- return "Unknown";
-#endif
-}
-
-std::string GetChannelString(Channel channel) {
- switch (channel) {
- case Channel::STABLE:
- return "stable";
- case Channel::BETA:
- return "beta";
- case Channel::DEV:
- return "dev";
- case Channel::CANARY:
- return "canary";
- case Channel::UNKNOWN:
- return "unknown";
- }
- NOTREACHED();
- return std::string();
-}
-
-std::string GetSanitizerList() {
- std::string sanitizers;
-#if defined(ADDRESS_SANITIZER)
- sanitizers += "address ";
-#endif
-#if BUILDFLAG(IS_HWASAN)
- sanitizers += "hwaddress ";
-#endif
-#if defined(LEAK_SANITIZER)
- sanitizers += "leak ";
-#endif
-#if defined(MEMORY_SANITIZER)
- sanitizers += "memory ";
-#endif
-#if defined(THREAD_SANITIZER)
- sanitizers += "thread ";
-#endif
-#if defined(UNDEFINED_SANITIZER)
- sanitizers += "undefined ";
-#endif
- return sanitizers;
-}
-
} // namespace version_info
diff --git a/components/version_info/version_info.h b/components/version_info/version_info.h
index cab516659a9e4..ffa554eed7598 100644
--- a/components/version_info/version_info.h
+++ b/components/version_info/version_info.h
@@ -7,7 +7,12 @@
#include <string>
+#include "base/notreached.h"
+#include "base/sanitizer_buildflags.h"
+#include "build/branding_buildflags.h"
+#include "build/build_config.h"
#include "components/version_info/channel.h"
+#include "components/version_info/version_info_values.h"
namespace base {
class Version;
@@ -15,10 +20,6 @@ class Version;
namespace version_info {
-// Returns the product name and version information for the User-Agent header,
-// in the format: Chrome/<major_version>.<minor_version>.<build>.<patch>.
-const std::string& GetProductNameAndVersionForUserAgent();
-
// Returns the product name and reduced version information for the User-Agent
// header, in the format: Chrome/<major_version>.0.build_version.0, where
// `build_version` is a frozen BUILD number.
@@ -26,10 +27,20 @@ const std::string GetProductNameAndVersionForReducedUserAgent(
const std::string& build_version); const std::string& build_version);
// Returns the product name, e.g. "Chromium" or "Google Chrome". // Returns the product name, e.g. "Chromium" or "Google Chrome".
-std::string GetProductName(); -constexpr std::string GetProductName() {
+constexpr std::string GetProductName() { +static const std::string GetProductName() {
+ return PRODUCT_NAME; return PRODUCT_NAME;
+} }
// Returns the version number, e.g. "6.0.490.1". // Returns the version number, e.g. "6.0.490.1".
-std::string GetVersionNumber(); -constexpr std::string GetVersionNumber() {
+constexpr std::string GetVersionNumber() { +static const std::string GetVersionNumber() {
+ return PRODUCT_VERSION; return PRODUCT_VERSION;
+} }
+
+// Returns the product name and version information for the User-Agent header, // Returns the product name and version information for the User-Agent header,
+// in the format: Chrome/<major_version>.<minor_version>.<build>.<patch>. // in the format: Chrome/<major_version>.<minor_version>.<build>.<patch>.
+constexpr std::string GetProductNameAndVersionForUserAgent() { -constexpr std::string GetProductNameAndVersionForUserAgent() {
+ return "Chrome/" + GetVersionNumber(); +static const std::string GetProductNameAndVersionForUserAgent() {
+} return "Chrome/" + GetVersionNumber();
}
// Returns the major component (aka the milestone) of the version as an int, @@ -53,7 +53,7 @@ std::string GetMajorVersionNumber();
// e.g. 6 when the version is "6.0.490.1".
@@ -42,22 +53,89 @@ std::string GetMajorVersionNumber();
const base::Version& GetVersion(); const base::Version& GetVersion();
// Returns a version control specific identifier of this release. // Returns a version control specific identifier of this release.
-std::string GetLastChange(); -constexpr std::string GetLastChange() {
+constexpr std::string GetLastChange() { +static const std::string GetLastChange() {
+ return LAST_CHANGE; return LAST_CHANGE;
+} }
// Returns whether this is an "official" release of the current version, i.e. @@ -65,7 +65,7 @@ constexpr bool IsOfficialBuild() {
// whether knowing GetVersionNumber() is enough to completely determine what }
// GetLastChange() is.
-bool IsOfficialBuild();
+constexpr bool IsOfficialBuild() {
+ return IS_OFFICIAL_BUILD;
+}
// Returns the OS type, e.g. "Windows", "Linux", "FreeBSD", ... // Returns the OS type, e.g. "Windows", "Linux", "FreeBSD", ...
-std::string GetOSType(); -constexpr std::string GetOSType() {
+constexpr std::string GetOSType() { +static const std::string GetOSType() {
+#if BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN)
+ return "Windows"; return "Windows";
+#elif BUILDFLAG(IS_IOS) #elif BUILDFLAG(IS_IOS)
+ return "iOS"; @@ -97,7 +97,7 @@ constexpr std::string GetOSType() {
+#elif BUILDFLAG(IS_MAC)
+ return "Mac OS X";
+#elif BUILDFLAG(IS_CHROMEOS)
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+ return "ChromeOS";
+#else
+ return "ChromiumOS";
+#endif
+#elif BUILDFLAG(IS_ANDROID)
+ return "Android";
+#elif BUILDFLAG(IS_LINUX)
+ return "Linux";
+#elif BUILDFLAG(IS_FREEBSD)
+ return "FreeBSD";
+#elif BUILDFLAG(IS_OPENBSD)
+ return "OpenBSD";
+#elif BUILDFLAG(IS_SOLARIS)
+ return "Solaris";
+#elif BUILDFLAG(IS_FUCHSIA)
+ return "Fuchsia";
+#else
+ return "Unknown";
+#endif
+}
// Returns a string equivalent of |channel|, independent of whether the build // Returns a string equivalent of |channel|, independent of whether the build
// is branded or not and without any additional modifiers. // is branded or not and without any additional modifiers.
-std::string GetChannelString(Channel channel); -constexpr std::string GetChannelString(Channel channel) {
+constexpr std::string GetChannelString(Channel channel) { +static const std::string GetChannelString(Channel channel) {
+ switch (channel) { switch (channel) {
+ case Channel::STABLE: case Channel::STABLE:
+ return "stable"; return "stable";
+ case Channel::BETA: @@ -114,7 +114,7 @@ constexpr std::string GetChannelString(C
+ return "beta"; }
+ case Channel::DEV:
+ return "dev";
+ case Channel::CANARY:
+ return "canary";
+ case Channel::UNKNOWN:
+ return "unknown";
+ }
+ NOTREACHED_NORETURN();
+}
// Returns a list of sanitizers enabled in this build. // Returns a list of sanitizers enabled in this build.
-std::string GetSanitizerList(); -constexpr std::string GetSanitizerList() {
+constexpr std::string GetSanitizerList() { +static const std::string GetSanitizerList() {
+ return "" return ""
+#if defined(ADDRESS_SANITIZER) #if defined(ADDRESS_SANITIZER)
+ "address " "address "
+#endif
+#if BUILDFLAG(IS_HWASAN)
+ "hwaddress "
+#endif
+#if defined(LEAK_SANITIZER)
+ "leak "
+#endif
+#if defined(MEMORY_SANITIZER)
+ "memory "
+#endif
+#if defined(THREAD_SANITIZER)
+ "thread "
+#endif
+#if defined(UNDEFINED_SANITIZER)
+ "undefined "
+#endif
+ ;
+}
} // namespace version_info

@ -1,540 +0,0 @@
commit 74e41428503d16ff365bbfa93ca23332ce04215a
Author: Ilya Nikolaevskiy <ilnik@chromium.org>
Date: Wed Apr 5 16:16:22 2023 +0000
Revert "V4L2: media/capture: Use VIDIOC_S_EXT_CTRLS API correctly"
This reverts commit 4301563bdea1766779b5e032d2eb2ff19959fce3.
Reason for revert: Breaks test bot: crbug.com/1430699
Original change's description:
> V4L2: media/capture: Use VIDIOC_S_EXT_CTRLS API correctly
>
> This CL:
> - Uses the `which` struct v4l2_ext_controls field instead of
> the deprecated `ctrl_class` alias field.
> - Prefers the new style value of `V4L2_CTRL_WHICH_CUR_VAL` for that
> field instead of the old style value of the control class ID as long
> as the device supports the new style (detected on run-time).
> - Sets special controls only if they are supported. Trying to set
> an unsupported special control as part of a VIDIOC_S_EXT_CTRLS call
> causes the whole VIDIOC_S_EXT_CTRLS call to fail.
> - Fixes control iteration not to skip over the brightness control.
> - Skips permanently disabled and read-only controls.
> - Enables the corresponding test case.
>
> This fixes VIDIOC_S_EXT_CTRLS to work on new device drivers, too.
>
> API: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/vidioc-g-ext-ctrls.html#c.V4L.v4l2_ext_controls
>
> Bug: 1421739, 732355
> Change-Id: I13593bb647fe664d70a3d8ed8d2789f77397aa40
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4324021
> Commit-Queue: Eero Hakkinen <eero.hakkinen@intel.com>
> Reviewed-by: Tomas Gunnarsson <tommi@chromium.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1116416}
Bug: 1421739, 732355
Change-Id: I291b80009550f0c890b5203060d9283a4074af97
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4401592
Commit-Queue: Tomas Gunnarsson <tommi@chromium.org>
Auto-Submit: Ilya Nikolaevskiy <ilnik@chromium.org>
Reviewed-by: Tomas Gunnarsson <tommi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1126615}
diff --git a/media/capture/video/linux/v4l2_capture_delegate.cc b/media/capture/video/linux/v4l2_capture_delegate.cc
index 7efa2b1c2252c..864111f5c255e 100644
--- a/media/capture/video/linux/v4l2_capture_delegate.cc
+++ b/media/capture/video/linux/v4l2_capture_delegate.cc
@@ -138,6 +138,47 @@ int GetControllingSpecialControl(int control_id) {
return 0;
}
+// Determines if |control_id| is special, i.e. controls another one's state.
+bool IsSpecialControl(int control_id) {
+ switch (control_id) {
+ case V4L2_CID_AUTO_WHITE_BALANCE:
+ case V4L2_CID_EXPOSURE_AUTO:
+ case V4L2_CID_EXPOSURE_AUTO_PRIORITY:
+ case V4L2_CID_FOCUS_AUTO:
+ return true;
+ }
+ return false;
+}
+
+// Determines if |control_id| should be skipped, https://crbug.com/697885.
+#if !defined(V4L2_CID_PAN_SPEED)
+#define V4L2_CID_PAN_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 32)
+#endif
+#if !defined(V4L2_CID_TILT_SPEED)
+#define V4L2_CID_TILT_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 33)
+#endif
+#if !defined(V4L2_CID_PANTILT_CMD)
+#define V4L2_CID_PANTILT_CMD (V4L2_CID_CAMERA_CLASS_BASE + 34)
+#endif
+bool IsBlockedControl(int control_id) {
+ switch (control_id) {
+ case V4L2_CID_PAN_RELATIVE:
+ case V4L2_CID_TILT_RELATIVE:
+ case V4L2_CID_PAN_RESET:
+ case V4L2_CID_TILT_RESET:
+ case V4L2_CID_PAN_ABSOLUTE:
+ case V4L2_CID_TILT_ABSOLUTE:
+ case V4L2_CID_ZOOM_ABSOLUTE:
+ case V4L2_CID_ZOOM_RELATIVE:
+ case V4L2_CID_ZOOM_CONTINUOUS:
+ case V4L2_CID_PAN_SPEED:
+ case V4L2_CID_TILT_SPEED:
+ case V4L2_CID_PANTILT_CMD:
+ return true;
+ }
+ return false;
+}
+
bool IsNonEmptyRange(const mojom::RangePtr& range) {
return range->min < range->max;
}
@@ -211,49 +252,6 @@ std::vector<uint32_t> V4L2CaptureDelegate::GetListOfUsableFourCcs(
return supported_formats;
}
-// Determines if |control_id| is special, i.e. controls another one's state.
-// static
-bool V4L2CaptureDelegate::IsSpecialControl(int control_id) {
- switch (control_id) {
- case V4L2_CID_AUTO_WHITE_BALANCE:
- case V4L2_CID_EXPOSURE_AUTO:
- case V4L2_CID_EXPOSURE_AUTO_PRIORITY:
- case V4L2_CID_FOCUS_AUTO:
- return true;
- }
- return false;
-}
-
-// Determines if |control_id| should be skipped, https://crbug.com/697885.
-#if !defined(V4L2_CID_PAN_SPEED)
-#define V4L2_CID_PAN_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 32)
-#endif
-#if !defined(V4L2_CID_TILT_SPEED)
-#define V4L2_CID_TILT_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 33)
-#endif
-#if !defined(V4L2_CID_PANTILT_CMD)
-#define V4L2_CID_PANTILT_CMD (V4L2_CID_CAMERA_CLASS_BASE + 34)
-#endif
-// static
-bool V4L2CaptureDelegate::IsBlockedControl(int control_id) {
- switch (control_id) {
- case V4L2_CID_PAN_RELATIVE:
- case V4L2_CID_TILT_RELATIVE:
- case V4L2_CID_PAN_RESET:
- case V4L2_CID_TILT_RESET:
- case V4L2_CID_PAN_ABSOLUTE:
- case V4L2_CID_TILT_ABSOLUTE:
- case V4L2_CID_ZOOM_ABSOLUTE:
- case V4L2_CID_ZOOM_RELATIVE:
- case V4L2_CID_ZOOM_CONTINUOUS:
- case V4L2_CID_PAN_SPEED:
- case V4L2_CID_TILT_SPEED:
- case V4L2_CID_PANTILT_CMD:
- return true;
- }
- return false;
-}
-
V4L2CaptureDelegate::V4L2CaptureDelegate(
V4L2CaptureDevice* v4l2,
const VideoCaptureDeviceDescriptor& device_descriptor,
@@ -830,89 +828,100 @@ mojom::RangePtr V4L2CaptureDelegate::RetrieveUserControlRange(int control_id) {
}
void V4L2CaptureDelegate::ResetUserAndCameraControlsToDefault() {
+ // Set V4L2_CID_AUTO_WHITE_BALANCE to false first.
+ v4l2_control auto_white_balance = {};
+ auto_white_balance.id = V4L2_CID_AUTO_WHITE_BALANCE;
+ auto_white_balance.value = false;
+ if (!RunIoctl(VIDIOC_S_CTRL, &auto_white_balance))
+ return;
+
+ std::vector<struct v4l2_ext_control> special_camera_controls;
+ // Set V4L2_CID_EXPOSURE_AUTO to V4L2_EXPOSURE_MANUAL.
+ v4l2_ext_control auto_exposure = {};
+ auto_exposure.id = V4L2_CID_EXPOSURE_AUTO;
+ auto_exposure.value = V4L2_EXPOSURE_MANUAL;
+ special_camera_controls.push_back(auto_exposure);
+ // Set V4L2_CID_EXPOSURE_AUTO_PRIORITY to false.
+ v4l2_ext_control priority_auto_exposure = {};
+ priority_auto_exposure.id = V4L2_CID_EXPOSURE_AUTO_PRIORITY;
+ priority_auto_exposure.value = false;
+ special_camera_controls.push_back(priority_auto_exposure);
+ // Set V4L2_CID_FOCUS_AUTO to false.
+ v4l2_ext_control auto_focus = {};
+ auto_focus.id = V4L2_CID_FOCUS_AUTO;
+ auto_focus.value = false;
+ special_camera_controls.push_back(auto_focus);
+
struct v4l2_ext_controls ext_controls = {};
- ext_controls.which = V4L2_CTRL_WHICH_CUR_VAL;
- ext_controls.count = 0;
- const bool use_modern_s_ext_ctrls =
- DoIoctl(VIDIOC_S_EXT_CTRLS, &ext_controls) == 0;
+ ext_controls.ctrl_class = V4L2_CID_CAMERA_CLASS;
+ ext_controls.count = special_camera_controls.size();
+ ext_controls.controls = special_camera_controls.data();
+ if (DoIoctl(VIDIOC_S_EXT_CTRLS, &ext_controls) < 0)
+ DPLOG(INFO) << "VIDIOC_S_EXT_CTRLS";
for (const auto& control : kControls) {
std::vector<struct v4l2_ext_control> camera_controls;
- std::vector<struct v4l2_ext_control> manual_special_camera_controls;
- std::vector<struct v4l2_ext_control> special_camera_controls;
v4l2_queryctrl range = {};
- // Start right below the base so that the first next retrieved control ID
- // is always the first available control ID within the class even if that
- // control ID is equal to the base (V4L2_CID_BRIGHTNESS equals to
- // V4L2_CID_USER_BASE).
- range.id = (control.control_base - 1) | V4L2_CTRL_FLAG_NEXT_CTRL;
+ range.id = control.control_base | V4L2_CTRL_FLAG_NEXT_CTRL;
while (0 == DoIoctl(VIDIOC_QUERYCTRL, &range)) {
if (V4L2_CTRL_ID2CLASS(range.id) != V4L2_CTRL_ID2CLASS(control.class_id))
break;
-
- v4l2_ext_control ext_control = {};
- ext_control.id = range.id;
- ext_control.value = range.default_value;
-
- // Prepare to query for the next control as `range` is an in-out
- // parameter.
range.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
- if (range.flags & (V4L2_CTRL_FLAG_DISABLED | V4L2_CTRL_FLAG_READ_ONLY)) {
- // Permanently disabled or permanently read-only.
+ if (IsSpecialControl(range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL))
continue;
- }
- if (IsBlockedControl(ext_control.id)) {
+ if (IsBlockedControl(range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL))
continue;
- }
- if (IsSpecialControl(ext_control.id)) {
- special_camera_controls.push_back(ext_control);
- if (ext_control.id == V4L2_CID_EXPOSURE_AUTO) {
- ext_control.value = V4L2_EXPOSURE_MANUAL;
- } else {
- ext_control.value = false; // Not automatic but manual.
- }
- manual_special_camera_controls.push_back(ext_control);
- } else {
- camera_controls.push_back(ext_control);
- }
+ struct v4l2_ext_control ext_control = {};
+ ext_control.id = range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL;
+ ext_control.value = range.default_value;
+ camera_controls.push_back(ext_control);
}
if (!camera_controls.empty()) {
- // Set special controls to manual modes first.
- if (!manual_special_camera_controls.empty()) {
- ext_controls.which =
- use_modern_s_ext_ctrls ? V4L2_CTRL_WHICH_CUR_VAL : control.class_id;
- ext_controls.count = manual_special_camera_controls.size();
- ext_controls.controls = manual_special_camera_controls.data();
- if (DoIoctl(VIDIOC_S_EXT_CTRLS, &ext_controls) < 0) {
- DPLOG(INFO) << "VIDIOC_S_EXT_CTRLS";
- }
- }
-
- // Set non-special controls to the default values.
- ext_controls.which =
- use_modern_s_ext_ctrls ? V4L2_CTRL_WHICH_CUR_VAL : control.class_id;
- ext_controls.count = camera_controls.size();
- ext_controls.controls = camera_controls.data();
- if (DoIoctl(VIDIOC_S_EXT_CTRLS, &ext_controls) < 0) {
- DPLOG(INFO) << "VIDIOC_S_EXT_CTRLS";
- }
- }
-
- // Set special controls to the default values.
- if (!special_camera_controls.empty()) {
- ext_controls.which =
- use_modern_s_ext_ctrls ? V4L2_CTRL_WHICH_CUR_VAL : control.class_id;
- ext_controls.count = special_camera_controls.size();
- ext_controls.controls = special_camera_controls.data();
- if (DoIoctl(VIDIOC_S_EXT_CTRLS, &ext_controls) < 0) {
+ struct v4l2_ext_controls ext_controls2 = {};
+ ext_controls2.ctrl_class = control.class_id;
+ ext_controls2.count = camera_controls.size();
+ ext_controls2.controls = camera_controls.data();
+ if (DoIoctl(VIDIOC_S_EXT_CTRLS, &ext_controls2) < 0)
DPLOG(INFO) << "VIDIOC_S_EXT_CTRLS";
- }
}
}
+
+ // Now set the special flags to the default values
+ v4l2_queryctrl range = {};
+ range.id = V4L2_CID_AUTO_WHITE_BALANCE;
+ DoIoctl(VIDIOC_QUERYCTRL, &range);
+ auto_white_balance.value = range.default_value;
+ DoIoctl(VIDIOC_S_CTRL, &auto_white_balance);
+
+ special_camera_controls.clear();
+ memset(&range, 0, sizeof(range));
+ range.id = V4L2_CID_EXPOSURE_AUTO;
+ DoIoctl(VIDIOC_QUERYCTRL, &range);
+ auto_exposure.value = range.default_value;
+ special_camera_controls.push_back(auto_exposure);
+
+ memset(&range, 0, sizeof(range));
+ range.id = V4L2_CID_EXPOSURE_AUTO_PRIORITY;
+ DoIoctl(VIDIOC_QUERYCTRL, &range);
+ priority_auto_exposure.value = range.default_value;
+ special_camera_controls.push_back(priority_auto_exposure);
+
+ memset(&range, 0, sizeof(range));
+ range.id = V4L2_CID_FOCUS_AUTO;
+ DoIoctl(VIDIOC_QUERYCTRL, &range);
+ auto_focus.value = range.default_value;
+ special_camera_controls.push_back(auto_focus);
+
+ memset(&ext_controls, 0, sizeof(ext_controls));
+ ext_controls.ctrl_class = V4L2_CID_CAMERA_CLASS;
+ ext_controls.count = special_camera_controls.size();
+ ext_controls.controls = special_camera_controls.data();
+ if (DoIoctl(VIDIOC_S_EXT_CTRLS, &ext_controls) < 0)
+ DPLOG(INFO) << "VIDIOC_S_EXT_CTRLS";
}
bool V4L2CaptureDelegate::MapAndQueueBuffer(int index) {
diff --git a/media/capture/video/linux/v4l2_capture_delegate.h b/media/capture/video/linux/v4l2_capture_delegate.h
index 5eaa0cd004b81..c9be3d02f9344 100644
--- a/media/capture/video/linux/v4l2_capture_delegate.h
+++ b/media/capture/video/linux/v4l2_capture_delegate.h
@@ -78,9 +78,6 @@ class CAPTURE_EXPORT V4L2CaptureDelegate final {
base::WeakPtr<V4L2CaptureDelegate> GetWeakPtr();
- static bool IsBlockedControl(int control_id);
- static bool IsSpecialControl(int control_id);
-
private:
friend class V4L2CaptureDelegateTest;
diff --git a/media/capture/video/linux/v4l2_capture_delegate_unittest.cc b/media/capture/video/linux/v4l2_capture_delegate_unittest.cc
index 06046ca45d634..4e6e38bbd5c72 100644
--- a/media/capture/video/linux/v4l2_capture_delegate_unittest.cc
+++ b/media/capture/video/linux/v4l2_capture_delegate_unittest.cc
@@ -35,110 +35,119 @@ static struct {
} const kControls[] = {{V4L2_CID_USER_BASE, V4L2_CID_USER_CLASS},
{V4L2_CID_CAMERA_CLASS_BASE, V4L2_CID_CAMERA_CLASS}};
+// Determines if |control_id| is special, i.e. controls another one's state, or
+// if it should be denied (see https://crbug.com/697885).
+#if !defined(V4L2_CID_PAN_SPEED)
+#define V4L2_CID_PAN_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 32)
+#endif
+#if !defined(V4L2_CID_TILT_SPEED)
+#define V4L2_CID_TILT_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 33)
+#endif
+#if !defined(V4L2_CID_PANTILT_CMD)
+#define V4L2_CID_PANTILT_CMD (V4L2_CID_CAMERA_CLASS_BASE + 34)
+#endif
+static bool IsSpecialOrBlockedControl(int control_id) {
+ switch (control_id) {
+ case V4L2_CID_AUTO_WHITE_BALANCE:
+ case V4L2_CID_EXPOSURE_AUTO:
+ case V4L2_CID_EXPOSURE_AUTO_PRIORITY:
+ case V4L2_CID_FOCUS_AUTO:
+ case V4L2_CID_PAN_RELATIVE:
+ case V4L2_CID_TILT_RELATIVE:
+ case V4L2_CID_PAN_RESET:
+ case V4L2_CID_TILT_RESET:
+ case V4L2_CID_PAN_ABSOLUTE:
+ case V4L2_CID_TILT_ABSOLUTE:
+ case V4L2_CID_ZOOM_ABSOLUTE:
+ case V4L2_CID_ZOOM_RELATIVE:
+ case V4L2_CID_ZOOM_CONTINUOUS:
+ case V4L2_CID_PAN_SPEED:
+ case V4L2_CID_TILT_SPEED:
+ case V4L2_CID_PANTILT_CMD:
+ return true;
+ }
+ return false;
+}
+
static void SetControlsToMaxValues(int device_fd) {
- v4l2_ext_controls ext_controls;
- memset(&ext_controls, 0, sizeof(ext_controls));
- ext_controls.which = V4L2_CTRL_WHICH_CUR_VAL;
- ext_controls.count = 0;
- const bool use_modern_s_ext_ctrls =
- HANDLE_EINTR(ioctl(device_fd, VIDIOC_S_EXT_CTRLS, &ext_controls)) == 0;
+ // Set V4L2_CID_AUTO_WHITE_BALANCE to false first.
+ v4l2_control auto_white_balance = {};
+ auto_white_balance.id = V4L2_CID_AUTO_WHITE_BALANCE;
+ auto_white_balance.value = false;
+ if (HANDLE_EINTR(ioctl(device_fd, VIDIOC_S_CTRL, &auto_white_balance)) < 0)
+ DPLOG(ERROR) << "VIDIOC_S_CTRL";
+
+ std::vector<struct v4l2_ext_control> special_camera_controls;
+ // Set V4L2_CID_EXPOSURE_AUTO to V4L2_EXPOSURE_MANUAL.
+ v4l2_ext_control auto_exposure = {};
+ auto_exposure.id = V4L2_CID_EXPOSURE_AUTO;
+ auto_exposure.value = V4L2_EXPOSURE_MANUAL;
+ special_camera_controls.push_back(auto_exposure);
+ // Set V4L2_CID_EXPOSURE_AUTO_PRIORITY to false.
+ v4l2_ext_control priority_auto_exposure = {};
+ priority_auto_exposure.id = V4L2_CID_EXPOSURE_AUTO_PRIORITY;
+ priority_auto_exposure.value = false;
+ special_camera_controls.push_back(priority_auto_exposure);
+ // Set V4L2_CID_FOCUS_AUTO to false.
+ v4l2_ext_control auto_focus = {};
+ auto_focus.id = V4L2_CID_FOCUS_AUTO;
+ auto_focus.value = false;
+ special_camera_controls.push_back(auto_focus);
+
+ struct v4l2_ext_controls camera_ext_controls = {};
+ camera_ext_controls.ctrl_class = V4L2_CID_CAMERA_CLASS;
+ camera_ext_controls.count = special_camera_controls.size();
+ camera_ext_controls.controls = special_camera_controls.data();
+ if (HANDLE_EINTR(ioctl(device_fd, VIDIOC_S_EXT_CTRLS, &camera_ext_controls)) <
+ 0) {
+ DPLOG(ERROR) << "VIDIOC_S_EXT_CTRLS";
+ }
for (const auto& control : kControls) {
std::vector<struct v4l2_ext_control> camera_controls;
- std::vector<struct v4l2_ext_control> manual_special_camera_controls;
v4l2_queryctrl range = {};
- // Start right below the base so that the first next retrieved control ID
- // is always the first available control ID within the class even if that
- // control ID is equal to the base (V4L2_CID_BRIGHTNESS equals to
- // V4L2_CID_USER_BASE).
- range.id = (control.control_base - 1) | V4L2_CTRL_FLAG_NEXT_CTRL;
+ range.id = control.control_base | V4L2_CTRL_FLAG_NEXT_CTRL;
while (0 == HANDLE_EINTR(ioctl(device_fd, VIDIOC_QUERYCTRL, &range))) {
if (V4L2_CTRL_ID2CLASS(range.id) != V4L2_CTRL_ID2CLASS(control.class_id))
break;
-
- v4l2_ext_control ext_control = {};
- ext_control.id = range.id;
-
- // Prepare to query for the next control as `range` is an in-out
- // parameter.
range.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
- if (range.flags & (V4L2_CTRL_FLAG_DISABLED | V4L2_CTRL_FLAG_READ_ONLY)) {
- // Permanently disabled or permanently read-only.
- continue;
- }
- if (V4L2CaptureDelegate::IsBlockedControl(ext_control.id)) {
+ if (IsSpecialOrBlockedControl(range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL))
continue;
- }
-
- if (V4L2CaptureDelegate::IsSpecialControl(ext_control.id)) {
- if (ext_control.id == V4L2_CID_EXPOSURE_AUTO) {
- ext_control.value = V4L2_EXPOSURE_MANUAL;
- } else {
- ext_control.value = false; // Not automatic but manual.
- }
- manual_special_camera_controls.push_back(ext_control);
- DVLOG(1) << __func__ << " " << range.name << " set to manual";
- } else {
- ext_control.value = range.maximum;
- camera_controls.push_back(ext_control);
- DVLOG(1) << __func__ << " " << range.name << " set to "
- << range.maximum;
- }
- }
+ DVLOG(1) << __func__ << " " << range.name << " set to " << range.maximum;
- // Set special controls to manual modes.
- if (!manual_special_camera_controls.empty()) {
- ext_controls.which =
- use_modern_s_ext_ctrls ? V4L2_CTRL_WHICH_CUR_VAL : control.class_id;
- ext_controls.count = manual_special_camera_controls.size();
- ext_controls.controls = manual_special_camera_controls.data();
- if (HANDLE_EINTR(ioctl(device_fd, VIDIOC_S_EXT_CTRLS, &ext_controls)) <
- 0) {
- DPLOG(ERROR) << "VIDIOC_S_EXT_CTRLS";
- }
+ struct v4l2_ext_control ext_control = {};
+ ext_control.id = range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL;
+ ext_control.value = range.maximum;
+ camera_controls.push_back(ext_control);
}
- // Set non-special controls to maximum values.
if (!camera_controls.empty()) {
- ext_controls.which =
- use_modern_s_ext_ctrls ? V4L2_CTRL_WHICH_CUR_VAL : control.class_id;
+ struct v4l2_ext_controls ext_controls = {};
+ ext_controls.ctrl_class = control.class_id;
ext_controls.count = camera_controls.size();
ext_controls.controls = camera_controls.data();
if (HANDLE_EINTR(ioctl(device_fd, VIDIOC_S_EXT_CTRLS, &ext_controls)) < 0)
DPLOG(ERROR) << "VIDIOC_S_EXT_CTRLS";
}
- // Start right below the base so that the first next retrieved control ID
- // is always the first available control ID within the class even if that
- // control ID is equal to the base (V4L2_CID_BRIGHTNESS equals to
- // V4L2_CID_USER_BASE).
- range.id = (control.control_base - 1) | V4L2_CTRL_FLAG_NEXT_CTRL;
+ range.id = control.control_base | V4L2_CTRL_FLAG_NEXT_CTRL;
while (0 == HANDLE_EINTR(ioctl(device_fd, VIDIOC_QUERYCTRL, &range))) {
if (V4L2_CTRL_ID2CLASS(range.id) != V4L2_CTRL_ID2CLASS(control.class_id))
break;
-
- v4l2_control readback = {};
- readback.id = range.id;
-
- // Prepare to query for the next control as `range` is an in-out
- // parameter.
range.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
- if (range.flags & (V4L2_CTRL_FLAG_DISABLED | V4L2_CTRL_FLAG_READ_ONLY)) {
- // Permanently disabled or permanently read-only.
+ if (IsSpecialOrBlockedControl(range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL))
continue;
- }
- if (V4L2CaptureDelegate::IsBlockedControl(readback.id) ||
- V4L2CaptureDelegate::IsSpecialControl(readback.id)) {
- continue;
- }
+ DVLOG(1) << __func__ << " " << range.name << " set to " << range.maximum;
+ v4l2_control readback = {};
+ readback.id = range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL;
if (HANDLE_EINTR(ioctl(device_fd, VIDIOC_G_CTRL, &readback)) < 0)
DPLOG(ERROR) << range.name << ", failed to be read.";
- EXPECT_EQ(range.maximum, readback.value)
- << " control " << range.name << " didn't set correctly";
+ EXPECT_EQ(range.maximum, readback.value) << " control " << range.name
+ << " didnt set correctly";
}
}
}
@@ -186,7 +195,15 @@ class V4L2CaptureDelegateTest : public ::testing::Test {
} // anonymous namespace
-TEST_F(V4L2CaptureDelegateTest, CreateAndDestroyAndVerifyControls) {
+// Fails on Linux, see crbug/732355
+#if BUILDFLAG(IS_LINUX)
+#define MAYBE_CreateAndDestroyAndVerifyControls \
+ DISABLED_CreateAndDestroyAndVerifyControls
+#else
+#define MAYBE_CreateAndDestroyAndVerifyControls \
+ CreateAndDestroyAndVerifyControls
+#endif
+TEST_F(V4L2CaptureDelegateTest, MAYBE_CreateAndDestroyAndVerifyControls) {
// Check that there is at least a video device, otherwise bail.
const base::FilePath path("/dev/");
base::FileEnumerator enumerator(path, false, base::FileEnumerator::FILES,

@ -241,7 +241,7 @@
%endif %endif
Name: chromium%{chromium_channel} Name: chromium%{chromium_channel}
Version: 113.0.5672.92 Version: 113.0.5672.126
Release: 1%{?dist} Release: 1%{?dist}
Summary: A WebKit (Blink) powered web browser that Google doesn't want you to use Summary: A WebKit (Blink) powered web browser that Google doesn't want you to use
Url: http://www.chromium.org/Home Url: http://www.chromium.org/Home
@ -341,8 +341,6 @@ Patch106: chromium-98.0.4758.80-epel7-erase-fix.patch
Patch107: chromium-99.0.4844.51-el7-extra-operator==.patch Patch107: chromium-99.0.4844.51-el7-extra-operator==.patch
# workaround for clang bug on el7 # workaround for clang bug on el7
Patch108: chromium-113-constexpr-el7.patch Patch108: chromium-113-constexpr-el7.patch
# fix FTBFS on el7, old kernel
Patch109: chromium-113-v4l2-revert-el7.patch
# system ffmpeg # system ffmpeg
Patch114: chromium-107-ffmpeg-duration.patch Patch114: chromium-107-ffmpeg-duration.patch
@ -363,9 +361,6 @@ Patch146: chromium-110-LargerThan4k.patch
# Apply these patches to work around EPEL8 issues # Apply these patches to work around EPEL8 issues
Patch300: chromium-113-rhel8-force-disable-use_gnome_keyring.patch Patch300: chromium-113-rhel8-force-disable-use_gnome_keyring.patch
# workaround for bug in clang 14 with c++20 on rhel9, linker errors std::u16string
Patch301: chromium-112-workaround-llvm14-c++20-epel8.patch
# workaround for clang bug, https://github.com/llvm/llvm-project/issues/57826 # workaround for clang bug, https://github.com/llvm/llvm-project/issues/57826
Patch302: chromium-113-workaround_clang_bug-structured_binding.patch Patch302: chromium-113-workaround_clang_bug-structured_binding.patch
# declare iterators as subtypes # declare iterators as subtypes
@ -945,8 +940,7 @@ udev.
%patch -P105 -p1 -b .el7-old-libdrm %patch -P105 -p1 -b .el7-old-libdrm
%patch -P106 -p1 -b .el7-erase-fix %patch -P106 -p1 -b .el7-erase-fix
%patch -P107 -p1 -b .el7-extra-operator-equalequal %patch -P107 -p1 -b .el7-extra-operator-equalequal
%patch -P108 -p1 -R -b .constexpr-el7 %patch -P108 -p1 -b .constexpr-el7
%patch -P109 -p1 -b .v4l2-revert-el7
%endif %endif
%patch -P130 -p1 -b .VirtualCursor-std-layout %patch -P130 -p1 -b .VirtualCursor-std-layout
@ -960,9 +954,6 @@ udev.
%endif %endif
%if %{clang} %if %{clang}
%if 0%{?rhel} == 8
%patch -P301 -p1 -b .clang14_c++20
%endif
%if 0%{?rhel} || 0%{?fedora} < 38 %if 0%{?rhel} || 0%{?fedora} < 38
%patch -P302 -p1 -b .workaround_clang_bug-structured_binding %patch -P302 -p1 -b .workaround_clang_bug-structured_binding
%endif %endif
@ -1644,6 +1635,10 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt
%{chromium_path}/chromedriver %{chromium_path}/chromedriver
%changelog %changelog
* Wed May 17 2023 Than Ngo <than@redhat.com> - 113.0.5672.126-1
- drop clang workaround for el8
- update to 113.0.5672.126
* Tue May 09 2023 Than Ngo <than@redhat.com> - 113.0.5672.92-1 * Tue May 09 2023 Than Ngo <than@redhat.com> - 113.0.5672.92-1
- update to 113.0.5672.92 - update to 113.0.5672.92

@ -1,3 +1,3 @@
SHA512 (node-v19.8.1-linux-arm64.tar.xz) = 86ff19085669e92ce7afe2fd7d4df0c5441df2d88c00f29d5463b805f3cf5625626db8aebf98349c9a495b772da1ce6d68263730018207ea98815058a1c81397 SHA512 (node-v19.8.1-linux-arm64.tar.xz) = 86ff19085669e92ce7afe2fd7d4df0c5441df2d88c00f29d5463b805f3cf5625626db8aebf98349c9a495b772da1ce6d68263730018207ea98815058a1c81397
SHA512 (node-v19.8.1-linux-x64.tar.xz) = 925c0037c6b7074d0b0245bced20d0a0d9b1300f53b808106f16b5018d763f5f5b00bc321b33fa1033d736b1e1076608da9b7fcae66aed53d27b100b1186e2c6 SHA512 (node-v19.8.1-linux-x64.tar.xz) = 925c0037c6b7074d0b0245bced20d0a0d9b1300f53b808106f16b5018d763f5f5b00bc321b33fa1033d736b1e1076608da9b7fcae66aed53d27b100b1186e2c6
SHA512 (chromium-113.0.5672.92-clean.tar.xz) = d1a4807ba2f365277daa111a75bcb088058611dcebe8cdd1eb464a49048b41f3e51fd93f1586d2392ca731b9f56a06a6a2ee58198566ac80e30e1a57e881dbaf SHA512 (chromium-113.0.5672.126-clean.tar.xz) = 1c7c48f2ea78f09f533dd42eee22876b0716517c8d6beb76b2c8ae1c616bfc050e179c8bda4fe1f9e6ab7fa9dc29077b0cdf149a6e27d10e2fac35d6ef8e6c99

Loading…
Cancel
Save