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

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

Issue 1902433002: Do not create pending NavigationEntry when a transient one is present. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 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 | « chrome/test/data/window_open_and_navigate.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 755178be9cc0210776f06636a7eb7406c4c7c672..35ee34045fe2e103feba01397def76930c1c261f 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -1024,7 +1024,12 @@ void NavigatorImpl::DidStartMainFrameNavigation(
NavigationEntryImpl* pending_entry = controller_->GetPendingEntry();
bool has_browser_initiated_pending_entry =
pending_entry && !pending_entry->is_renderer_initiated();
- if (!has_browser_initiated_pending_entry) {
+
+ // If there is a transient entry, creating a new pending entry will result
+ // in deleting it, which leads to inconsistent state.
+ bool has_transient_entry = !!controller_->GetTransientEntry();
+
+ if (!has_browser_initiated_pending_entry && !has_transient_entry) {
scoped_ptr<NavigationEntryImpl> entry =
NavigationEntryImpl::FromNavigationEntry(
controller_->CreateNavigationEntry(
« no previous file with comments | « chrome/test/data/window_open_and_navigate.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698