8
0
Files
nodejs-electron/pending_beacon_dispatcher-virtual-functions-cannot-be-constexpr.patch
2022-10-04 19:13:55 +00:00

41 lines
1.9 KiB
Diff

From 177ad3a80b18aa94e6564f7ba71ee7a849ff5b36 Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jdapena@igalia.com>
Date: Thu, 1 Sep 2022 15:52:05 +0000
Subject: [PATCH] libstdc++: do not make ReverseBeaconTimeoutSorter function
call operator constexpr
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In C++17 STL, std::sort is not a constexpr in any case. So we do
not get any benefit from making ReverseBeaconTimeoutSorter a
constexpr. This will fail, as in GCC the function call operator is
implicitly virtual, and virtuals cannot be constexpr before C++20.
Bug: 819294, 957519
Change-Id: I596f7ea9acb7747f4816b59a86ba794f16e195b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3864599
Reviewed-by: Nate Chapin <japhet@chromium.org>
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1042121}
---
.../blink/renderer/core/frame/pending_beacon_dispatcher.cc | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/third_party/blink/renderer/core/frame/pending_beacon_dispatcher.cc b/third_party/blink/renderer/core/frame/pending_beacon_dispatcher.cc
index 777921b9b5fda..aef913ae85059 100644
--- a/third_party/blink/renderer/core/frame/pending_beacon_dispatcher.cc
+++ b/third_party/blink/renderer/core/frame/pending_beacon_dispatcher.cc
@@ -25,9 +25,8 @@ namespace {
constexpr base::TimeDelta kBeaconTimeoutInterval = base::Milliseconds(100);
struct ReverseBeaconTimeoutSorter {
- constexpr bool operator()(
- const Member<PendingBeaconDispatcher::PendingBeacon>& lhs,
- const Member<PendingBeaconDispatcher::PendingBeacon>& rhs) {
+ bool operator()(const Member<PendingBeaconDispatcher::PendingBeacon>& lhs,
+ const Member<PendingBeaconDispatcher::PendingBeacon>& rhs) {
// Negative timeout is not accepted.
DCHECK(!lhs->GetBackgroundTimeout().is_negative());
DCHECK(!rhs->GetBackgroundTimeout().is_negative());