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

Unified Diff: components/safe_browsing_db/v4_update_protocol_manager.cc

Issue 1845643002: Initialize next_update_time_ to allow immediate updating (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_update_protocol_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/safe_browsing_db/v4_update_protocol_manager.cc
diff --git a/components/safe_browsing_db/v4_update_protocol_manager.cc b/components/safe_browsing_db/v4_update_protocol_manager.cc
index c5dbfb5c2c88ae317e66b4a6283c306261e84c8b..e70adb8817c20f0ed87aa0eec2498c2a150f02e4 100644
--- a/components/safe_browsing_db/v4_update_protocol_manager.cc
+++ b/components/safe_browsing_db/v4_update_protocol_manager.cc
@@ -101,7 +101,9 @@ V4UpdateProtocolManager::V4UpdateProtocolManager(
const V4ProtocolConfig& config)
: update_error_count_(0),
update_back_off_mult_(1),
- next_update_time_(Time::Now()),
+ // The next_update_time_ is just before now so that we can immediately
+ // fetch an update.
+ next_update_time_(Time::Now() - base::TimeDelta::FromMilliseconds(1)),
Nathan Parker 2016/03/30 20:12:16 Why not zero? It's less code.
vakh (use Gerrit instead) 2016/03/30 21:04:14 Done.
config_(config),
request_context_getter_(request_context_getter),
url_fetcher_id_(0) {}
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_update_protocol_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698