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

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

Issue 136203009: Support auto-reload on errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Add experiment Created 6 years, 10 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.h
diff --git a/chrome/renderer/net/net_error_helper.h b/chrome/renderer/net/net_error_helper.h
index c61ed0f41aae8700189c92f7aae4f40b68aefffc..f54d1d4109dfc1341a5b395dd61fcc6befcd87f6 100644
--- a/chrome/renderer/net/net_error_helper.h
+++ b/chrome/renderer/net/net_error_helper.h
@@ -11,8 +11,10 @@
#include "chrome/renderer/net/net_error_helper_core.h"
#include "content/public/renderer/render_frame_observer.h"
#include "content/public/renderer/render_frame_observer_tracker.h"
+#include "content/public/renderer/render_process_observer.h"
class GURL;
+class MockableOneShotTimer;
namespace content {
class ResourceFetcher;
@@ -30,9 +32,11 @@ struct WebURLError;
class NetErrorHelper
: public content::RenderFrameObserver,
public content::RenderFrameObserverTracker<NetErrorHelper>,
+ public content::RenderProcessObserver,
public NetErrorHelperCore::Delegate {
public:
- explicit NetErrorHelper(content::RenderFrame* render_view);
+ explicit NetErrorHelper(content::RenderFrame* render_view,
+ bool auto_reload_enabled);
Randy Smith (Not in Mondays) 2014/02/26 00:07:38 I had a series of questions on how auto_reload_ena
Elly Fong-Jones 2014/03/03 19:31:07 Done.
virtual ~NetErrorHelper();
// RenderFrameObserver implementation.
@@ -44,6 +48,9 @@ class NetErrorHelper
// IPC::Listener implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ // RenderProcessObserver implementation.
+ virtual void NetworkStateChanged(bool online) OVERRIDE;
+
// Examines |frame| and |error| to see if this is an error worthy of a DNS
// probe. If it is, initializes |error_strings| based on |error|,
// |is_failed_post|, and |locale| with suitable strings and returns true.
@@ -57,6 +64,9 @@ class NetErrorHelper
bool is_failed_post,
std::string* error_html);
+ // Returns whether a load for |url| should have its error page suppressed.
+ bool ShouldSuppressErrorPage(const GURL& url);
+
private:
// NetErrorHelperCore::Delegate implementation:
virtual void GenerateLocalizedErrorPage(const blink::WebURLError& error,
@@ -68,6 +78,7 @@ class NetErrorHelper
bool is_failed_post) OVERRIDE;
virtual void FetchErrorPage(const GURL& url) OVERRIDE;
virtual void CancelFetchErrorPage() OVERRIDE;
+ virtual void ReloadPage() OVERRIDE;
void OnNetErrorInfo(int status);
void OnSetAltErrorPageURL(const GURL& alternate_error_page_url);

Powered by Google App Engine
This is Rietveld 408576698