* Thu Mar 21 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 123.0.6312.58-1.inferit

- update to 123.0.6312.58
   * High CVE-2024-2625: Object lifecycle issue in V8
   * Medium CVE-2024-2626: Out of bounds read in Swiftshader
   * Medium CVE-2024-2627: Use after free in Canvas
   * Medium CVE-2024-2628: Inappropriate implementation in Downloads
   * Medium CVE-2024-2629: Incorrect security UI in iOS
   * Medium CVE-2024-2630: Inappropriate implementation in iOS
   * Low CVE-2024-2631: Inappropriate implementation in iOS
- fixed bz#2270321 - VAAPI flags in chromium.conf are out of date
i9e
Arkady L. Shane 6 months ago
parent 43ecf67fca
commit 87500a020e
Signed by: tigro
GPG Key ID: 1EC08A25C9DB2503

@ -1,4 +1,4 @@
b3c172451846281a8c1c04835412632ff99566a2 SOURCES/chromium-122.0.6261.128.tar.xz
4fc55a6b3696c0519d0b75666ca0074f9cc3b1dd SOURCES/chromium-123.0.6312.58.tar.xz
dea187019741602d57aaf189a80abba261fbd2aa SOURCES/linux-x64-0.19.2.tgz
7e5d2c7864c5c83ec789b59c77cd9c20d2594916 SOURCES/linux-arm64-0.19.2.tgz
769196d081c6a0ad37f1c63dec56febfff3370de SOURCES/node-v20.6.1-linux-x64.tar.xz

2
.gitignore vendored

@ -1,4 +1,4 @@
SOURCES/chromium-122.0.6261.128.tar.xz
SOURCES/chromium-123.0.6312.58.tar.xz
SOURCES/linux-x64-0.19.2.tgz
SOURCES/linux-arm64-0.19.2.tgz
SOURCES/node-v20.6.1-linux-x64.tar.xz

@ -1,12 +0,0 @@
diff -up chromium-119.0.6045.199/build/config/compiler/BUILD.gn.me chromium-119.0.6045.199/build/config/compiler/BUILD.gn
--- chromium-119.0.6045.199/build/config/compiler/BUILD.gn.me 2023-12-02 12:19:01.138079722 +0100
+++ chromium-119.0.6045.199/build/config/compiler/BUILD.gn 2023-12-02 12:21:05.835322037 +0100
@@ -379,7 +379,7 @@ config("compiler") {
cflags += [ "-fno-stack-protector" ]
} else if (current_os != "aix") {
# Not available on aix.
- cflags += [ "-fstack-protector" ]
+ cflags += [ "-fstack-protector-strong" ]
}
}
}

