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

Unified Diff: chrome/browser/net/cache_stats.cc

Issue 10832113: Prevent CacheStats from DCHECKing when debugging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Clean up as well Created 8 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/cache_stats.cc
===================================================================
--- chrome/browser/net/cache_stats.cc (revision 149455)
+++ chrome/browser/net/cache_stats.cc (working copy)
@@ -281,6 +281,14 @@
base::TimeDelta delta =
base::TimeDelta::FromMilliseconds(kStatsCollectionTimesMs[timer_index]);
delta -= base::TimeTicks::Now() - stats->load_start_time;
+
+ // If the ScheduleTimer call was delayed significantly, like when one's using
+ // a debugger, don't try to start the timer with a negative time.
+ if (delta < base::TimeDelta()) {
+ RemoveTabLoadStats(stats->render_view_id);
+ return;
+ }
+
stats->timer.Start(FROM_HERE,
delta,
base::Bind(&CacheStats::TimerCallback,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698