0

updater: eliminate TimeTicks check which can fail at runtime.

The reason for checking is unknown at the moment.

Fixed: 1470361
Change-Id: I2c5632c01bf69d92831904d97fd1e7afcb8f708e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4754293
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Commit-Queue: Sorin Jianu <sorin@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1179874}
This commit is contained in:
Sorin Jianu
2023-08-04 22:12:32 +00:00
committed by Chromium LUCI CQ
parent dd46e24e4d
commit 13a128b8cb

@@ -602,15 +602,14 @@ void Component::NotifyObservers(UpdateClient::Observer::Events event) const {
base::TimeDelta Component::GetUpdateDuration() const { base::TimeDelta Component::GetUpdateDuration() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (update_begin_.is_null()) {
if (update_begin_.is_null())
return base::TimeDelta(); return base::TimeDelta();
}
const base::TimeDelta update_cost(base::TimeTicks::Now() - update_begin_); const base::TimeDelta update_cost(base::TimeTicks::Now() - update_begin_);
CHECK_GE(update_cost, base::TimeDelta()); if (update_cost.is_negative()) {
const base::TimeDelta max_update_delay = return base::TimeDelta();
update_context_->config->UpdateDelay(); }
return std::min(update_cost, max_update_delay); return std::min(update_cost, update_context_->config->UpdateDelay());
} }
base::Value::Dict Component::MakeEventUpdateComplete() const { base::Value::Dict Component::MakeEventUpdateComplete() const {