Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2604)

Unified Diff: chrome/browser/extensions/updater/extension_updater.cc

Issue 2562963003: Fix DCHECK failure in extension_updater when scheduling first check (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/updater/extension_updater.cc
diff --git a/chrome/browser/extensions/updater/extension_updater.cc b/chrome/browser/extensions/updater/extension_updater.cc
index 16e57c6690b0a298b2a46dac283c2075bfc960d1..7c27452192f94d4e91e49bb73db83a5a36847993 100644
--- a/chrome/browser/extensions/updater/extension_updater.cc
+++ b/chrome/browser/extensions/updater/extension_updater.cc
@@ -178,15 +178,14 @@ TimeDelta ExtensionUpdater::DetermineFirstCheckDelay() {
return TimeDelta::FromSeconds(
RandInt(kStartupWaitSeconds, frequency_seconds_));
+ // Read the persisted next check time, and use that if it isn't in the past
+ // or too far in the future (this can happen with system clock changes).
Time saved_next = Time::FromInternalValue(prefs_->GetInt64(
pref_names::kNextUpdateCheck));
-
Time now = Time::Now();
-
- // Read the persisted next check time, and use that if it isn't in the past
- // or too far in the future (this can happen with system clock changes).
- if (saved_next > now &&
- saved_next < now + TimeDelta::FromSeconds(frequency_seconds_)) {
+ base::Time earliest = now + TimeDelta::FromSeconds(1);
lazyboy 2016/12/10 00:10:15 The value 1 is coming from ExtensionUpdater::Sche
asargent_no_longer_on_chrome 2016/12/14 23:01:19 Done.
+ base::Time latest = now + TimeDelta::FromSeconds(frequency_seconds_);
+ if (saved_next > earliest && saved_next < latest) {
return saved_next - now;
}

Powered by Google App Engine
This is Rietveld 408576698