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

Unified Diff: chrome/browser/safe_browsing/protocol_manager.h

Issue 10933047: Use base::TimeDelta in SafeBrowsingProtocolManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: React to mattm review Created 8 years, 3 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 | chrome/browser/safe_browsing/protocol_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/protocol_manager.h
diff --git a/chrome/browser/safe_browsing/protocol_manager.h b/chrome/browser/safe_browsing/protocol_manager.h
index 57976011fd3da93fdaf681ef0ca5ecfc57804006..f29f84248fab414361016a23b5cba1f4880c9c7a 100644
--- a/chrome/browser/safe_browsing/protocol_manager.h
+++ b/chrome/browser/safe_browsing/protocol_manager.h
@@ -89,8 +89,8 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate {
virtual void GetFullHash(SafeBrowsingService::SafeBrowsingCheck* check,
const std::vector<SBPrefix>& prefixes);
- // Forces the start of next update after |next_update_msec| in msec.
- void ForceScheduleNextUpdate(int next_update_msec);
+ // Forces the start of next update after |interval| time.
+ void ForceScheduleNextUpdate(base::TimeDelta interval);
// Scheduled update callback.
void GetNextUpdate();
@@ -226,15 +226,16 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate {
// Composes a ChunkUrl based on input string.
GURL NextChunkUrl(const std::string& input) const;
- // Returns the time (in milliseconds) for the next update request. If
- // 'back_off' is true, the time returned will increment an error count and
- // return the appriate next time (see ScheduleNextUpdate below).
- int GetNextUpdateTime(bool back_off);
+ // Returns the time for the next update request. If |back_off| is true,
+ // the time returned will increment an error count and return the appriate
+ // next time (see ScheduleNextUpdate below).
+ base::TimeDelta GetNextUpdateInterval(bool back_off);
// Worker function for calculating GetHash and Update backoff times (in
- // seconds). 'Multiplier' is doubled for each consecutive error between the
- // 2nd and 5th, and 'error_count' is incremented with each call.
- int GetNextBackOffTime(int* error_count, int* multiplier);
+ // seconds). |multiplier| is doubled for each consecutive error between the
+ // 2nd and 5th, and |error_count| is incremented with each call.
+ base::TimeDelta GetNextBackOffInterval(int* error_count,
+ int* multiplier) const;
// Manages our update with the next allowable update time. If 'back_off_' is
// true, we must decrease the frequency of requests of the SafeBrowsing
@@ -305,7 +306,7 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate {
// For managing the next earliest time to query the SafeBrowsing servers for
// updates.
- int next_update_sec_;
+ base::TimeDelta next_update_interval_;
base::OneShotTimer<SafeBrowsingProtocolManager> update_timer_;
// All chunk requests that need to be made.
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/protocol_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698