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

Unified Diff: chrome/renderer/net/net_error_helper_core.h

Issue 259613003: Fix auto-reload histograms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Rework state machine a bit Created 6 years, 8 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
Index: chrome/renderer/net/net_error_helper_core.h
diff --git a/chrome/renderer/net/net_error_helper_core.h b/chrome/renderer/net/net_error_helper_core.h
index 570879c0aff17520a0d7fe66e7ac6b06cdd347d4..413e4e20906193d50f3ec8a13ec68fffdfaca469 100644
--- a/chrome/renderer/net/net_error_helper_core.h
+++ b/chrome/renderer/net/net_error_helper_core.h
@@ -111,7 +111,7 @@ class NetErrorHelperCore {
// These methods handle tracking the actual state of the page.
void OnStartLoad(FrameType frame_type, PageType page_type);
- void OnCommitLoad(FrameType frame_type);
+ void OnCommitLoad(FrameType frame_type, const GURL& url);
void OnFinishLoad(FrameType frame_type);
void OnStop();
@@ -205,14 +205,28 @@ class NetErrorHelperCore {
std::string api_key_;
GURL search_url_;
+ // True if auto-reload is enabled at all.
bool auto_reload_enabled_;
+
+ // Timer used to wait for auto-reload attempts.
scoped_ptr<base::Timer> auto_reload_timer_;
+ // True if the auto-reload timer would be running but is waiting for an
+ // offline->online network transition.
+ bool auto_reload_timer_paused_;
Randy Smith (Not in Mondays) 2014/04/30 18:22:16 Strictly speaking (IIUC), this isn't pausing the t
Elly Fong-Jones 2014/05/01 18:33:03 Done.
+
+ // True if there is an uncommitted-but-started load. This is used to inhibit
Randy Smith (Not in Mondays) 2014/04/30 18:22:16 nit, suggestion: Maybe add "of either an error or
Elly Fong-Jones 2014/05/01 18:33:03 Done.
+ // starting auto-reload when an error page finishes, in case this happens:
+ // Error page starts
+ // Error page commits
+ // Non-error page starts
+ // Error page finishes
+ bool uncommitted_load_started_;
+
// Is the browser online?
bool online_;
int auto_reload_count_;
- bool can_auto_reload_page_;
// Non-NO_BUTTON only when a navigation has been initiated from the error
// page. Used to detect when such navigations result in errors.

Powered by Google App Engine
This is Rietveld 408576698