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

Unified Diff: content/browser/frame_host/navigation_handle_impl.cc

Issue 2345913002: Fix NetErrorTabHelper with PlzNavigate. (Closed)
Patch Set: fix NavigationHandle::IsErrorPage for reloads of error pages Created 4 years, 3 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: content/browser/frame_host/navigation_handle_impl.cc
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index b95c691e3975168323163d65aa0197dbfcc15462..cd75c0ffbc6a252bda93a53090708c90d00ddfdd 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -18,6 +18,7 @@
#include "content/public/browser/content_browser_client.h"
#include "content/public/common/browser_side_navigation_policy.h"
#include "content/public/common/content_client.h"
+#include "content/public/common/url_constants.h"
#include "net/url_request/redirect_info.h"
#include "url/gurl.h"
#include "url/url_constants.h"
@@ -461,7 +462,14 @@ void NavigationHandleImpl::DidCommitNavigation(
render_frame_host_ = render_frame_host;
is_same_page_ = same_page;
- state_ = net_error_code_ == net::OK ? DID_COMMIT : DID_COMMIT_ERROR_PAGE;
+ // If an error page reloads, net_error_code might be 200 but we still want to
clamy 2016/09/19 11:46:44 nit: no "we" in comments?
jam 2016/09/19 14:19:40 I realize some people think it's unambiguous in so
clamy 2016/09/19 15:27:11 Acknowledged.
+ // count it as an error page.
+ if (params.base_url.spec() == kUnreachableWebDataURL ||
clamy 2016/09/19 11:46:44 When we reload the error page, do we know at the s
jam 2016/09/19 14:19:40 It's not known at the start (because the url is th
clamy 2016/09/19 15:27:11 Acknowledged.
+ net_error_code_ != net::OK) {
+ state_ = DID_COMMIT_ERROR_PAGE;
+ } else {
+ state_ = DID_COMMIT;
+ }
}
NavigationThrottle::ThrottleCheckResult

Powered by Google App Engine
This is Rietveld 408576698