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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1309323004: Create a NavigationEntry for the initial blank page. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GetEntryCount, more tests Created 5 years, 2 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 | « content/public/browser/navigation_type.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 339d818953fafa5f75e9d3819d5bcdec2c2aae70..ad34b51e754d97b29942d3f82d617fde054efbfd 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2722,6 +2722,17 @@ void RenderFrameImpl::didCommitProvisionalLoad(
NavigationStateImpl* navigation_state =
static_cast<NavigationStateImpl*>(document_state->navigation_state());
+ // We may see a "commit" for the initial blank page (e.g., when opening a
+ // popup with no URL). This should not count as a navigation. (Note that
+ // subsequent about:blank navigations marked as WebStandardCommit do count as
+ // new navigations and remain in history.)
+ if (render_view_->history_list_length_ == 0 &&
+ !frame->parent() &&
+ commit_type != blink::WebStandardCommit &&
+ navigation_state->request_params().nav_entry_id == 0 &&
+ GetLoadingUrl() == GURL(url::kAboutBlankURL))
+ return;
+
if (proxy_routing_id_ != MSG_ROUTING_NONE) {
RenderFrameProxy* proxy =
RenderFrameProxy::FromRoutingID(proxy_routing_id_);
@@ -4612,8 +4623,6 @@ void RenderFrameImpl::NavigateInternal(
}
should_load_request = true;
} else if (is_history_navigation) {
- // We must know the page ID of the page we are navigating back to.
- DCHECK_NE(request_params.page_id, -1);
// We must know the nav entry ID of the page we are navigating back to,
// which should be the case because history navigations are routed via the
// browser.
« no previous file with comments | « content/public/browser/navigation_type.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698