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

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

Issue 13270005: Display DNS probe results. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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
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 48362513a4e71869fbb0d7b4a39f8e9463f7c65c..ea80fb9872bef95705080a18a39a515cce8442d1 100644
--- a/chrome/renderer/net/net_error_helper.h
+++ b/chrome/renderer/net/net_error_helper.h
@@ -8,6 +8,12 @@
#include "chrome/common/net/net_error_info.h"
#include "chrome/common/net/net_error_tracker.h"
#include "content/public/renderer/render_view_observer.h"
+#include "googleurl/src/gurl.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebURLError.h"
+
+namespace base {
+class DictionaryValue;
+}
namespace WebKit {
class WebFrame;
@@ -31,14 +37,33 @@ class NetErrorHelper : public content::RenderViewObserver {
// IPC::Listener implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ static bool GetErrorStringsForDnsProbe(
+ const WebKit::WebURLError& error,
+ base::DictionaryValue* strings,
+ const std::string& locale);
+
private:
- void OnNetErrorInfo(int dns_probe_result);
- void TrackerCallback(NetErrorTracker::DnsErrorPageState state);
- void UpdateErrorPage(chrome_common_net::DnsProbeResult dns_probe_result);
+ enum State {
+ IDLE, // Helper is not currently handling a DNS error
+ AWAITING_LOAD, // Helper is waiting for error page load to finish
+ AWAITING_INITIAL_IPC, // Helper is awaiting STARTED or NOT_RUN IPC
+ AWAITING_PROBE_RESULT // Helper is awaiting FINISHED IPC to update page
+ };
+
+ void TrackerCallback(
+ NetErrorTracker::DnsErrorPageState state);
+ void OnNetErrorInfo(int status, int result);
+
+ void UpdateErrorPage();
+ WebKit::WebURLError MakeUpdatedError();
+
+ State state_;
+
+ WebKit::WebURLError last_error_;
+ chrome_common_net::DnsProbeStatus last_status_;
+ chrome_common_net::DnsProbeResult last_result_;
NetErrorTracker tracker_;
- NetErrorTracker::DnsErrorPageState dns_error_page_state_;
- bool updated_error_page_;
};
#endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698