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

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

Issue 917043004: Mark error pages as such on Ctrl-Shift-T reload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments, add unit tests. Created 5 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: content/browser/frame_host/navigation_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 5c3f046e78f3aa954f1d220fb08fdcc5a0222ccb..4b21dee3d48fd1a11ceac826bd83084bf777800d 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1126,6 +1126,8 @@ void NavigationControllerImpl::RendererDidNavigateToExistingPage(
NavigationEntryImpl* entry = entries_[entry_index].get();
// The URL may have changed due to redirects.
+ if (params.url_is_unreachable)
+ entry->set_page_type(PAGE_TYPE_ERROR);
entry->SetURL(params.url);
entry->SetReferrer(params.referrer);
if (entry->update_virtual_url_with_url())
@@ -1178,6 +1180,8 @@ void NavigationControllerImpl::RendererDidNavigateToSamePage(
existing_entry->set_unique_id(pending_entry_->GetUniqueID());
// The URL may have changed due to redirects.
+ if (params.url_is_unreachable)
+ existing_entry->set_page_type(PAGE_TYPE_ERROR);
if (existing_entry->update_virtual_url_with_url())
UpdateVirtualURLToURL(existing_entry, params.url);
existing_entry->SetURL(params.url);
@@ -1204,6 +1208,10 @@ void NavigationControllerImpl::RendererDidNavigateInPage(
// entry and it will be the same page as the new navigation (minus the
// reference fragments, of course). We'll update the URL of the existing
// entry without pruning the forward history.
+ // TODO(wjmaclean): do we need an else-clause here to clear the entry, since
+ // it is persisted between navigations?
Charlie Reis 2015/02/18 01:01:53 This is a good question. Can you test this manual
wjmaclean 2015/02/18 19:10:11 After a manual test, there doesn't seem to be a di
Charlie Reis 2015/02/18 23:53:04 I think that's the right thing to do. Thanks for
+ if (params.url_is_unreachable)
+ existing_entry->set_page_type(PAGE_TYPE_ERROR);
existing_entry->SetURL(params.url);
if (existing_entry->update_virtual_url_with_url())
UpdateVirtualURLToURL(existing_entry, params.url);

Powered by Google App Engine
This is Rietveld 408576698