From f7d1db5b8e26b77e8b403efb6a8843378f32b8dd Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Tue, 1 Mar 2022 13:00:17 -0500 Subject: chromium-100.0.4896.12 (testing) --- .../chromium-100-InMilliseconds-constexpr.patch | 97 ++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 www-client/chromium/files/chromium-100-InMilliseconds-constexpr.patch (limited to 'www-client/chromium/files/chromium-100-InMilliseconds-constexpr.patch') diff --git a/www-client/chromium/files/chromium-100-InMilliseconds-constexpr.patch b/www-client/chromium/files/chromium-100-InMilliseconds-constexpr.patch new file mode 100644 index 0000000..cf4562a --- /dev/null +++ b/www-client/chromium/files/chromium-100-InMilliseconds-constexpr.patch @@ -0,0 +1,97 @@ +From da6e3f6071fdabeb96c0805626418414b4a4cea8 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Wed, 9 Feb 2022 17:56:21 +0000 +Subject: [PATCH] GCC: make base::InMilliseconds(F,RoundedUp) constexpr + +media::DecodeTimestamp uses it in several constexpr methods. +--- + base/time/time.cc | 24 ------------------------ + base/time/time.h | 30 +++++++++++++++++++++++++++--- + 2 files changed, 27 insertions(+), 27 deletions(-) + +diff --git a/base/time/time.cc b/base/time/time.cc +index 0de273e..e0acda2 100644 +--- a/base/time/time.cc ++++ b/base/time/time.cc +@@ -74,30 +74,6 @@ int TimeDelta::InDaysFloored() const { + : std::numeric_limits::max(); + } + +-double TimeDelta::InMillisecondsF() const { +- if (!is_inf()) +- return static_cast(delta_) / Time::kMicrosecondsPerMillisecond; +- return (delta_ < 0) ? -std::numeric_limits::infinity() +- : std::numeric_limits::infinity(); +-} +- +-int64_t TimeDelta::InMilliseconds() const { +- if (!is_inf()) +- return delta_ / Time::kMicrosecondsPerMillisecond; +- return (delta_ < 0) ? std::numeric_limits::min() +- : std::numeric_limits::max(); +-} +- +-int64_t TimeDelta::InMillisecondsRoundedUp() const { +- if (!is_inf()) { +- const int64_t result = delta_ / Time::kMicrosecondsPerMillisecond; +- // Convert |result| from truncating to ceiling. +- return (delta_ > result * Time::kMicrosecondsPerMillisecond) ? (result + 1) +- : result; +- } +- return delta_; +-} +- + double TimeDelta::InMicrosecondsF() const { + if (!is_inf()) + return static_cast(delta_); +diff --git a/base/time/time.h b/base/time/time.h +index c027aab..fb1d78d 100644 +--- a/base/time/time.h ++++ b/base/time/time.h +@@ -216,9 +216,9 @@ class BASE_EXPORT TimeDelta { + constexpr int InMinutes() const; + constexpr double InSecondsF() const; + constexpr int64_t InSeconds() const; +- double InMillisecondsF() const; +- int64_t InMilliseconds() const; +- int64_t InMillisecondsRoundedUp() const; ++ constexpr double InMillisecondsF() const; ++ constexpr int64_t InMilliseconds() const; ++ constexpr int64_t InMillisecondsRoundedUp() const; + constexpr int64_t InMicroseconds() const { return delta_; } + double InMicrosecondsF() const; + constexpr int64_t InNanoseconds() const; +@@ -889,6 +889,30 @@ constexpr int64_t TimeDelta::InSeconds() const { + return is_inf() ? delta_ : (delta_ / Time::kMicrosecondsPerSecond); + } + ++constexpr double TimeDelta::InMillisecondsF() const { ++ if (!is_inf()) ++ return static_cast(delta_) / Time::kMicrosecondsPerMillisecond; ++ return (delta_ < 0) ? -std::numeric_limits::infinity() ++ : std::numeric_limits::infinity(); ++} ++ ++constexpr int64_t TimeDelta::InMilliseconds() const { ++ if (!is_inf()) ++ return delta_ / Time::kMicrosecondsPerMillisecond; ++ return (delta_ < 0) ? std::numeric_limits::min() ++ : std::numeric_limits::max(); ++} ++ ++constexpr int64_t TimeDelta::InMillisecondsRoundedUp() const { ++ if (!is_inf()) { ++ const int64_t result = delta_ / Time::kMicrosecondsPerMillisecond; ++ // Convert |result| from truncating to ceiling. ++ return (delta_ > result * Time::kMicrosecondsPerMillisecond) ? (result + 1) ++ : result; ++ } ++ return delta_; ++} ++ + constexpr int64_t TimeDelta::InNanoseconds() const { + return base::ClampMul(delta_, Time::kNanosecondsPerMicrosecond); + } +-- +2.34.1 + -- cgit v1.2.3