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

Side by Side 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, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_RENDERER_NET_NET_ERROR_HELPER_CORE_H_ 5 #ifndef CHROME_RENDERER_NET_NET_ERROR_HELPER_CORE_H_
6 #define CHROME_RENDERER_NET_NET_ERROR_HELPER_CORE_H_ 6 #define CHROME_RENDERER_NET_NET_ERROR_HELPER_CORE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // 104 //
105 // Updates the NetErrorHelper with the assumption the page will be loaded 105 // Updates the NetErrorHelper with the assumption the page will be loaded
106 // immediately. 106 // immediately.
107 void GetErrorHTML(FrameType frame_type, 107 void GetErrorHTML(FrameType frame_type,
108 const blink::WebURLError& error, 108 const blink::WebURLError& error,
109 bool is_failed_post, 109 bool is_failed_post,
110 std::string* error_html); 110 std::string* error_html);
111 111
112 // These methods handle tracking the actual state of the page. 112 // These methods handle tracking the actual state of the page.
113 void OnStartLoad(FrameType frame_type, PageType page_type); 113 void OnStartLoad(FrameType frame_type, PageType page_type);
114 void OnCommitLoad(FrameType frame_type); 114 void OnCommitLoad(FrameType frame_type, const GURL& url);
115 void OnFinishLoad(FrameType frame_type); 115 void OnFinishLoad(FrameType frame_type);
116 void OnStop(); 116 void OnStop();
117 117
118 void CancelPendingFetches(); 118 void CancelPendingFetches();
119 119
120 // Called when an error page have has been retrieved over the network. |html| 120 // Called when an error page have has been retrieved over the network. |html|
121 // must be an empty string on error. 121 // must be an empty string on error.
122 void OnNavigationCorrectionsFetched(const std::string& corrections, 122 void OnNavigationCorrectionsFetched(const std::string& corrections,
123 const std::string& accept_languages, 123 const std::string& accept_languages,
124 bool is_rtl); 124 bool is_rtl);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 // Information for the committed error page. NULL when the committed page is 198 // Information for the committed error page. NULL when the committed page is
199 // not an error page. 199 // not an error page.
200 scoped_ptr<ErrorPageInfo> committed_error_page_info_; 200 scoped_ptr<ErrorPageInfo> committed_error_page_info_;
201 201
202 GURL navigation_correction_url_; 202 GURL navigation_correction_url_;
203 std::string language_; 203 std::string language_;
204 std::string country_code_; 204 std::string country_code_;
205 std::string api_key_; 205 std::string api_key_;
206 GURL search_url_; 206 GURL search_url_;
207 207
208 // True if auto-reload is enabled at all.
208 bool auto_reload_enabled_; 209 bool auto_reload_enabled_;
210
211 // Timer used to wait for auto-reload attempts.
209 scoped_ptr<base::Timer> auto_reload_timer_; 212 scoped_ptr<base::Timer> auto_reload_timer_;
210 213
214 // True if the auto-reload timer would be running but is waiting for an
215 // offline->online network transition.
216 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.
217
218 // 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.
219 // starting auto-reload when an error page finishes, in case this happens:
220 // Error page starts
221 // Error page commits
222 // Non-error page starts
223 // Error page finishes
224 bool uncommitted_load_started_;
225
211 // Is the browser online? 226 // Is the browser online?
212 bool online_; 227 bool online_;
213 228
214 int auto_reload_count_; 229 int auto_reload_count_;
215 bool can_auto_reload_page_;
216 230
217 // Non-NO_BUTTON only when a navigation has been initiated from the error 231 // Non-NO_BUTTON only when a navigation has been initiated from the error
218 // page. Used to detect when such navigations result in errors. 232 // page. Used to detect when such navigations result in errors.
219 Button navigation_from_button_; 233 Button navigation_from_button_;
220 }; 234 };
221 235
222 #endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_CORE_H_ 236 #endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_CORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698