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

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

Issue 1048963002: Fix incorrect creation of duplicate navigation entries for repeated page load failures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@committype3
Patch Set: with more comment Created 5 years, 8 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
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_controller_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl.h
diff --git a/content/browser/frame_host/navigation_controller_impl.h b/content/browser/frame_host/navigation_controller_impl.h
index c7df11d36fa8b403ade443fcfea012aeda3a204b..da3bbd3c4e8831ac239d6a4cc6fb38d2c3a6e7da 100644
--- a/content/browser/frame_host/navigation_controller_impl.h
+++ b/content/browser/frame_host/navigation_controller_impl.h
@@ -199,8 +199,9 @@ class CONTENT_EXPORT NavigationControllerImpl
// that.
void SetScreenshotManager(NavigationEntryScreenshotManager* manager);
- // Discards only the pending entry.
- void DiscardPendingEntry();
+ // Discards only the pending entry. |was_failure| should be set if the pending
+ // entry is being discarded because it failed to load.
+ void DiscardPendingEntry(bool was_failure);
private:
friend class RestoreHelper;
@@ -345,11 +346,23 @@ class CONTENT_EXPORT NavigationControllerImpl
// the memory management.
NavigationEntryImpl* pending_entry_;
- // currently visible entry
+ // If a new entry fails loading, details about it are temporarily held here
+ // until the error page is shown. These variables are only valid if
+ // |failed_pending_entry_id_| is not 0.
+ //
+ // TODO(avi): We need a better way to handle the connection between failed
+ // loads and the subsequent load of the error page. This current approach has
+ // issues: 1. This might hang around longer than we'd like if there is no
+ // error page loaded, and 2. This doesn't work very well for frames.
+ // http://crbug.com/474261
+ int failed_pending_entry_id_;
+ bool failed_pending_entry_should_replace_;
+
+ // The index of the currently visible entry.
int last_committed_entry_index_;
- // index of pending entry if it is in entries_, or -1 if pending_entry_ is a
- // new entry (created by LoadURL).
+ // The index of the pending entry if it is in entries_, or -1 if
+ // pending_entry_ is a new entry (created by LoadURL).
int pending_entry_index_;
// The index for the entry that is shown until a navigation occurs. This is
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698