@ -1,230 +0,0 @@
commit 57526b8dc45b2e6c67bba7306f1dde73b1f2910c
Author: sisidovski <sisidovski@chromium.org>
Date: Tue Oct 24 09:32:49 2023 +0000
Remove unused items from the RaceNetworkRequest hashmap
When the AutoPreload or the race-network-and-fetch-handler option in the
static routing API is enabled, network requests are dispatched and
URLLoaderFactories are held in a hashmap in ServiceWorkerGlobalScope.
Those are consumed inside the fetch handler when fetch(e.request) is
called. But if the fetch handler doesn't call fetch() e.g. fallback,
those hashmap items does not have a chance to be removed.
This CL changes the hashmap items to be removed when the fetch event
finishes, and the URLLoaderFactory is still not consumed at that time.
This may loose the dedupe capability if fetch() is called later e.g.
setTimeout(() => fetch()), but it makes sense to prioritize keeping the
hashmap small.
Change-Id: I51bdc9d5eb5185f2b5b4df6ee785715b1180c848
Bug: 1492640
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4964840
Reviewed-by: Minoru Chikamune <chikamune@chromium.org>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1214064}
diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.cc b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.cc
index 02887edc10883..b3624fc0162df 100644
--- a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.cc
+++ b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.cc
@@ -46,6 +46,7 @@
#include "services/network/public/cpp/cross_origin_embedder_policy.h"
#include "services/network/public/mojom/cookie_manager.mojom-blink.h"
#include "services/network/public/mojom/cross_origin_embedder_policy.mojom.h"
+#include "services/network/public/mojom/url_loader_factory.mojom-blink.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
#include "third_party/blink/public/mojom/notifications/notification.mojom-blink.h"
@@ -1096,6 +1097,10 @@ void ServiceWorkerGlobalScope::DidHandleFetchEvent(
TRACE_ID_WITH_SCOPE(kServiceWorkerGlobalScopeTraceScope,
TRACE_ID_LOCAL(event_id)),
TRACE_EVENT_FLAG_FLOW_IN, "status", MojoEnumToString(status));
+
+ // Delete the URLLoaderFactory for the RaceNetworkRequest if it's not used.
+ RemoveItemFromRaceNetworkRequests(event_id);
+
if (!RunEventCallback(&fetch_event_callbacks_, event_queue_.get(), event_id,
status)) {
// The event may have been aborted. Its response callback also needs to be
@@ -1495,6 +1500,7 @@ void ServiceWorkerGlobalScope::AbortCallbackForFetchEvent(
response_callback_iter->value->TakeValue().reset();
fetch_response_callbacks_.erase(response_callback_iter);
}
+ RemoveItemFromRaceNetworkRequests(event_id);
// Run the event callback with the error code.
auto event_callback_iter = fetch_event_callbacks_.find(event_id);
@@ -1551,52 +1557,11 @@ void ServiceWorkerGlobalScope::StartFetchEvent(
if (params->race_network_request_loader_factory &&
params->request->service_worker_race_network_request_token) {
- auto insert_result = race_network_request_loader_factories_.insert(
- String(params->request->service_worker_race_network_request_token
- ->ToString()),
- std::move(params->race_network_request_loader_factory));
-
- // DumpWithoutCrashing if the token is empty, or not inserted as a new entry
- // to |race_network_request_loader_factories_|.
- // TODO(crbug.com/1492640) Remove DumpWithoutCrashing once we collect data
- // and identify the cause.
- static bool has_dumped_without_crashing_for_empty_token = false;
- static bool has_dumped_without_crashing_for_not_new_entry = false;
- if (!has_dumped_without_crashing_for_empty_token &&
- params->request->service_worker_race_network_request_token
- ->is_empty()) {
- has_dumped_without_crashing_for_empty_token = true;
- SCOPED_CRASH_KEY_BOOL(
- "SWGlobalScope", "empty_race_token",
- params->request->service_worker_race_network_request_token
- ->is_empty());
- SCOPED_CRASH_KEY_STRING64(
- "SWGlobalScope", "race_token_string",
- params->request->service_worker_race_network_request_token
- ->ToString());
- SCOPED_CRASH_KEY_BOOL("SWGlobalScope", "race_insert_new_entry",
- insert_result.is_new_entry);
- SCOPED_CRASH_KEY_STRING256("SWGlobalScope", "race_request_url",
- params->request->url.GetString().Utf8());
- base::debug::DumpWithoutCrashing();
- }
- if (!has_dumped_without_crashing_for_not_new_entry &&
- !insert_result.is_new_entry) {
- has_dumped_without_crashing_for_not_new_entry = true;
- SCOPED_CRASH_KEY_BOOL(
- "SWGlobalScope", "empty_race_token",
- params->request->service_worker_race_network_request_token
- ->is_empty());
- SCOPED_CRASH_KEY_STRING64(
- "SWGlobalScope", "race_token_string",
- params->request->service_worker_race_network_request_token
- ->ToString());
- SCOPED_CRASH_KEY_BOOL("SWGlobalScope", "race_insert_new_entry",
- insert_result.is_new_entry);
- SCOPED_CRASH_KEY_STRING256("SWGlobalScope", "race_request_url",
- params->request->url.GetString().Utf8());
- base::debug::DumpWithoutCrashing();
- }
+ InsertNewItemToRaceNetworkRequests(
+ event_id,
+ params->request->service_worker_race_network_request_token.value(),
+ std::move(params->race_network_request_loader_factory),
+ params->request->url);
}
Request* request = Request::Create(
@@ -2808,12 +2773,71 @@ bool ServiceWorkerGlobalScope::SetAttributeEventListener(
absl::optional<mojo::PendingRemote<network::mojom::blink::URLLoaderFactory>>
ServiceWorkerGlobalScope::FindRaceNetworkRequestURLLoaderFactory(
const base::UnguessableToken& token) {
- mojo::PendingRemote<network::mojom::blink::URLLoaderFactory> result =
- race_network_request_loader_factories_.Take(String(token.ToString()));
+ std::unique_ptr<RaceNetworkRequestInfo> result =
+ race_network_requests_.Take(String(token.ToString()));
if (result) {
- return result;
+ race_network_request_fetch_event_ids_.erase(result->fetch_event_id);
+ return absl::optional<
+ mojo::PendingRemote<network::mojom::blink::URLLoaderFactory>>(
+ std::move(result->url_loader_factory));
}
return absl::nullopt;
}
+void ServiceWorkerGlobalScope::InsertNewItemToRaceNetworkRequests(
+ int fetch_event_id,
+ const base::UnguessableToken& token,
+ mojo::PendingRemote<network::mojom::blink::URLLoaderFactory>
+ url_loader_factory,
+ const KURL& request_url) {
+ auto race_network_request_token = String(token.ToString());
+ auto info = std::make_unique<RaceNetworkRequestInfo>(
+ fetch_event_id, race_network_request_token,
+ std::move(url_loader_factory));
+ race_network_request_fetch_event_ids_.insert(fetch_event_id, info.get());
+ auto insert_result = race_network_requests_.insert(race_network_request_token,
+ std::move(info));
+
+ // DumpWithoutCrashing if the token is empty, or not inserted as a new entry
+ // to |race_network_request_loader_factories_|.
+ // TODO(crbug.com/1492640) Remove DumpWithoutCrashing once we collect data
+ // and identify the cause.
+ static bool has_dumped_without_crashing_for_empty_token = false;
+ static bool has_dumped_without_crashing_for_not_new_entry = false;
+ if (!has_dumped_without_crashing_for_empty_token && token.is_empty()) {
+ has_dumped_without_crashing_for_empty_token = true;
+ SCOPED_CRASH_KEY_BOOL("SWGlobalScope", "empty_race_token",
+ token.is_empty());
+ SCOPED_CRASH_KEY_STRING64("SWGlobalScope", "race_token_string",
+ token.ToString());
+ SCOPED_CRASH_KEY_BOOL("SWGlobalScope", "race_insert_new_entry",
+ insert_result.is_new_entry);
+ SCOPED_CRASH_KEY_STRING256("SWGlobalScope", "race_request_url",
+ request_url.GetString().Utf8());
+ base::debug::DumpWithoutCrashing();
+ }
+ if (!has_dumped_without_crashing_for_not_new_entry &&
+ !insert_result.is_new_entry) {
+ has_dumped_without_crashing_for_not_new_entry = true;
+ SCOPED_CRASH_KEY_BOOL("SWGlobalScope", "empty_race_token",
+ token.is_empty());
+ SCOPED_CRASH_KEY_STRING64("SWGlobalScope", "race_token_string",
+ token.ToString());
+ SCOPED_CRASH_KEY_BOOL("SWGlobalScope", "race_insert_new_entry",
+ insert_result.is_new_entry);
+ SCOPED_CRASH_KEY_STRING256("SWGlobalScope", "race_request_url",
+ request_url.GetString().Utf8());
+ base::debug::DumpWithoutCrashing();
+ }
+}
+
+void ServiceWorkerGlobalScope::RemoveItemFromRaceNetworkRequests(
+ int fetch_event_id) {
+ RaceNetworkRequestInfo* info =
+ race_network_request_fetch_event_ids_.Take(fetch_event_id);
+ if (info) {
+ race_network_requests_.erase(info->token);
+ }
+}
+
} // namespace blink
diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.h b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.h
index 46c431b395825..ac4cac0b1d8fb 100644
--- a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.h
+++ b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.h
@@ -623,6 +623,14 @@ class MODULES_EXPORT ServiceWorkerGlobalScope final
// ServiceWorker.FetchEvent.QueuingTime histogram.
void RecordQueuingTime(base::TimeTicks created_time);
+ void InsertNewItemToRaceNetworkRequests(
+ int fetch_event_id,
+ const base::UnguessableToken& token,
+ mojo::PendingRemote<network::mojom::blink::URLLoaderFactory>
+ url_loader_factory,
+ const KURL& request_url);
+ void RemoveItemFromRaceNetworkRequests(int fetch_event_id);
+
Member<ServiceWorkerClients> clients_;
Member<ServiceWorkerRegistration> registration_;
Member<::blink::ServiceWorker> service_worker_;
@@ -768,10 +776,17 @@ class MODULES_EXPORT ServiceWorkerGlobalScope final
blink::BlinkStorageKey storage_key_;
+ struct RaceNetworkRequestInfo {
+ int fetch_event_id;
+ String token;
+ mojo::PendingRemote<network::mojom::blink::URLLoaderFactory>
+ url_loader_factory;
+ };
// TODO(crbug.com/918702) WTF::HashMap cannot use base::UnguessableToken as a
// key. As a workaround uses WTF::String as a key instead.
- HashMap<String, mojo::PendingRemote<network::mojom::blink::URLLoaderFactory>>
- race_network_request_loader_factories_;
+ HashMap<String, std::unique_ptr<RaceNetworkRequestInfo>>
+ race_network_requests_;
+ HashMap<int, RaceNetworkRequestInfo*> race_network_request_fetch_event_ids_;
HeapMojoAssociatedRemote<mojom::blink::AssociatedInterfaceProvider>
remote_associated_interfaces_{this};

@ -1,12 +0,0 @@
diff -up chromium-121.0.6167.16/third_party/blink/renderer/core/BUILD.gn.mnemonic-error chromium-121.0.6167.16/third_party/blink/renderer/core/BUILD.gn
--- chromium-121.0.6167.16/third_party/blink/renderer/core/BUILD.gn.mnemonic-error 2023-12-19 18:14:43.027723832 +0100
+++ chromium-121.0.6167.16/third_party/blink/renderer/core/BUILD.gn 2023-12-19 18:39:47.492384620 +0100
@@ -1731,8 +1731,6 @@ action_foreach("element_locator_test_pro
python_path_root = "${root_out_dir}/pyproto"
python_path_proto = "${python_path_root}/third_party/blink/renderer/core/lcp_critical_path_predictor"
- mnemonic = "ELOC_PROTO"
-
source_dir = "lcp_critical_path_predictor/test_proto"
sources = rebase_path([ "lcp_image_id.asciipb" ], "", source_dir)
sources += rebase_path([ "lcp_image_id_b.asciipb" ], "", source_dir)

@ -1,32 +0,0 @@
commit 04866680f4f9a8475ae3795ad6ed59649ba478d7
Author: Jose Dapena Paz <jdapena@igalia.com>
Date: Tue Jan 23 12:04:05 2024 +0000
libstdc++: fix static assertion in NodeUuidEquality
libstdc++ equality checks in static assertion that it is possible to
compare for equality base::Uuid to BookmarkNode*. This was a missing
operator in NodeUuidEquality that this changeset adds.
Bug: 957519
Change-Id: Icc9809cb43d321f0b3e3394ef27ab55672aec5e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5227686
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1250753}
diff --git a/components/bookmarks/browser/uuid_index.h b/components/bookmarks/browser/uuid_index.h
index 77cb1a1a54dd9..639d6fefcd831 100644
--- a/components/bookmarks/browser/uuid_index.h
+++ b/components/bookmarks/browser/uuid_index.h
@@ -23,6 +23,10 @@ class NodeUuidEquality {
bool operator()(const BookmarkNode* n1, const base::Uuid& uuid2) const {
return n1->uuid() == uuid2;
}
+
+ bool operator()(const base::Uuid& uuid1, const BookmarkNode* n2) const {
+ return uuid1 == n2->uuid();
+ }
};
// Used to hash BookmarkNode instances by UUID.

@ -0,0 +1,36 @@
diff -up chromium-122.0.6261.69/components/variations/service/ui_string_overrider.cc.default-constructor-involving-anonymous-union chromium-122.0.6261.69/components/variations/service/ui_string_overrider.cc
--- chromium-122.0.6261.69/components/variations/service/ui_string_overrider.cc.default-constructor-involving-anonymous-union 2024-02-22 22:43:05.000000000 +0100
+++ chromium-122.0.6261.69/components/variations/service/ui_string_overrider.cc 2024-02-25 10:52:16.071602503 +0100
@@ -12,7 +12,7 @@
namespace variations {
-UIStringOverrider::UIStringOverrider() = default;
+UIStringOverrider::UIStringOverrider() {}
UIStringOverrider::UIStringOverrider(base::span<const uint32_t> resource_hashes,
base::span<const int> resource_indices)
diff -up chromium-122.0.6261.69/content/browser/interest_group/header_direct_from_seller_signals.cc.default-constructor-involving-anonymous-union chromium-122.0.6261.69/content/browser/interest_group/header_direct_from_seller_signals.cc
--- chromium-122.0.6261.69/content/browser/interest_group/header_direct_from_seller_signals.cc.default-constructor-involving-anonymous-union 2024-02-25 10:52:16.070602478 +0100
+++ chromium-122.0.6261.69/content/browser/interest_group/header_direct_from_seller_signals.cc 2024-02-25 11:20:36.583148226 +0100
@@ -46,7 +46,7 @@ size_t GetResultSizeBytes(const HeaderDi
} // namespace
-HeaderDirectFromSellerSignals::Result::Result() = default;
+HeaderDirectFromSellerSignals::Result::Result() {}
HeaderDirectFromSellerSignals::Result::Result(
std::optional<std::string> seller_signals,
diff -up chromium-123.0.6312.46/third_party/pdfium/core/fpdfdoc/cpdf_defaultappearance.cpp.me chromium-123.0.6312.46/third_party/pdfium/core/fpdfdoc/cpdf_defaultappearance.cpp
--- chromium-123.0.6312.46/third_party/pdfium/core/fpdfdoc/cpdf_defaultappearance.cpp.me 2024-03-18 16:11:19.550329592 +0100
+++ chromium-123.0.6312.46/third_party/pdfium/core/fpdfdoc/cpdf_defaultappearance.cpp 2024-03-18 16:12:51.124472676 +0100
@@ -54,7 +54,7 @@ bool FindTagParamFromStart(CPDF_SimplePa
} // namespace
-CPDF_DefaultAppearance::CPDF_DefaultAppearance() = default;
+CPDF_DefaultAppearance::CPDF_DefaultAppearance() {}
CPDF_DefaultAppearance::CPDF_DefaultAppearance(const ByteString& csDA)
: m_csDA(csDA) {}

@ -0,0 +1,12 @@
diff -up chromium-123.0.6312.46/build/config/compiler/BUILD.gn.fstack-protector-strong chromium-123.0.6312.46/build/config/compiler/BUILD.gn
--- chromium-123.0.6312.46/build/config/compiler/BUILD.gn.fstack-protector-strong 2024-03-15 11:46:34.542248116 +0100
+++ chromium-123.0.6312.46/build/config/compiler/BUILD.gn 2024-03-15 11:59:02.970849847 +0100
@@ -382,7 +382,7 @@ config("compiler") {
} else if ((is_posix && !is_chromeos && !is_nacl) || is_fuchsia) {
if (current_os != "aix") {
# Not available on aix.
- cflags += [ "-fstack-protector" ]
+ cflags += [ "-fstack-protector-strong" ]
}
}
}

@ -0,0 +1,169 @@
diff -up chromium-122.0.6261.29/base/check_op.h.missing-header-files chromium-122.0.6261.29/base/check_op.h
--- chromium-122.0.6261.29/base/check_op.h.missing-header-files 2024-02-07 19:49:20.000000000 +0100
+++ chromium-122.0.6261.29/base/check_op.h 2024-02-12 14:59:48.136415060 +0100
@@ -5,6 +5,7 @@
#ifndef BASE_CHECK_OP_H_
#define BASE_CHECK_OP_H_
+#include <cstdint>
#include <cstddef>
#include <string>
#include <string_view>
diff -up chromium-122.0.6261.29/base/containers/flat_map.h.missing-header-files chromium-122.0.6261.29/base/containers/flat_map.h
--- chromium-122.0.6261.29/base/containers/flat_map.h.missing-header-files 2024-02-07 19:49:20.000000000 +0100
+++ chromium-122.0.6261.29/base/containers/flat_map.h 2024-02-12 14:59:48.136415060 +0100
@@ -5,6 +5,7 @@
#ifndef BASE_CONTAINERS_FLAT_MAP_H_
#define BASE_CONTAINERS_FLAT_MAP_H_
+#include <cstdint>
#include <functional>
#include <tuple>
#include <type_traits>
diff -up chromium-122.0.6261.29/chrome/browser/webauthn/authenticator_request_dialog_model.h.missing-header-files chromium-122.0.6261.29/chrome/browser/webauthn/authenticator_request_dialog_model.h
--- chromium-122.0.6261.29/chrome/browser/webauthn/authenticator_request_dialog_model.h.missing-header-files 2024-02-12 14:59:48.137415079 +0100
+++ chromium-122.0.6261.29/chrome/browser/webauthn/authenticator_request_dialog_model.h 2024-02-12 15:28:17.168395787 +0100
@@ -9,6 +9,7 @@
#include <optional>
#include <string>
#include <vector>
+#include <variant>
#include "base/containers/span.h"
#include "base/functional/callback_forward.h"
diff -up chromium-122.0.6261.29/chrome/test/chromedriver/chrome/web_view_impl.cc.missing-header-files chromium-122.0.6261.29/chrome/test/chromedriver/chrome/web_view_impl.cc
--- chromium-122.0.6261.29/chrome/test/chromedriver/chrome/web_view_impl.cc.missing-header-files 2024-02-07 19:49:27.000000000 +0100
+++ chromium-122.0.6261.29/chrome/test/chromedriver/chrome/web_view_impl.cc 2024-02-12 14:59:48.137415079 +0100
@@ -11,6 +11,7 @@
#include <queue>
#include <utility>
#include <vector>
+#include <cstring>
#include "base/check.h"
#include "base/files/file_path.h"
diff -up chromium-122.0.6261.29/components/feature_engagement/internal/never_event_storage_validator.h.missing-header-files chromium-122.0.6261.29/components/feature_engagement/internal/never_event_storage_validator.h
--- chromium-122.0.6261.29/components/feature_engagement/internal/never_event_storage_validator.h.missing-header-files 2024-02-07 19:49:30.000000000 +0100
+++ chromium-122.0.6261.29/components/feature_engagement/internal/never_event_storage_validator.h 2024-02-12 14:59:48.138415097 +0100
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_NEVER_EVENT_STORAGE_VALIDATOR_H_
#define COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_NEVER_EVENT_STORAGE_VALIDATOR_H_
+#include <cstdint>
#include <string>
#include "components/feature_engagement/internal/event_storage_validator.h"
diff -up chromium-122.0.6261.29/gin/time_clamper.h.missing-header-files chromium-122.0.6261.29/gin/time_clamper.h
--- chromium-122.0.6261.29/gin/time_clamper.h.missing-header-files 2024-02-07 19:49:35.000000000 +0100
+++ chromium-122.0.6261.29/gin/time_clamper.h 2024-02-12 14:59:48.138415097 +0100
@@ -48,7 +48,7 @@ class GIN_EXPORT TimeClamper {
const int64_t micros = now_micros % 1000;
// abs() is necessary for devices with times before unix-epoch (most likely
// configured incorrectly).
- if (abs(micros) + kResolutionMicros < 1000) {
+ if (std::abs(micros) + kResolutionMicros < 1000) {
return now_micros / 1000;
}
return ClampTimeResolution(now_micros) / 1000;
diff -up chromium-122.0.6261.29/net/base/net_export.h.missing-header-files chromium-122.0.6261.29/net/base/net_export.h
--- chromium-122.0.6261.29/net/base/net_export.h.missing-header-files 2024-02-07 19:49:38.000000000 +0100
+++ chromium-122.0.6261.29/net/base/net_export.h 2024-02-12 14:59:48.139415116 +0100
@@ -5,6 +5,8 @@
#ifndef NET_BASE_NET_EXPORT_H_
#define NET_BASE_NET_EXPORT_H_
+#include <cstdint>
+
// Defines NET_EXPORT so that functionality implemented by the net module can
// be exported to consumers, and NET_EXPORT_PRIVATE that allows unit tests to
// access features not intended to be used directly by real consumers.
diff -up chromium-122.0.6261.29/third_party/abseil-cpp/absl/strings/string_view.h.missing-header-files chromium-122.0.6261.29/third_party/abseil-cpp/absl/strings/string_view.h
--- chromium-122.0.6261.29/third_party/abseil-cpp/absl/strings/string_view.h.missing-header-files 2024-02-07 19:49:40.000000000 +0100
+++ chromium-122.0.6261.29/third_party/abseil-cpp/absl/strings/string_view.h 2024-02-12 14:59:48.142415172 +0100
@@ -27,6 +27,7 @@
#ifndef ABSL_STRINGS_STRING_VIEW_H_
#define ABSL_STRINGS_STRING_VIEW_H_
+#include <cstdint>
#include <algorithm>
#include <cassert>
#include <cstddef>
diff -up chromium-122.0.6261.29/third_party/dawn/src/tint/lang/spirv/reader/ast_parser/namer.h.missing-header-files chromium-122.0.6261.29/third_party/dawn/src/tint/lang/spirv/reader/ast_parser/namer.h
--- chromium-122.0.6261.29/third_party/dawn/src/tint/lang/spirv/reader/ast_parser/namer.h.missing-header-files 2024-02-07 19:50:44.000000000 +0100
+++ chromium-122.0.6261.29/third_party/dawn/src/tint/lang/spirv/reader/ast_parser/namer.h 2024-02-12 14:59:48.142415172 +0100
@@ -28,6 +28,7 @@
#ifndef SRC_TINT_LANG_SPIRV_READER_AST_PARSER_NAMER_H_
#define SRC_TINT_LANG_SPIRV_READER_AST_PARSER_NAMER_H_
+#include <cstdint>
#include <string>
#include <unordered_map>
#include <vector>
diff -up chromium-122.0.6261.29/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc.missing-header-files chromium-122.0.6261.29/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc
--- chromium-122.0.6261.29/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc.missing-header-files 2024-02-07 19:54:45.000000000 +0100
+++ chromium-122.0.6261.29/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc 2024-02-12 14:59:48.143415190 +0100
@@ -45,6 +45,7 @@
#include "llvm/Support/SaveAndRestore.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
+#include <cstdint>
#include <string>
#include <sysexits.h>
#ifdef HAVE_BACKTRACE
diff -up chromium-122.0.6261.29/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h.missing-header-files chromium-122.0.6261.29/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h
--- chromium-122.0.6261.29/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h.missing-header-files 2024-02-07 19:53:17.000000000 +0100
+++ chromium-122.0.6261.29/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h 2024-02-12 14:59:48.143415190 +0100
@@ -31,6 +31,7 @@ limitations under the License.
#ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_SPECTROGRAM_H_
#define TENSORFLOW_LITE_KERNELS_INTERNAL_SPECTROGRAM_H_
+#include <cstdint>
#include <complex>
#include <deque>
#include <vector>
diff -up chromium-122.0.6261.29/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h.missing-header-files chromium-122.0.6261.29/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h
--- chromium-122.0.6261.29/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h.missing-header-files 2024-02-07 19:54:20.000000000 +0100
+++ chromium-122.0.6261.29/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h 2024-02-12 14:59:48.145415228 +0100
@@ -2884,6 +2884,7 @@ static void vma_aligned_free(void* VMA_N
// Define this macro to 1 to enable functions: vmaBuildStatsString, vmaFreeStatsString.
#if VMA_STATS_STRING_ENABLED
+#include <stdio.h>
static inline void VmaUint32ToStr(char* VMA_NOT_NULL outStr, size_t strLen, uint32_t num)
{
snprintf(outStr, strLen, "%u", static_cast<unsigned int>(num));
diff -up chromium-122.0.6261.29/third_party/webrtc/audio/utility/channel_mixer.cc.missing-header-files chromium-122.0.6261.29/third_party/webrtc/audio/utility/channel_mixer.cc
--- chromium-122.0.6261.29/third_party/webrtc/audio/utility/channel_mixer.cc.missing-header-files 2024-02-07 19:53:17.000000000 +0100
+++ chromium-122.0.6261.29/third_party/webrtc/audio/utility/channel_mixer.cc 2024-02-12 14:59:48.145415228 +0100
@@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <cstring>
+
#include "audio/utility/channel_mixer.h"
#include "audio/utility/channel_mixing_matrix.h"
diff -up chromium-122.0.6261.29/third_party/webrtc/modules/include/module_common_types_public.h.missing-header-files chromium-122.0.6261.29/third_party/webrtc/modules/include/module_common_types_public.h
--- chromium-122.0.6261.29/third_party/webrtc/modules/include/module_common_types_public.h.missing-header-files 2024-02-07 19:53:17.000000000 +0100
+++ chromium-122.0.6261.29/third_party/webrtc/modules/include/module_common_types_public.h 2024-02-12 14:59:48.145415228 +0100
@@ -11,6 +11,7 @@
#ifndef MODULES_INCLUDE_MODULE_COMMON_TYPES_PUBLIC_H_
#define MODULES_INCLUDE_MODULE_COMMON_TYPES_PUBLIC_H_
+#include <cstdint>
#include <limits>
#include "absl/types/optional.h"
diff -up chromium-122.0.6261.29/ui/gfx/linux/drm_util_linux.h.missing-header-files chromium-122.0.6261.29/ui/gfx/linux/drm_util_linux.h
--- chromium-122.0.6261.29/ui/gfx/linux/drm_util_linux.h.missing-header-files 2024-02-07 19:50:05.000000000 +0100
+++ chromium-122.0.6261.29/ui/gfx/linux/drm_util_linux.h 2024-02-12 14:59:48.147415265 +0100
@@ -9,6 +9,8 @@
#include "ui/gfx/buffer_types.h"
+#include <cstdint>
+
namespace ui {
int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format);

File diff suppressed because it is too large Load Diff

@ -0,0 +1,27 @@
diff -up chromium-122.0.6261.57/tools/json_to_struct/json_to_struct.py.me chromium-122.0.6261.57/tools/json_to_struct/json_to_struct.py
--- chromium-122.0.6261.57/tools/json_to_struct/json_to_struct.py.me 2024-02-23 12:04:45.451423995 +0100
+++ chromium-122.0.6261.57/tools/json_to_struct/json_to_struct.py 2024-02-23 12:18:04.099824392 +0100
@@ -124,7 +124,8 @@ def _GenerateH(basepath, fileroot, head,
f.write(u'#include <cstddef>\n')
f.write(u'\n')
- if system_headers := schema.get(u'system-headers', []):
+ system_headers = schema.get(u'system-headers', [])
+ if system_headers:
for header in system_headers:
f.write(u'#include <%s>\n' % header)
f.write(u'\n')
diff -up chromium-123.0.6312.46/tools/metrics/histograms/expand_owners.py.me chromium-123.0.6312.46/tools/metrics/histograms/expand_owners.py
--- chromium-123.0.6312.46/tools/metrics/histograms/expand_owners.py.me 2024-03-18 14:40:57.871904209 +0100
+++ chromium-123.0.6312.46/tools/metrics/histograms/expand_owners.py 2024-03-18 14:47:12.238907146 +0100
@@ -209,8 +209,8 @@ def _ComponentFromDirmd(json_data, subpa
"""
dirmd = json_data.get('dirs', {}).get(subpath, {})
# If a public Buganizer component is listed, return its component ID.
- if buganizer_component := dirmd.get('buganizerPublic',
- {}).get('componentId', ''):
+ buganizer_component = dirmd.get('buganizerPublic',{}).get('componentId', '')
+ if buganizer_component:
return buganizer_component
# If no component exists for the directory, or if METADATA migration is
# incomplete there will be no component information.

@ -0,0 +1,133 @@
diff -Nur chromium-123.0.6312.46/third_party/rust/chromium_crates_io/vendor/clap_lex-0.7.0/src/ext.rs.me chromium-123.0.6312.46/third_party/rust/chromium_crates_io/vendor/clap_lex-0.7.0/src/ext.rs
--- chromium-123.0.6312.46/third_party/rust/chromium_crates_io/vendor/clap_lex-0.7.0/src/ext.rs.me 2024-03-13 20:36:17.000000000 +0100
+++ chromium-123.0.6312.46/third_party/rust/chromium_crates_io/vendor/clap_lex-0.7.0/src/ext.rs 2024-03-13 00:38:18.000000000 +0100
@@ -2,9 +2,6 @@
pub trait OsStrExt: private::Sealed {
/// Converts to a string slice.
- ///
- /// The Utf8Error is guaranteed to have a valid UTF8 boundary
- /// in its `valid_up_to()`
fn try_str(&self) -> Result<&str, std::str::Utf8Error>;
/// Returns `true` if the given pattern matches a sub-slice of
/// this string slice.
@@ -183,7 +180,7 @@
impl OsStrExt for OsStr {
fn try_str(&self) -> Result<&str, std::str::Utf8Error> {
- let bytes = self.as_encoded_bytes();
+ let bytes = to_bytes(self);
std::str::from_utf8(bytes)
}
@@ -192,22 +189,22 @@
}
fn find(&self, needle: &str) -> Option<usize> {
- let bytes = self.as_encoded_bytes();
+ let bytes = to_bytes(self);
(0..=self.len().checked_sub(needle.len())?)
.find(|&x| bytes[x..].starts_with(needle.as_bytes()))
}
fn strip_prefix(&self, prefix: &str) -> Option<&OsStr> {
- let bytes = self.as_encoded_bytes();
+ let bytes = to_bytes(self);
bytes.strip_prefix(prefix.as_bytes()).map(|s| {
// SAFETY:
- // - This came from `as_encoded_bytes`
- // - Since `prefix` is `&str`, any split will be along UTF-8 boundary
- unsafe { OsStr::from_encoded_bytes_unchecked(s) }
+ // - This came from `to_bytes`
+ // - Since `prefix` is `&str`, any split will be along UTF-8 boundarie
+ unsafe { to_os_str_unchecked(s) }
})
}
fn starts_with(&self, prefix: &str) -> bool {
- let bytes = self.as_encoded_bytes();
+ let bytes = to_bytes(self);
bytes.starts_with(prefix.as_bytes())
}
@@ -222,18 +219,13 @@
fn split_once(&self, needle: &'_ str) -> Option<(&OsStr, &OsStr)> {
let start = self.find(needle)?;
let end = start + needle.len();
- let haystack = self.as_encoded_bytes();
+ let haystack = to_bytes(self);
let first = &haystack[0..start];
let second = &haystack[end..];
// SAFETY:
- // - This came from `as_encoded_bytes`
- // - Since `needle` is `&str`, any split will be along UTF-8 boundary
- unsafe {
- Some((
- OsStr::from_encoded_bytes_unchecked(first),
- OsStr::from_encoded_bytes_unchecked(second),
- ))
- }
+ // - This came from `to_bytes`
+ // - Since `needle` is `&str`, any split will be along UTF-8 boundarie
+ unsafe { Some((to_os_str_unchecked(first), to_os_str_unchecked(second))) }
}
}
@@ -243,6 +235,45 @@
impl Sealed for std::ffi::OsStr {}
}
+/// Allow access to raw bytes
+///
+/// As the non-UTF8 encoding is not defined, the bytes only make sense when compared with
+/// 7-bit ASCII or `&str`
+///
+/// # Compatibility
+///
+/// There is no guarantee how non-UTF8 bytes will be encoded, even within versions of this crate
+/// (since its dependent on rustc)
+fn to_bytes(s: &OsStr) -> &[u8] {
+ // SAFETY:
+ // - Lifetimes are the same
+ // - Types are compatible (`OsStr` is effectively a transparent wrapper for `[u8]`)
+ // - The primary contract is that the encoding for invalid surrogate code points is not
+ // guaranteed which isn't a problem here
+ //
+ // There is a proposal to support this natively (https://github.com/rust-lang/rust/pull/95290)
+ // but its in limbo
+ unsafe { std::mem::transmute(s) }
+}
+
+/// Restore raw bytes as `OsStr`
+///
+/// # Safety
+///
+/// - `&[u8]` must either by a `&str` or originated with `to_bytes` within the same binary
+/// - Any splits of the original `&[u8]` must be done along UTF-8 boundaries
+unsafe fn to_os_str_unchecked(s: &[u8]) -> &OsStr {
+ // SAFETY:
+ // - Lifetimes are the same
+ // - Types are compatible (`OsStr` is effectively a transparent wrapper for `[u8]`)
+ // - The primary contract is that the encoding for invalid surrogate code points is not
+ // guaranteed which isn't a problem here
+ //
+ // There is a proposal to support this natively (https://github.com/rust-lang/rust/pull/95290)
+ // but its in limbo
+ std::mem::transmute(s)
+}
+
pub struct Split<'s, 'n> {
haystack: Option<&'s OsStr>,
needle: &'n str,
@@ -275,10 +306,7 @@
///
/// `index` must be at a valid UTF-8 boundary
pub(crate) unsafe fn split_at(os: &OsStr, index: usize) -> (&OsStr, &OsStr) {
- let bytes = os.as_encoded_bytes();
+ let bytes = to_bytes(os);
let (first, second) = bytes.split_at(index);
- (
- OsStr::from_encoded_bytes_unchecked(first),
- OsStr::from_encoded_bytes_unchecked(second),
- )
+ (to_os_str_unchecked(first), to_os_str_unchecked(second))
}

@ -0,0 +1,406 @@
fixed error: missing 'typename' prior to dependent type name
diff -up chromium-122.0.6261.69/base/containers/map_util.h.typename chromium-122.0.6261.69/base/containers/map_util.h
--- chromium-122.0.6261.69/base/containers/map_util.h.typename 2024-02-22 22:42:43.000000000 +0100
+++ chromium-122.0.6261.69/base/containers/map_util.h 2024-02-24 15:05:00.882592705 +0100
@@ -42,7 +42,7 @@ constexpr internal::MappedType<Map>* Fin
template <typename Map,
typename Key,
typename MappedElementType =
- std::pointer_traits<internal::MappedType<Map>>::element_type>
+ typename std::pointer_traits<internal::MappedType<Map>>::element_type>
constexpr const MappedElementType* FindPtrOrNull(const Map& map,
const Key& key) {
auto it = map.find(key);
@@ -58,7 +58,7 @@ constexpr const MappedElementType* FindP
template <typename Map,
typename Key,
typename MappedElementType =
- std::pointer_traits<internal::MappedType<Map>>::element_type>
+ typename std::pointer_traits<internal::MappedType<Map>>::element_type>
constexpr MappedElementType* FindPtrOrNull(Map& map, const Key& key) {
auto it = map.find(key);
return it != map.end() ? std::to_address(it->second) : nullptr;
diff -up chromium-122.0.6261.69/base/functional/bind_internal.h.typename chromium-122.0.6261.69/base/functional/bind_internal.h
--- chromium-122.0.6261.69/base/functional/bind_internal.h.typename 2024-02-24 15:05:00.883592724 +0100
+++ chromium-122.0.6261.69/base/functional/bind_internal.h 2024-02-24 15:13:49.755223533 +0100
@@ -1400,11 +1400,11 @@ template <int i,
typename Param>
struct ParamCanBeBound {
private:
- using UnwrappedParam = BindArgument<i>::template ForwardedAs<
+ using UnwrappedParam = typename BindArgument<i>::template ForwardedAs<
Unwrapped>::template ToParamWithType<Param>;
- using ParamStorage = BindArgument<i>::template ToParamWithType<
+ using ParamStorage = typename BindArgument<i>::template ToParamWithType<
Param>::template StoredAs<Storage>;
- using BoundStorage =
+ using BoundStorage = typename
BindArgument<i>::template BoundAs<Arg>::template StoredAs<Storage>;
template <bool v = !UnwrappedParam::kRawPtr ||
diff -up chromium-122.0.6261.69/chrome/browser/download/bubble/download_bubble_update_service.cc.typename chromium-122.0.6261.69/chrome/browser/download/bubble/download_bubble_update_service.cc
--- chromium-122.0.6261.69/chrome/browser/download/bubble/download_bubble_update_service.cc.typename 2024-02-22 22:42:50.000000000 +0100
+++ chromium-122.0.6261.69/chrome/browser/download/bubble/download_bubble_update_service.cc 2024-02-24 15:05:00.882592705 +0100
@@ -90,7 +90,7 @@ ItemSortKey GetSortKey(const Item& item)
// Helper to get an iterator to the last element in the cache. The cache
// must not be empty.
template <typename Item>
-SortedItems<Item>::const_iterator GetLastIter(const SortedItems<Item>& cache) {
+typename SortedItems<Item>::const_iterator GetLastIter(const SortedItems<Item>& cache) {
CHECK(!cache.empty());
auto it = cache.end();
return std::prev(it);
@@ -1090,9 +1090,9 @@ bool DownloadBubbleUpdateService::CacheM
}
template <typename Id, typename Item>
-SortedItems<Item>::iterator
+typename SortedItems<Item>::iterator
DownloadBubbleUpdateService::CacheManager::RemoveItemFromCacheByIter(
- SortedItems<Item>::iterator iter,
+ typename SortedItems<Item>::iterator iter,
SortedItems<Item>& cache,
IterMap<Id, Item>& iter_map) {
CHECK(iter != cache.end());
diff -up chromium-122.0.6261.69/components/optimization_guide/core/model_execution/model_execution_util.h.typename chromium-122.0.6261.69/components/optimization_guide/core/model_execution/model_execution_util.h
--- chromium-122.0.6261.69/components/optimization_guide/core/model_execution/model_execution_util.h.typename 2024-02-22 22:43:01.000000000 +0100
+++ chromium-122.0.6261.69/components/optimization_guide/core/model_execution/model_execution_util.h 2024-02-24 15:05:00.884592742 +0100
@@ -25,7 +25,7 @@ void SetExecutionRequestTemplate(
// Request is set by the feature and should always be typed.
auto typed_request =
- static_cast<const FeatureType::Request&>(request_metadata);
+ static_cast<const typename FeatureType::Request&>(request_metadata);
*(logging_data->mutable_request_data()) = typed_request;
}
diff -up chromium-122.0.6261.69/components/optimization_guide/core/model_quality/model_quality_log_entry.h.typename chromium-122.0.6261.69/components/optimization_guide/core/model_quality/model_quality_log_entry.h
--- chromium-122.0.6261.69/components/optimization_guide/core/model_quality/model_quality_log_entry.h.typename 2024-02-22 22:43:01.000000000 +0100
+++ chromium-122.0.6261.69/components/optimization_guide/core/model_quality/model_quality_log_entry.h 2024-02-24 15:05:00.884592742 +0100
@@ -29,7 +29,7 @@ class ModelQualityLogEntry {
}
template <typename FeatureType>
- FeatureType::Quality* quality_data() {
+ typename FeatureType::Quality* quality_data() {
return FeatureType::GetLoggingData(*log_ai_data_request_)
->mutable_quality_data();
}
diff -up chromium-122.0.6261.69/mojo/public/cpp/bindings/array_traits.h.typename chromium-122.0.6261.69/mojo/public/cpp/bindings/array_traits.h
--- chromium-122.0.6261.69/mojo/public/cpp/bindings/array_traits.h.typename 2024-02-22 22:43:15.000000000 +0100
+++ chromium-122.0.6261.69/mojo/public/cpp/bindings/array_traits.h 2024-02-24 15:05:00.884592742 +0100
@@ -90,7 +90,7 @@ template <typename Container>
{ c[i] } -> std::same_as<typename Container::reference>;
}
struct ArrayTraits<Container> {
- using Element = Container::value_type;
+ using Element = typename Container::value_type;
// vector-like containers have no built-in null.
static bool IsNull(const Container& c) { return false; }
diff -up chromium-122.0.6261.69/third_party/blink/renderer/bindings/core/v8/async_iterable.h.typename chromium-122.0.6261.69/third_party/blink/renderer/bindings/core/v8/async_iterable.h
--- chromium-122.0.6261.69/third_party/blink/renderer/bindings/core/v8/async_iterable.h.typename 2024-02-22 22:43:20.000000000 +0100
+++ chromium-122.0.6261.69/third_party/blink/renderer/bindings/core/v8/async_iterable.h 2024-02-24 15:05:00.883592724 +0100
@@ -218,7 +218,7 @@ class PairAsyncIterable {
private:
virtual IterationSource* CreateIterationSource(
ScriptState* script_state,
- IterationSource::Kind kind,
+ typename IterationSource::Kind kind,
ExceptionState& exception_state) = 0;
};
@@ -260,7 +260,7 @@ class ValueAsyncIterable {
private:
virtual IterationSource* CreateIterationSource(
ScriptState* script_state,
- IterationSource::Kind kind,
+ typename IterationSource::Kind kind,
ExceptionState& exception_state) = 0;
};
diff -up chromium-122.0.6261.69/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc.typename chromium-122.0.6261.69/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc
--- chromium-122.0.6261.69/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc.typename 2024-02-24 15:05:00.882592705 +0100
+++ chromium-122.0.6261.69/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc 2024-02-24 15:12:27.742724849 +0100
@@ -211,7 +211,7 @@ class HTMLFastPathParser {
using Span = base::span<const Char>;
using USpan = base::span<const UChar>;
// 32 matches that used by HTMLToken::Attribute.
- typedef std::conditional<std::is_same_v<Char, UChar>,
+ typedef typename std::conditional<std::is_same_v<Char, UChar>,
UCharLiteralBuffer<32>,
LCharLiteralBuffer<32>>::type LiteralBufferType;
static_assert(std::is_same_v<Char, UChar> || std::is_same_v<Char, LChar>);
diff -up chromium-122.0.6261.69/third_party/blink/renderer/core/paint/object_paint_properties_sparse.h.typename chromium-122.0.6261.69/third_party/blink/renderer/core/paint/object_paint_properties_sparse.h
--- chromium-122.0.6261.69/third_party/blink/renderer/core/paint/object_paint_properties_sparse.h.typename 2024-02-22 22:43:21.000000000 +0100
+++ chromium-122.0.6261.69/third_party/blink/renderer/core/paint/object_paint_properties_sparse.h 2024-02-24 15:05:00.883592724 +0100
@@ -272,8 +272,8 @@ class CORE_EXPORT ObjectPaintPropertiesS
NodeList& nodes,
NodeId node_id,
const ParentType& parent,
- NodeType::State&& state,
- const NodeType::AnimationState& animation_state =
+ typename NodeType::State&& state,
+ const typename NodeType::AnimationState& animation_state =
NodeType::AnimationState()) {
// First, check if we need to add a new node.
if (!nodes.HasField(node_id)) {
diff -up chromium-122.0.6261.69/base/allocator/partition_allocator/src/partition_alloc/internal_allocator.h.me chromium-122.0.6261.69/base/allocator/partition_allocator/src/partition_alloc/internal_allocator.h
--- chromium-122.0.6261.69/base/allocator/partition_allocator/src/partition_alloc/internal_allocator.h.me 2024-02-24 16:51:41.292310554 +0100
+++ chromium-122.0.6261.69/base/allocator/partition_allocator/src/partition_alloc/internal_allocator.h 2024-02-24 16:52:10.022896063 +0100
@@ -26,7 +26,7 @@ PartitionRoot& InternalAllocatorRoot();
// A class that meets C++ named requirements, Allocator.
template <typename T>
-InternalAllocator<T>::value_type* InternalAllocator<T>::allocate(
+typename InternalAllocator<T>::value_type* InternalAllocator<T>::allocate(
std::size_t count) {
PA_CHECK(count <=
std::numeric_limits<std::size_t>::max() / sizeof(value_type));
diff -up chromium-122.0.6261.69/base/containers/heap_array.h.me chromium-122.0.6261.69/base/containers/heap_array.h
--- chromium-122.0.6261.69/base/containers/heap_array.h.me 2024-02-24 18:02:34.463921568 +0100
+++ chromium-122.0.6261.69/base/containers/heap_array.h 2024-02-24 18:04:01.922850571 +0100
@@ -32,8 +32,8 @@ class TRIVIAL_ABI GSL_OWNER HeapArray {
static_assert(!std::is_reference_v<T>,
"HeapArray cannot hold reference types");
- using iterator = base::span<T>::iterator;
- using const_iterator = base::span<const T>::iterator;
+ using iterator = typename base::span<T>::iterator;
+ using const_iterator = typename base::span<const T>::iterator;
// Allocates initialized memory capable of holding `size` elements. No memory
// is allocated for zero-sized arrays.
diff -up chromium-122.0.6261.69/mojo/public/cpp/bindings/type_converter.h.me chromium-122.0.6261.69/mojo/public/cpp/bindings/type_converter.h
--- chromium-122.0.6261.69/mojo/public/cpp/bindings/type_converter.h.me 2024-02-24 18:51:06.957087464 +0100
+++ chromium-122.0.6261.69/mojo/public/cpp/bindings/type_converter.h 2024-02-24 18:51:27.778488490 +0100
@@ -125,7 +125,7 @@ using VecValueType = typename Vec::value
template <typename Vec>
using VecPtrLikeUnderlyingValueType =
- std::pointer_traits<VecValueType<Vec>>::element_type;
+ typename std::pointer_traits<VecValueType<Vec>>::element_type;
} // namespace internal
diff -up chromium-122.0.6261.69/third_party/blink/renderer/platform/wtf/hash_table.h.me chromium-122.0.6261.69/third_party/blink/renderer/platform/wtf/hash_table.h
--- chromium-122.0.6261.69/third_party/blink/renderer/platform/wtf/hash_table.h.me 2024-02-24 19:45:13.620934215 +0100
+++ chromium-122.0.6261.69/third_party/blink/renderer/platform/wtf/hash_table.h 2024-02-24 19:46:08.817940962 +0100
@@ -2005,7 +2005,7 @@ struct HashTableConstIteratorAdapter {
static_assert(!IsTraceable<typename Traits::TraitType>::value);
using iterator_category = std::bidirectional_iterator_tag;
- using value_type = HashTableType::ValueType;
+ using value_type = typename HashTableType::ValueType;
using difference_type = ptrdiff_t;
using pointer = value_type*;
using reference = value_type&;
@@ -2057,7 +2057,7 @@ struct HashTableConstIteratorAdapter<
public:
using iterator_category = std::bidirectional_iterator_tag;
- using value_type = HashTableType::ValueType;
+ using value_type = typename HashTableType::ValueType;
using difference_type = ptrdiff_t;
using pointer = value_type*;
using reference = value_type&;
@@ -2111,7 +2111,7 @@ struct HashTableIteratorAdapter {
static_assert(!IsTraceable<typename Traits::TraitType>::value);
using iterator_category = std::bidirectional_iterator_tag;
- using value_type = HashTableType::ValueType;
+ using value_type = typename HashTableType::ValueType;
using difference_type = ptrdiff_t;
using pointer = value_type*;
using reference = value_type&;
@@ -2159,7 +2159,7 @@ struct HashTableIteratorAdapter<
public:
using iterator_category = std::bidirectional_iterator_tag;
- using value_type = HashTableType::ValueType;
+ using value_type = typename HashTableType::ValueType;
using difference_type = ptrdiff_t;
using pointer = value_type*;
using reference = value_type&;
diff -up chromium-122.0.6261.69/base/types/fixed_array.h.me chromium-122.0.6261.69/base/types/fixed_array.h
--- chromium-122.0.6261.69/base/types/fixed_array.h.me 2024-02-25 11:22:59.819590529 +0100
+++ chromium-122.0.6261.69/base/types/fixed_array.h 2024-02-25 11:24:12.424953031 +0100
@@ -27,8 +27,8 @@ template <typename T,
class FixedArray : public absl::FixedArray<T, N, A> {
public:
using absl::FixedArray<T, N, A>::FixedArray;
- explicit FixedArray(absl::FixedArray<T, N, A>::size_type n,
- const absl::FixedArray<T, N, A>::allocator_type& a =
+ explicit FixedArray(typename absl::FixedArray<T, N, A>::size_type n,
+ const typename absl::FixedArray<T, N, A>::allocator_type& a =
typename absl::FixedArray<T, N, A>::allocator_type())
: FixedArray(n, T(), a) {}
};
diff -up chromium-122.0.6261.69/chrome/browser/web_applications/commands/internal/command_internal.h.me chromium-122.0.6261.69/chrome/browser/web_applications/commands/internal/command_internal.h
--- chromium-122.0.6261.69/chrome/browser/web_applications/commands/internal/command_internal.h.me 2024-02-25 15:04:56.775897713 +0100
+++ chromium-122.0.6261.69/chrome/browser/web_applications/commands/internal/command_internal.h 2024-02-25 15:05:34.884579279 +0100
@@ -121,7 +121,7 @@ class CommandBase {
template <typename LockType>
class CommandWithLock : public CommandBase {
public:
- using LockDescription = LockType::LockDescription;
+ using LockDescription = typename LockType::LockDescription;
explicit CommandWithLock(const std::string& name,
LockDescription initial_lock_request);
diff -up chromium-122.0.6261.69/chrome/browser/web_applications/commands/web_app_command.h.me chromium-122.0.6261.69/chrome/browser/web_applications/commands/web_app_command.h
--- chromium-122.0.6261.69/chrome/browser/web_applications/commands/web_app_command.h.me 2024-02-25 15:05:46.885793828 +0100
+++ chromium-122.0.6261.69/chrome/browser/web_applications/commands/web_app_command.h 2024-02-25 15:06:12.334248725 +0100
@@ -106,7 +106,7 @@ class WebAppLockManager;
template <typename LockType, typename... CallbackArgs>
class WebAppCommand : public internal::CommandWithLock<LockType> {
public:
- using LockDescription = LockType::LockDescription;
+ using LockDescription = typename LockType::LockDescription;
using CallbackType = base::OnceCallback<void(CallbackArgs...)>;
using ShutdownArgumentsTuple = std::tuple<std::decay_t<CallbackArgs>...>;
diff -up chromium-122.0.6261.69/chrome/browser/web_applications/web_app_command_scheduler.h.me chromium-122.0.6261.69/chrome/browser/web_applications/web_app_command_scheduler.h
--- chromium-122.0.6261.69/chrome/browser/web_applications/web_app_command_scheduler.h.me 2024-02-25 15:06:17.896348149 +0100
+++ chromium-122.0.6261.69/chrome/browser/web_applications/web_app_command_scheduler.h 2024-02-25 15:06:58.841076746 +0100
@@ -355,7 +355,7 @@ class WebAppCommandScheduler {
// command system.
template <typename LockType>
void ScheduleCallback(const std::string& operation_name,
- LockType::LockDescription lock_description,
+ typename LockType::LockDescription lock_description,
CallbackCommand<LockType, void> callback,
base::OnceClosure on_complete,
const base::Location& location = FROM_HERE) {
@@ -373,7 +373,7 @@ class WebAppCommandScheduler {
typename CallbackReturnValue = std::decay_t<CompletionCallbackArg>>
void ScheduleCallbackWithResult(
const std::string& operation_name,
- LockType::LockDescription lock_description,
+ typename LockType::LockDescription lock_description,
CallbackCommand<LockType, CallbackReturnValue> callback,
base::OnceCallback<void(CompletionCallbackArg)> on_complete,
CallbackReturnValue arg_for_shutdown,
diff -up chromium-122.0.6261.69/components/supervised_user/core/browser/proto_fetcher.h.me chromium-122.0.6261.69/components/supervised_user/core/browser/proto_fetcher.h
--- chromium-122.0.6261.69/components/supervised_user/core/browser/proto_fetcher.h.me 2024-02-25 15:12:53.835409392 +0100
+++ chromium-122.0.6261.69/components/supervised_user/core/browser/proto_fetcher.h 2024-02-25 15:16:03.171931033 +0100
@@ -424,7 +424,7 @@ class RetryingFetcherImpl final : public
RetryingFetcherImpl(const RetryingFetcherImpl&) = delete;
RetryingFetcherImpl& operator=(const RetryingFetcherImpl&) = delete;
- void Start(ProtoFetcher<Response>::Callback callback) override {
+ void Start(typename ProtoFetcher<Response>::Callback callback) override {
callback_ = std::move(callback);
Retry();
}
@@ -469,7 +469,7 @@ class RetryingFetcherImpl final : public
}
// Client callback.
- TypedProtoFetcher<Response>::Callback callback_;
+ typename TypedProtoFetcher<Response>::Callback callback_;
// Retry controls.
base::OneShotTimer timer_;
@@ -490,7 +490,7 @@ class ParallelFetchManager {
// Deferred fetcher is required because it should be started after it is
// stored internally.
using Fetcher = ProtoFetcher<Response>;
- using KeyType = base::IDMap<std::unique_ptr<Fetcher>>::KeyType;
+ using KeyType = typename base::IDMap<std::unique_ptr<Fetcher>>::KeyType;
public:
// Provides fresh instances of a deferred fetcher for each fetch.
@@ -506,7 +506,7 @@ class ParallelFetchManager {
// Starts the fetch. Underlying fetcher is stored internally, and will be
// cleaned up after finish or when this manager is destroyed.
- void Fetch(const Request& request, Fetcher::Callback callback) {
+ void Fetch(const Request& request, typename Fetcher::Callback callback) {
CHECK(callback) << "Use base::DoNothing() instead of empty callback.";
KeyType key = requests_in_flight_.Add(MakeFetcher(request));
requests_in_flight_.Lookup(key)->Start(
--- chromium-123.0.6312.46/components/optimization_guide/core/tflite_model_executor.h.orig 2024-03-13 20:35:44.000000000 +0100
+++ chromium-123.0.6312.46/components/optimization_guide/core/tflite_model_executor.h 2024-03-15 15:45:47.067156826 +0100
@@ -242,7 +242,7 @@
void SendForBatchExecution(
BatchExecutionCallback callback_on_complete,
base::TimeTicks start_time,
- ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs)
+ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs)
override {
DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -264,7 +264,7 @@
// Starts the synchronous execution of the model. Returns model outputs.
// Model needs to be loaded. Synchronous calls do not load or unload model.
std::vector<std::optional<OutputType>> SendForBatchExecutionSync(
- ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs)
+ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs)
override {
DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -422,7 +422,7 @@
// executes it on the model execution thread.
void LoadModelFileAndBatchExecute(
BatchExecutionCallback callback_on_complete,
- ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs) {
+ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs) {
DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -439,7 +439,7 @@
// Batch executes the loaded model for inputs.
void BatchExecuteLoadedModel(
- ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs,
+ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs,
std::vector<std::optional<OutputType>>* outputs) {
DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -499,7 +499,7 @@
// Unloads the model if needed.
void BatchExecuteLoadedModelAndRunCallback(
BatchExecutionCallback callback_on_complete,
- ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs,
+ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs,
ExecutionStatus execution_status) {
DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
--- chromium-123.0.6312.46/base/functional/function_ref.h.orig 2024-03-15 15:43:32.329786974 +0100
+++ chromium-123.0.6312.46/base/functional/function_ref.h 2024-03-15 15:46:57.278813500 +0100
@@ -64,7 +64,7 @@
template <typename R, typename... Args>
class FunctionRef<R(Args...)> {
template <typename Functor,
- typename RunType = internal::FunctorTraits<Functor>::RunType>
+ typename RunType = typename internal::FunctorTraits<Functor>::RunType>
static constexpr bool kCompatibleFunctor =
std::convertible_to<internal::ExtractReturnType<RunType>, R> &&
std::same_as<internal::ExtractArgs<RunType>, internal::TypeList<Args...>>;
diff -up chromium-123.0.6312.46/third_party/blink/renderer/bindings/core/v8/script_promise_property.h.me chromium-123.0.6312.46/third_party/blink/renderer/bindings/core/v8/script_promise_property.h
--- chromium-123.0.6312.46/third_party/blink/renderer/bindings/core/v8/script_promise_property.h.me 2024-03-16 22:55:01.387265478 +0100
+++ chromium-123.0.6312.46/third_party/blink/renderer/bindings/core/v8/script_promise_property.h 2024-03-16 22:55:18.752568310 +0100
@@ -173,7 +173,7 @@ class ScriptPromiseProperty final
template <typename T>
requires std::derived_from<T, bindings::EnumerationBase>
static T DefaultPromiseResultValue() {
- return T(static_cast<T::Enum>(0));
+ return T(static_cast<typename T::Enum>(0));
}
State state_ = kPending;
diff -up chromium-123.0.6312.46/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h.me chromium-123.0.6312.46/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h
--- chromium-123.0.6312.46/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h.me 2024-03-16 22:41:50.634510019 +0100
+++ chromium-123.0.6312.46/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h 2024-03-16 22:54:51.215088087 +0100
@@ -477,7 +477,7 @@ class ScriptPromiseResolverTyped : publi
private:
using TypedResolver =
- ScriptPromiseTyped<IDLResolvedType>::InternalResolverTyped;
+ typename ScriptPromiseTyped<IDLResolvedType>::InternalResolverTyped;
};
} // namespace blink

@ -0,0 +1,733 @@
commit 940af9f2c87b436559b97c53763aa9eaaf1254eb
Author: Jeremy Roman <jbroman@chromium.org>
Date: Wed Nov 15 16:24:54 2023 +0000
Use C++20 features to simplify blink::NativeValueTraitsBase.
These allow some of the metaprogramming bits to be simplified a little.
Change-Id: I052b4397586d21348401616e1792afdb9662f975
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5030335
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1224978}
diff --git a/third_party/blink/renderer/bindings/core/v8/native_value_traits.h b/third_party/blink/renderer/bindings/core/v8/native_value_traits.h
index 7fc91d14acc71..1e5a0790df6da 100644
--- a/third_party/blink/renderer/bindings/core/v8/native_value_traits.h
+++ b/third_party/blink/renderer/bindings/core/v8/native_value_traits.h
@@ -5,6 +5,7 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_NATIVE_VALUE_TRAITS_H_
#define THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_NATIVE_VALUE_TRAITS_H_
+#include <concepts>
#include <type_traits>
#include "third_party/blink/renderer/bindings/core/v8/idl_types_base.h"
@@ -30,7 +31,7 @@ class ExceptionState;
// return toInt32(isolate, value, exceptionState, NormalConversion);
// }
// }
-template <typename T, typename SFINAEHelper = void>
+template <typename T>
struct NativeValueTraits;
// This declaration serves only as a blueprint for specializations: the
@@ -45,22 +46,15 @@ struct NativeValueTraits;
namespace bindings {
-template <typename T, typename = void>
-struct NativeValueTraitsHasIsNull : std::false_type {};
-
template <typename T>
-struct NativeValueTraitsHasIsNull<
- T,
- std::void_t<decltype(std::declval<T>().IsNull())>> : std::true_type {};
+struct ImplTypeFor {
+ using type = T;
+};
template <typename T>
-struct NativeValueTraitsHasNullValue {
- // true if |T| supports IDL null value.
- static constexpr bool value =
- // ScriptValue, String, and union types have IsNull member function.
- bindings::NativeValueTraitsHasIsNull<T>::value ||
- // Pointer types have nullptr as IDL null value.
- std::is_pointer<T>::value;
+ requires std::derived_from<T, IDLBase>
+struct ImplTypeFor<T> {
+ using type = typename T::ImplType;
};
} // namespace bindings
@@ -78,37 +72,17 @@ struct NativeValueTraitsHasNullValue {
// If present, |NullValue()| will be used when converting from the nullable type
// T?, and should be used if the impl type has an existing "null" state. If not
// present, WTF::Optional will be used to wrap the type.
-template <typename T, typename SFINAEHelper = void>
-struct NativeValueTraitsBase {
- STATIC_ONLY(NativeValueTraitsBase);
-
- using ImplType = T;
-
- static constexpr bool has_null_value =
- bindings::NativeValueTraitsHasNullValue<ImplType>::value;
-
- template <typename... ExtraArgs>
- static decltype(auto) ArgumentValue(v8::Isolate* isolate,
- int argument_index,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state,
- ExtraArgs... extra_args) {
- return NativeValueTraits<std::remove_pointer_t<T>>::NativeValue(
- isolate, value, exception_state,
- std::forward<ExtraArgs>(extra_args)...);
- }
-};
-
template <typename T>
-struct NativeValueTraitsBase<
- T,
- std::enable_if_t<std::is_base_of<IDLBase, T>::value>> {
+struct NativeValueTraitsBase {
STATIC_ONLY(NativeValueTraitsBase);
- using ImplType = typename T::ImplType;
+ using ImplType = bindings::ImplTypeFor<T>::type;
+ // Pointer types have nullptr as IDL null value.
+ // ScriptValue, String, and union types have IsNull member function.
static constexpr bool has_null_value =
- bindings::NativeValueTraitsHasNullValue<ImplType>::value;
+ std::is_pointer_v<ImplType> ||
+ requires(ImplType value) { value.IsNull(); };
template <typename... ExtraArgs>
static decltype(auto) ArgumentValue(v8::Isolate* isolate,
diff --git a/third_party/blink/renderer/bindings/core/v8/native_value_traits_buffer_sources.cc b/third_party/blink/renderer/bindings/core/v8/native_value_traits_buffer_sources.cc
index 508ea6d8eea48..18de71d84023f 100644
--- a/third_party/blink/renderer/bindings/core/v8/native_value_traits_buffer_sources.cc
+++ b/third_party/blink/renderer/bindings/core/v8/native_value_traits_buffer_sources.cc
@@ -7,6 +7,7 @@
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
+#include "third_party/blink/renderer/core/typed_arrays/flexible_array_buffer_view.h"
#include "third_party/blink/renderer/core/typed_arrays/typed_flexible_array_buffer_view.h"
namespace blink {
@@ -698,12 +699,11 @@ DOMArrayBufferBase* NativeValueTraits<
// ArrayBufferView
template <typename T>
-NotShared<T> NativeValueTraits<
- NotShared<T>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>::
- NativeValue(v8::Isolate* isolate,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state) {
+ requires std::derived_from<T, DOMArrayBufferView>
+NotShared<T> NativeValueTraits<NotShared<T>>::NativeValue(
+ v8::Isolate* isolate,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
return NativeValueImpl<
RecipeTrait<NotShared<T>>, ToDOMViewType<T, kNotShared>,
Nullablity::kIsNotNullable, BufferSizeCheck::kCheck,
@@ -712,13 +712,12 @@ NotShared<T> NativeValueTraits<
}
template <typename T>
-NotShared<T> NativeValueTraits<
- NotShared<T>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>::
- ArgumentValue(v8::Isolate* isolate,
- int argument_index,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state) {
+ requires std::derived_from<T, DOMArrayBufferView>
+NotShared<T> NativeValueTraits<NotShared<T>>::ArgumentValue(
+ v8::Isolate* isolate,
+ int argument_index,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
return ArgumentValueImpl<
RecipeTrait<NotShared<T>>, ToDOMViewType<T, kNotShared>,
Nullablity::kIsNotNullable, BufferSizeCheck::kCheck,
@@ -729,12 +728,11 @@ NotShared<T> NativeValueTraits<
// [AllowShared] ArrayBufferView
template <typename T>
-MaybeShared<T> NativeValueTraits<
- MaybeShared<T>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>::
- NativeValue(v8::Isolate* isolate,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state) {
+ requires std::derived_from<T, DOMArrayBufferView>
+MaybeShared<T> NativeValueTraits<MaybeShared<T>>::NativeValue(
+ v8::Isolate* isolate,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
return NativeValueImpl<RecipeTrait<MaybeShared<T>>,
ToDOMViewType<T, kMaybeShared>,
Nullablity::kIsNotNullable, BufferSizeCheck::kCheck,
@@ -743,13 +741,12 @@ MaybeShared<T> NativeValueTraits<
}
template <typename T>
-MaybeShared<T> NativeValueTraits<
- MaybeShared<T>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>::
- ArgumentValue(v8::Isolate* isolate,
- int argument_index,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state) {
+ requires std::derived_from<T, DOMArrayBufferView>
+MaybeShared<T> NativeValueTraits<MaybeShared<T>>::ArgumentValue(
+ v8::Isolate* isolate,
+ int argument_index,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
return ArgumentValueImpl<RecipeTrait<MaybeShared<T>>,
ToDOMViewType<T, kMaybeShared>,
Nullablity::kIsNotNullable, BufferSizeCheck::kCheck,
@@ -760,12 +757,12 @@ MaybeShared<T> NativeValueTraits<
// [AllowShared, BufferSourceTypeNoSizeLimit] ArrayBufferView
template <typename T>
-MaybeShared<T> NativeValueTraits<
- IDLBufferSourceTypeNoSizeLimit<MaybeShared<T>>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>::
- NativeValue(v8::Isolate* isolate,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state) {
+ requires std::derived_from<T, DOMArrayBufferView>
+MaybeShared<T>
+NativeValueTraits<IDLBufferSourceTypeNoSizeLimit<MaybeShared<T>>>::NativeValue(
+ v8::Isolate* isolate,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
return NativeValueImpl<
RecipeTrait<MaybeShared<T>>, ToDOMViewType<T, kMaybeShared>,
Nullablity::kIsNotNullable, BufferSizeCheck::kDoNotCheck,
@@ -774,13 +771,12 @@ MaybeShared<T> NativeValueTraits<
}
template <typename T>
-MaybeShared<T> NativeValueTraits<
- IDLBufferSourceTypeNoSizeLimit<MaybeShared<T>>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>::
- ArgumentValue(v8::Isolate* isolate,
- int argument_index,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state) {
+ requires std::derived_from<T, DOMArrayBufferView>
+MaybeShared<T> NativeValueTraits<IDLBufferSourceTypeNoSizeLimit<
+ MaybeShared<T>>>::ArgumentValue(v8::Isolate* isolate,
+ int argument_index,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
return ArgumentValueImpl<
RecipeTrait<MaybeShared<T>>, ToDOMViewType<T, kMaybeShared>,
Nullablity::kIsNotNullable, BufferSizeCheck::kDoNotCheck,
@@ -791,12 +787,11 @@ MaybeShared<T> NativeValueTraits<
// Nullable ArrayBufferView
template <typename T>
-NotShared<T> NativeValueTraits<
- IDLNullable<NotShared<T>>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>::
- NativeValue(v8::Isolate* isolate,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state) {
+ requires std::derived_from<T, DOMArrayBufferView>
+NotShared<T> NativeValueTraits<IDLNullable<NotShared<T>>>::NativeValue(
+ v8::Isolate* isolate,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
return NativeValueImpl<
RecipeTrait<NotShared<T>>, ToDOMViewType<T, kNotShared>,
Nullablity::kIsNullable, BufferSizeCheck::kCheck,
@@ -805,13 +800,12 @@ NotShared<T> NativeValueTraits<
}
template <typename T>
-NotShared<T> NativeValueTraits<
- IDLNullable<NotShared<T>>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>::
- ArgumentValue(v8::Isolate* isolate,
- int argument_index,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state) {
+ requires std::derived_from<T, DOMArrayBufferView>
+NotShared<T> NativeValueTraits<IDLNullable<NotShared<T>>>::ArgumentValue(
+ v8::Isolate* isolate,
+ int argument_index,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
return ArgumentValueImpl<
RecipeTrait<NotShared<T>>, ToDOMViewType<T, kNotShared>,
Nullablity::kIsNullable, BufferSizeCheck::kCheck,
@@ -822,12 +816,11 @@ NotShared<T> NativeValueTraits<
// Nullable [AllowShared] ArrayBufferView
template <typename T>
-MaybeShared<T> NativeValueTraits<
- IDLNullable<MaybeShared<T>>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>::
- NativeValue(v8::Isolate* isolate,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state) {
+ requires std::derived_from<T, DOMArrayBufferView>
+MaybeShared<T> NativeValueTraits<IDLNullable<MaybeShared<T>>>::NativeValue(
+ v8::Isolate* isolate,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
return NativeValueImpl<RecipeTrait<MaybeShared<T>>,
ToDOMViewType<T, kMaybeShared>,
Nullablity::kIsNullable, BufferSizeCheck::kCheck,
@@ -836,13 +829,12 @@ MaybeShared<T> NativeValueTraits<
}
template <typename T>
-MaybeShared<T> NativeValueTraits<
- IDLNullable<MaybeShared<T>>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>::
- ArgumentValue(v8::Isolate* isolate,
- int argument_index,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state) {
+ requires std::derived_from<T, DOMArrayBufferView>
+MaybeShared<T> NativeValueTraits<IDLNullable<MaybeShared<T>>>::ArgumentValue(
+ v8::Isolate* isolate,
+ int argument_index,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
return ArgumentValueImpl<RecipeTrait<MaybeShared<T>>,
ToDOMViewType<T, kMaybeShared>,
Nullablity::kIsNullable, BufferSizeCheck::kCheck,
@@ -853,9 +845,9 @@ MaybeShared<T> NativeValueTraits<
// Nullable [AllowShared, BufferSourceTypeNoSizeLimit] ArrayBufferView
template <typename T>
-MaybeShared<T> NativeValueTraits<
- IDLNullable<IDLBufferSourceTypeNoSizeLimit<MaybeShared<T>>>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>::
+ requires std::derived_from<T, DOMArrayBufferView>
+MaybeShared<T>
+NativeValueTraits<IDLNullable<IDLBufferSourceTypeNoSizeLimit<MaybeShared<T>>>>::
ArgumentValue(v8::Isolate* isolate,
int argument_index,
v8::Local<v8::Value> value,
@@ -870,13 +862,11 @@ MaybeShared<T> NativeValueTraits<
// [AllowShared, FlexibleArrayBufferView] ArrayBufferView
template <typename T>
-T NativeValueTraits<T,
- typename std::enable_if_t<
- std::is_base_of<FlexibleArrayBufferView, T>::value>>::
- ArgumentValue(v8::Isolate* isolate,
- int argument_index,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state) {
+ requires std::derived_from<T, FlexibleArrayBufferView>
+T NativeValueTraits<T>::ArgumentValue(v8::Isolate* isolate,
+ int argument_index,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
return ArgumentValueImpl<RecipeTrait<T>, ToFlexibleArrayBufferView,
Nullablity::kIsNotNullable, BufferSizeCheck::kCheck,
ResizableAllowance::kDisallowResizable,
@@ -888,13 +878,12 @@ T NativeValueTraits<T,
// ArrayBufferView
template <typename T>
-T NativeValueTraits<IDLBufferSourceTypeNoSizeLimit<T>,
- typename std::enable_if_t<
- std::is_base_of<FlexibleArrayBufferView, T>::value>>::
- ArgumentValue(v8::Isolate* isolate,
- int argument_index,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state) {
+ requires std::derived_from<T, FlexibleArrayBufferView>
+T NativeValueTraits<IDLBufferSourceTypeNoSizeLimit<T>>::ArgumentValue(
+ v8::Isolate* isolate,
+ int argument_index,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
return ArgumentValueImpl<
RecipeTrait<T>, ToFlexibleArrayBufferView, Nullablity::kIsNotNullable,
BufferSizeCheck::kDoNotCheck, ResizableAllowance::kDisallowResizable,
@@ -905,13 +894,12 @@ T NativeValueTraits<IDLBufferSourceTypeNoSizeLimit<T>,
// Nullable [AllowShared, FlexibleArrayBufferView] ArrayBufferView
template <typename T>
-T NativeValueTraits<IDLNullable<T>,
- typename std::enable_if_t<
- std::is_base_of<FlexibleArrayBufferView, T>::value>>::
- ArgumentValue(v8::Isolate* isolate,
- int argument_index,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state) {
+ requires std::derived_from<T, FlexibleArrayBufferView>
+T NativeValueTraits<IDLNullable<T>>::ArgumentValue(
+ v8::Isolate* isolate,
+ int argument_index,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
return ArgumentValueImpl<RecipeTrait<T>, ToFlexibleArrayBufferView,
Nullablity::kIsNullable, BufferSizeCheck::kCheck,
ResizableAllowance::kDisallowResizable,
diff --git a/third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h b/third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h
index 899929dcf49f9..5011503dcf1c0 100644
--- a/third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h
+++ b/third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h
@@ -715,9 +718,8 @@ struct CORE_EXPORT NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- T,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>> {
+ requires std::derived_from<T, DOMArrayBufferView>
+struct NativeValueTraits<T> {
// NotShared<T> or MaybeShared<T> should be used instead.
static T* NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
@@ -729,9 +731,8 @@ struct NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- IDLNullable<T>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>> {
+ requires std::derived_from<T, DOMArrayBufferView>
+struct NativeValueTraits<IDLNullable<T>> {
// NotShared<T> or MaybeShared<T> should be used instead.
static T* NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
@@ -743,9 +744,8 @@ struct NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- NotShared<T>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>
+ requires std::derived_from<T, DOMArrayBufferView>
+struct NativeValueTraits<NotShared<T>>
: public NativeValueTraitsBase<NotShared<T>> {
static NotShared<T> NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
@@ -758,9 +758,8 @@ struct NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- IDLNullable<NotShared<T>>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>
+ requires std::derived_from<T, DOMArrayBufferView>
+struct NativeValueTraits<IDLNullable<NotShared<T>>>
: public NativeValueTraitsBase<NotShared<T>> {
static NotShared<T> NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
@@ -773,9 +772,8 @@ struct NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- MaybeShared<T>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>
+ requires std::derived_from<T, DOMArrayBufferView>
+struct NativeValueTraits<MaybeShared<T>>
: public NativeValueTraitsBase<MaybeShared<T>> {
static MaybeShared<T> NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
@@ -788,9 +786,8 @@ struct NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- IDLBufferSourceTypeNoSizeLimit<MaybeShared<T>>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>
+ requires std::derived_from<T, DOMArrayBufferView>
+struct NativeValueTraits<IDLBufferSourceTypeNoSizeLimit<MaybeShared<T>>>
: public NativeValueTraitsBase<MaybeShared<T>> {
// FlexibleArrayBufferView uses this in its implementation, so we cannot
// delete it.
@@ -805,9 +802,8 @@ struct NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- IDLNullable<MaybeShared<T>>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>
+ requires std::derived_from<T, DOMArrayBufferView>
+struct NativeValueTraits<IDLNullable<MaybeShared<T>>>
: public NativeValueTraitsBase<MaybeShared<T>> {
static MaybeShared<T> NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
@@ -820,9 +816,9 @@ struct NativeValueTraits<
};
template <typename T>
+ requires std::derived_from<T, DOMArrayBufferView>
struct NativeValueTraits<
- IDLNullable<IDLBufferSourceTypeNoSizeLimit<MaybeShared<T>>>,
- typename std::enable_if_t<std::is_base_of<DOMArrayBufferView, T>::value>>
+ IDLNullable<IDLBufferSourceTypeNoSizeLimit<MaybeShared<T>>>>
: public NativeValueTraitsBase<MaybeShared<T>> {
// BufferSourceTypeNoSizeLimit must be used only as arguments.
static MaybeShared<T> NativeValue(v8::Isolate* isolate,
@@ -836,11 +832,8 @@ struct NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- T,
- typename std::enable_if_t<
- std::is_base_of<FlexibleArrayBufferView, T>::value>>
- : public NativeValueTraitsBase<T> {
+ requires std::derived_from<T, FlexibleArrayBufferView>
+struct NativeValueTraits<T> : public NativeValueTraitsBase<T> {
// FlexibleArrayBufferView must be used only as arguments.
static T NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
@@ -853,10 +846,8 @@ struct NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- IDLBufferSourceTypeNoSizeLimit<T>,
- typename std::enable_if_t<
- std::is_base_of<FlexibleArrayBufferView, T>::value>>
+ requires std::derived_from<T, FlexibleArrayBufferView>
+struct NativeValueTraits<IDLBufferSourceTypeNoSizeLimit<T>>
: public NativeValueTraitsBase<T> {
// BufferSourceTypeNoSizeLimit and FlexibleArrayBufferView must be used only
// as arguments.
@@ -871,11 +862,8 @@ struct NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- IDLNullable<T>,
- typename std::enable_if_t<
- std::is_base_of<FlexibleArrayBufferView, T>::value>>
- : public NativeValueTraitsBase<T> {
+ requires std::derived_from<T, FlexibleArrayBufferView>
+struct NativeValueTraits<IDLNullable<T>> : public NativeValueTraitsBase<T> {
// FlexibleArrayBufferView must be used only as arguments.
static T NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
@@ -1134,9 +1122,8 @@ NativeValueTraits<IDLSequence<T>>::NativeValue(
}
template <typename T>
-struct NativeValueTraits<IDLNullable<IDLSequence<T>>,
- typename std::enable_if_t<
- NativeValueTraits<IDLSequence<T>>::has_null_value>>
+ requires NativeValueTraits<IDLSequence<T>>::has_null_value
+struct NativeValueTraits<IDLNullable<IDLSequence<T>>>
: public NativeValueTraitsBase<HeapVector<AddMemberIfNeeded<T>>*> {
using ImplType = typename NativeValueTraits<IDLSequence<T>>::ImplType*;
@@ -1203,9 +1190,8 @@ struct NativeValueTraits<IDLArray<T>>
: public NativeValueTraits<IDLSequence<T>> {};
template <typename T>
-struct NativeValueTraits<IDLNullable<IDLArray<T>>,
- typename std::enable_if_t<
- NativeValueTraits<IDLSequence<T>>::has_null_value>>
+ requires NativeValueTraits<IDLSequence<T>>::has_null_value
+struct NativeValueTraits<IDLNullable<IDLArray<T>>>
: public NativeValueTraits<IDLNullable<IDLSequence<T>>> {};
// Record types
@@ -1335,10 +1321,8 @@ struct NativeValueTraits<IDLRecord<K, V>>
// Callback function types
template <typename T>
-struct NativeValueTraits<
- T,
- typename std::enable_if_t<std::is_base_of<CallbackFunctionBase, T>::value>>
- : public NativeValueTraitsBase<T*> {
+ requires std::derived_from<T, CallbackFunctionBase>
+struct NativeValueTraits<T> : public NativeValueTraitsBase<T*> {
static T* NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
ExceptionState& exception_state) {
@@ -1361,9 +1345,8 @@ struct NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- IDLNullable<T>,
- typename std::enable_if_t<std::is_base_of<CallbackFunctionBase, T>::value>>
+ requires std::derived_from<T, CallbackFunctionBase>
+struct NativeValueTraits<IDLNullable<T>>
: public NativeValueTraitsBase<IDLNullable<T>> {
static T* NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
@@ -1392,10 +1375,8 @@ struct NativeValueTraits<
// Callback interface types
template <typename T>
-struct NativeValueTraits<
- T,
- typename std::enable_if_t<std::is_base_of<CallbackInterfaceBase, T>::value>>
- : public NativeValueTraitsBase<T*> {
+ requires std::derived_from<T, CallbackInterfaceBase>
+struct NativeValueTraits<T> : public NativeValueTraitsBase<T*> {
static T* NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
ExceptionState& exception_state) {
@@ -1418,9 +1399,8 @@ struct NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- IDLNullable<T>,
- typename std::enable_if_t<std::is_base_of<CallbackInterfaceBase, T>::value>>
+ requires std::derived_from<T, CallbackInterfaceBase>
+struct NativeValueTraits<IDLNullable<T>>
: public NativeValueTraitsBase<IDLNullable<T>> {
static T* NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
@@ -1449,11 +1429,8 @@ struct NativeValueTraits<
// Dictionary types
template <typename T>
-struct NativeValueTraits<
- T,
- typename std::enable_if_t<
- std::is_base_of<bindings::DictionaryBase, T>::value>>
- : public NativeValueTraitsBase<T*> {
+ requires std::derived_from<T, bindings::DictionaryBase>
+struct NativeValueTraits<T> : public NativeValueTraitsBase<T*> {
static T* NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
ExceptionState& exception_state) {
@@ -1464,14 +1441,11 @@ struct NativeValueTraits<
// We don't support nullable dictionary types in general since it's quite
// confusing and often misused.
template <typename T>
-struct NativeValueTraits<
- IDLNullable<T>,
- typename std::enable_if_t<
- std::is_base_of<bindings::DictionaryBase, T>::value &&
- (std::is_same<T, GPUColorTargetState>::value ||
- std::is_same<T, GPURenderPassColorAttachment>::value ||
- std::is_same<T, GPUVertexBufferLayout>::value)>>
- : public NativeValueTraitsBase<T*> {
+ requires std::derived_from<T, bindings::DictionaryBase> &&
+ (std::same_as<T, GPUColorTargetState> ||
+ std::same_as<T, GPURenderPassColorAttachment> ||
+ std::same_as<T, GPUVertexBufferLayout>)
+struct NativeValueTraits<IDLNullable<T>> : public NativeValueTraitsBase<T*> {
static T* NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
ExceptionState& exception_state) {
@@ -1483,11 +1457,8 @@ struct NativeValueTraits<
// Enumeration types
template <typename T>
-struct NativeValueTraits<
- T,
- typename std::enable_if_t<
- std::is_base_of<bindings::EnumerationBase, T>::value>>
- : public NativeValueTraitsBase<T> {
+ requires std::derived_from<T, bindings::EnumerationBase>
+struct NativeValueTraits<T> : public NativeValueTraitsBase<T> {
static T NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
ExceptionState& exception_state) {
@@ -1497,10 +1468,8 @@ struct NativeValueTraits<
// Interface types
template <typename T>
-struct NativeValueTraits<
- T,
- typename std::enable_if_t<std::is_base_of<ScriptWrappable, T>::value>>
- : public NativeValueTraitsBase<T*> {
+ requires std::derived_from<T, ScriptWrappable>
+struct NativeValueTraits<T> : public NativeValueTraitsBase<T*> {
static inline T* NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
ExceptionState& exception_state) {
@@ -1528,9 +1497,8 @@ struct NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- IDLNullable<T>,
- typename std::enable_if_t<std::is_base_of<ScriptWrappable, T>::value>>
+ requires std::derived_from<T, ScriptWrappable>
+struct NativeValueTraits<IDLNullable<T>>
: public NativeValueTraitsBase<IDLNullable<T>> {
static inline T* NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
@@ -1565,10 +1533,8 @@ struct NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- T,
- typename std::enable_if_t<std::is_base_of<bindings::UnionBase, T>::value>>
- : public NativeValueTraitsBase<T*> {
+ requires std::derived_from<T, bindings::UnionBase>
+struct NativeValueTraits<T> : public NativeValueTraitsBase<T*> {
static T* NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
ExceptionState& exception_state) {
@@ -1584,10 +1550,8 @@ struct NativeValueTraits<
};
template <typename T>
-struct NativeValueTraits<
- IDLNullable<T>,
- typename std::enable_if_t<std::is_base_of<bindings::UnionBase, T>::value>>
- : public NativeValueTraitsBase<T*> {
+ requires std::derived_from<T, bindings::UnionBase>
+struct NativeValueTraits<IDLNullable<T>> : public NativeValueTraitsBase<T*> {
static T* NativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
ExceptionState& exception_state) {
@@ -1608,9 +1572,8 @@ struct NativeValueTraits<
// Nullable types
template <typename InnerType>
-struct NativeValueTraits<
- IDLNullable<InnerType>,
- typename std::enable_if_t<!NativeValueTraits<InnerType>::has_null_value>>
+ requires(!NativeValueTraits<InnerType>::has_null_value)
+struct NativeValueTraits<IDLNullable<InnerType>>
: public NativeValueTraitsBase<IDLNullable<InnerType>> {
// https://webidl.spec.whatwg.org/#es-nullable-type
using ImplType =
@@ -1642,9 +1605,8 @@ struct NativeValueTraits<IDLNullable<IDLNullable<T>>>;
// Optional types
template <typename T>
-struct NativeValueTraits<IDLOptional<T>,
- typename std::enable_if_t<std::is_arithmetic<
- typename NativeValueTraits<T>::ImplType>::value>>
+ requires std::is_arithmetic_v<typename NativeValueTraits<T>::ImplType>
+struct NativeValueTraits<IDLOptional<T>>
: public NativeValueTraitsBase<typename NativeValueTraits<T>::ImplType> {
using ImplType = typename NativeValueTraits<T>::ImplType;
@@ -1666,9 +1628,8 @@ struct NativeValueTraits<IDLOptional<T>,
};
template <typename T>
-struct NativeValueTraits<IDLOptional<T>,
- typename std::enable_if_t<std::is_pointer<
- typename NativeValueTraits<T>::ImplType>::value>>
+ requires std::is_pointer_v<typename NativeValueTraits<T>::ImplType>
+struct NativeValueTraits<IDLOptional<T>>
: public NativeValueTraitsBase<typename NativeValueTraits<T>::ImplType> {
using ImplType = typename NativeValueTraits<T>::ImplType;

@ -0,0 +1,78 @@
diff -up chromium-115.0.5790.24/media/base/cdm_promise_adapter.cc.workaround_clang_bug-structured_binding chromium-115.0.5790.24/media/base/cdm_promise_adapter.cc
--- chromium-115.0.5790.24/media/base/cdm_promise_adapter.cc.workaround_clang_bug-structured_binding 2023-06-07 21:48:37.000000000 +0200
+++ chromium-115.0.5790.24/media/base/cdm_promise_adapter.cc 2023-06-17 16:53:20.216628557 +0200
@@ -94,7 +94,9 @@ void CdmPromiseAdapter::RejectPromise(ui
void CdmPromiseAdapter::Clear(ClearReason reason) {
// Reject all outstanding promises.
DCHECK(thread_checker_.CalledOnValidThread());
- for (auto& [promise_id, promise] : promises_) {
+ for (auto& [p_i, p_e] : promises_) {
+ auto& promise_id = p_i;
+ auto& promise = p_e;
TRACE_EVENT_NESTABLE_ASYNC_END1(
"media", "CdmPromise", TRACE_ID_WITH_SCOPE("CdmPromise", promise_id),
"status", "cleared");
diff -up chromium-115.0.5790.32/content/browser/service_worker/service_worker_context_wrapper.cc.me chromium-115.0.5790.32/content/browser/service_worker/service_worker_context_wrapper.cc
--- chromium-115.0.5790.32/content/browser/service_worker/service_worker_context_wrapper.cc.me 2023-06-19 08:04:02.287072722 +0200
+++ chromium-115.0.5790.32/content/browser/service_worker/service_worker_context_wrapper.cc 2023-06-19 08:18:24.576814950 +0200
@@ -1393,7 +1393,8 @@ void ServiceWorkerContextWrapper::MaybeP
return;
}
- auto [document_url, key, callback] = std::move(*request);
+ auto [d_u, key, callback] = std::move(*request);
+ auto document_url = d_u;
DCHECK(document_url.is_valid());
TRACE_EVENT1("ServiceWorker",
diff -up chromium-121.0.6167.16/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc.than chromium-121.0.6167.16/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc
--- chromium-121.0.6167.16/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc.than 2023-12-19 17:57:56.205197246 +0100
+++ chromium-121.0.6167.16/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc 2023-12-19 18:10:13.778634531 +0100
@@ -3527,8 +3527,8 @@ void GridLayoutAlgorithm::PlaceGridItems
DCHECK(out_row_break_between);
const auto& container_space = GetConstraintSpace();
- const auto& [grid_items, layout_data, tree_size] = sizing_tree.TreeRootData();
-
+ const auto& [grid_items, l_d, tree_size] = sizing_tree.TreeRootData();
+ const auto& layout_data = l_d;
const auto* cached_layout_subtree = container_space.GetGridLayoutSubtree();
const auto container_writing_direction =
container_space.GetWritingDirection();
@@ -3691,8 +3691,9 @@ void GridLayoutAlgorithm::PlaceGridItems
// TODO(ikilpatrick): Update |SetHasSeenAllChildren| and early exit if true.
const auto& constraint_space = GetConstraintSpace();
- const auto& [grid_items, layout_data, tree_size] = sizing_tree.TreeRootData();
-
+ const auto& [g_i, l_d, tree_size] = sizing_tree.TreeRootData();
+ const auto& grid_items = g_i;
+ const auto& layout_data = l_d;
const auto* cached_layout_subtree = constraint_space.GetGridLayoutSubtree();
const auto container_writing_direction =
constraint_space.GetWritingDirection();
diff -up chromium-122.0.6261.69/chrome/browser/predictors/lcp_critical_path_predictor/prewarm_http_disk_cache_manager.cc.me chromium-122.0.6261.69/chrome/browser/predictors/lcp_critical_path_predictor/prewarm_http_disk_cache_manager.cc
--- chromium-122.0.6261.69/chrome/browser/predictors/lcp_critical_path_predictor/prewarm_http_disk_cache_manager.cc.me 2024-02-25 18:03:51.654579579 +0100
+++ chromium-122.0.6261.69/chrome/browser/predictors/lcp_critical_path_predictor/prewarm_http_disk_cache_manager.cc 2024-02-25 18:12:45.144287750 +0100
@@ -136,7 +136,8 @@ void PrewarmHttpDiskCacheManager::MaybeP
std::pair<url::Origin, GURL> origin_and_url;
std::swap(origin_and_url, queued_jobs_.front());
queued_jobs_.pop();
- const auto& [origin, url] = origin_and_url;
+ const auto& [origin, u] = origin_and_url;
+ const auto& url = u;
TRACE_EVENT_WITH_FLOW1(
"loading", "PrewarmHttpDiskCacheManager::MaybeProcessNextQueuedJob",
TRACE_ID_LOCAL(this),
--- chromium-123.0.6312.46/content/common/service_worker/race_network_request_url_loader_client.cc.orig 2024-03-15 15:37:58.201209354 +0100
+++ chromium-123.0.6312.46/content/common/service_worker/race_network_request_url_loader_client.cc 2024-03-15 15:40:35.003250723 +0100
@@ -639,7 +639,8 @@
return std::nullopt;
}
- auto [result, read_buffer] = BeginReadData();
+ auto [r, read_buffer] = BeginReadData();
+ auto result = r;
TRACE_EVENT_WITH_FLOW2(
"ServiceWorker",
"ServiceWorkerRaceNetworkRequestURLLoaderClient::ReadAndWrite",

@ -1,3 +1,3 @@
# system wide chromium flags
CHROMIUM_FLAGS=""
CHROMIUM_FLAGS+=" --enable-features=VaapiVideoEncoder,VaapiVideoDecodeLinuxGL"
CHROMIUM_FLAGS+=" --use-gl=angle --use-angle=gl --enable-features=VaapiVideoEncoder,VaapiVideoDecodeLinuxGL"

@ -333,7 +333,7 @@
%endif
Name: chromium%{chromium_channel}
Version: 122.0.6261.128
Version: 123.0.6312.58
Release: 1%{?dist}.inferit
Summary: A WebKit (Blink) powered web browser that Google doesn't want you to use
Url: http://www.chromium.org/Home
@ -396,7 +396,7 @@ Patch101: chromium-108-el7-wayland-strndup-error.patch
# Workaround for old clang
# error: defaulting this default constructor would delete it after its first declaration
Patch102: chromium-121-el7-default-constructor-involving-anonymous-union.patch
Patch102: chromium-123-el7-default-constructor-involving-anonymous-union.patch
# Work around old and missing headers on EPEL7
Patch103: chromium-110-epel7-old-headers-workarounds.patch
@ -425,7 +425,7 @@ Patch111: chromium-116-constexpr.patch
# old clang on el7
Patch113: chromium-121-el7-clang-version-warning.patch
Patch114: chromium-120-el7-clang-build-failure.patch
Patch114: chromium-123-el7-clang-build-failure.patch
# system ffmpeg
# need for old ffmpeg 5.x on epel9
@ -445,14 +445,14 @@ Patch140: chromium-118-dma_buf_export_sync_file-conflict.patch
# fixes for old clang version in fedora < 38 end epel < 8 (old clang <= 15)
# compiler build errors, no matching constructor for initialization
Patch300: chromium-121-no_matching_constructor.patch
Patch300: chromium-123-no_matching_constructor.patch
Patch301: chromium-115-compiler-SkColor4f.patch
# workaround for clang bug, https://github.com/llvm/llvm-project/issues/57826
Patch302: chromium-121-workaround_clang_bug-structured_binding.patch
Patch302: chromium-123-workaround_clang_bug-structured_binding.patch
# missing typename
Patch303: chromium-121-typename.patch
Patch303: chromium-123-typename.patch
# error: invalid operands to binary expression
Patch304: chromium-117-string-convert.patch
@ -465,31 +465,29 @@ Patch306: chromium-119-assert.patch
# revert it for old clang on rhel and f38
Patch307: chromium-121-v8-c++20-p1.patch
Patch308: chromium-121-v8-c++20.patch
Patch309: chromium-122-constexpr.patch
Patch308: chromium-123-v8-c++20.patch
Patch309: chromium-123-constexpr.patch
# missing include header files
Patch310: chromium-122-missing-header-files.patch
Patch310: chromium-123-missing-header-files.patch
# clang warnings
Patch311: chromium-115-clang-warnings.patch
# enable fstack-protector-strong
Patch312: chromium-119-fstack-protector-strong.patch
Patch312: chromium-123-fstack-protector-strong.patch
# # rust is old, function or associated item not found in `OsStr`
Patch313: chromium-123-static-assert.patch
# fixed static assert error
Patch313: chromium-122-static-assert.patch
Patch314: chromium-122-clang16-buildflags.patch
# assignment-expressions not suport in python < 3.8 on el 7/8
Patch315: chromium-122-python3-assignment-expressions.patch
Patch315: chromium-123-python3-assignment-expressions.patch
# add -ftrivial-auto-var-init=zero and -fwrapv
Patch316: chromium-122-clang-build-flags.patch
# build error
Patch351: chromium-121-mnemonic-error.patch
# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2239523
# https://bugs.chromium.org/p/chromium/issues/detail?id=1145581#c60
# Disable BTI until this is fixed upstream.
@ -989,7 +987,7 @@ Requires: %{name}-common%{_isa} = %{version}-%{release}
%if 0%{?rhel} == 7
ExclusiveArch: x86_64
%else
%if 0%{?fedora} >= 40
%if 0%{?fedora} > 40
ExclusiveArch: x86_64 aarch64 ppc64le
%else
ExclusiveArch: x86_64 aarch64
@ -1273,7 +1271,7 @@ sed -i 's/std::string data_dir_basename = "chromium"/std::string data_dir_basena
%endif
#%%if ! %{bundleffmpegfree}
#%%if 0%{?rhel} == 9 || 0%%{?fedora} == 37
#%%if 0%{?rhel} == 9
#%%patch -P115 -p1 -b .ffmpeg-5.x-duration
#%%endif
#%%patch -P116 -p1 -b .prop-codecs
@ -1296,11 +1294,11 @@ sed -i 's/std::string data_dir_basename = "chromium"/std::string data_dir_basena
%patch -P110 -p1 -b .buildflag-el7
#patch -P111 -p1 -b .constexpr
%patch -P113 -p1 -b .el7-clang-version-warning
%patch -P114 -p1 -R -b .clang-build-failure
#patch -P300 -p1 -b .no_matching_constructor
%patch -P114 -p1 -b .clang-build-failure
%patch -P300 -p1 -b .no_matching_constructor
%patch -P301 -p1 -b .workaround_clang-SkColor4f
%patch -P302 -p1 -b .workaround_clang_bug-structured_binding
#patch -P303 -p1 -b .typename
%patch -P303 -p1 -b .typename
%patch -P304 -p1 -b .string-convert
%patch -P306 -p1 -b .assert
%endif
@ -1324,16 +1322,20 @@ sed -i 's/std::string data_dir_basename = "chromium"/std::string data_dir_basena
%patch -P307 -p1 -R -b .v8-c++20
%patch -P308 -p1 -R -b .v8-c++20
%patch -P309 -p1 -b .constexpr
%patch -P313 -p1 -b .static-assert
%patch -P314 -p1 -b .clang16-buildflag
%endif
%patch -P310 -p1 -b .missing-header-files
%patch -P311 -p1 -b .clang-warnings
%patch -P312 -p1 -b .fstack-protector-strong
%patch -P316 -p1 -b .clang-build-flags
%patch -P351 -p1 -b .mnemonic-error
%if 0%{?rhel} && 0%{?rhel} < 10
%patch -P313 -p1 -b .rust-clap_lex
%endif
%if 0%{?rhel} >= 8 || 0%{?fedora}
%patch -P316 -p1 -b .clang-build-flags
%endif
%if %{disable_bti}
%patch -P352 -p1 -b .workaround_for_crash_on_BTI_capable_system
@ -1513,6 +1515,7 @@ export LANG=en_US.UTF-8
FLAGS=' -Wno-deprecated-declarations -Wno-unknown-warning-option -Wno-unused-command-line-argument'
FLAGS+=' -Wno-unused-but-set-variable -Wno-unused-result -Wno-unused-function -Wno-unused-variable'
FLAGS+=' -Wno-unused-const-variable -Wno-unneeded-internal-declaration -Wno-unknown-attributes'
FLAGS+=' -Wno-unknown-pragmas'
%endif
%if %{system_build_flags}
@ -2236,6 +2239,17 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt
%endif
%changelog
* Thu Mar 21 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 123.0.6312.58-1.inferit
- update to 123.0.6312.58
* High CVE-2024-2625: Object lifecycle issue in V8
* Medium CVE-2024-2626: Out of bounds read in Swiftshader
* Medium CVE-2024-2627: Use after free in Canvas
* Medium CVE-2024-2628: Inappropriate implementation in Downloads
* Medium CVE-2024-2629: Incorrect security UI in iOS
* Medium CVE-2024-2630: Inappropriate implementation in iOS
* Low CVE-2024-2631: Inappropriate implementation in iOS
- fixed bz#2270321 - VAAPI flags in chromium.conf are out of date
* Thu Mar 14 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 122.0.6261.128-1.inferit
- upstream security release 122.0.6261.128
* High CVE-2024-2400: Use after free in Performance Manager

Loading…
Cancel
Save