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

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

Issue 10920024: Fix the fixme introduced in crrev.com/154287 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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/web_contents/navigation_controller_impl.cc
===================================================================
--- content/browser/web_contents/navigation_controller_impl.cc (revision 154300)
+++ content/browser/web_contents/navigation_controller_impl.cc (working copy)
@@ -684,9 +684,8 @@
// If we are doing a cross-site reload, we need to replace the existing
// navigation entry, not add another entry to the history. This has the side
// effect of removing forward browsing history, if such existed.
- if (pending_entry_ != NULL) {
- details->did_replace_entry = pending_entry_->is_cross_site_reload();
- }
+ details->did_replace_entry =
+ pending_entry_ && pending_entry_->is_cross_site_reload();
// is_in_page must be computed before the entry gets committed.
details->is_in_page = IsURLInPageNavigation(
@@ -697,7 +696,7 @@
switch (details->type) {
case content::NAVIGATION_TYPE_NEW_PAGE:
- RendererDidNavigateToNewPage(params, &(details->did_replace_entry));
+ RendererDidNavigateToNewPage(params, details->did_replace_entry);
break;
case content::NAVIGATION_TYPE_EXISTING_PAGE:
RendererDidNavigateToExistingPage(params);
@@ -706,7 +705,7 @@
RendererDidNavigateToSamePage(params);
break;
case content::NAVIGATION_TYPE_IN_PAGE:
- RendererDidNavigateInPage(params, &(details->did_replace_entry));
+ RendererDidNavigateInPage(params, &details->did_replace_entry);
break;
case content::NAVIGATION_TYPE_NEW_SUBFRAME:
RendererDidNavigateNewSubframe(params);
@@ -877,8 +876,10 @@
// the time this doesn't matter since WebKit doesn't tell us about subframe
// navigations that don't actually navigate, but it can happen when there is
// an encoding override (it always sends a navigation request).
- if (AreURLsInPageNavigation(existing_entry->GetURL(), params.url, false))
+ if (AreURLsInPageNavigation(existing_entry->GetURL(), params.url,
+ params.was_within_same_page)) {
return content::NAVIGATION_TYPE_IN_PAGE;
+ }
// Since we weeded out "new" navigations above, we know this is an existing
// (back/forward) navigation.
@@ -896,7 +897,7 @@
}
void NavigationControllerImpl::RendererDidNavigateToNewPage(
- const ViewHostMsg_FrameNavigate_Params& params, bool* did_replace_entry) {
+ const ViewHostMsg_FrameNavigate_Params& params, bool replace_entry) {
NavigationEntryImpl* new_entry;
bool update_virtual_url;
if (pending_entry_) {
@@ -932,7 +933,7 @@
new_entry->SetOriginalRequestURL(params.original_request_url);
new_entry->SetIsOverridingUserAgent(params.is_overriding_user_agent);
- InsertOrReplaceEntry(new_entry, *did_replace_entry);
+ InsertOrReplaceEntry(new_entry, replace_entry);
}
void NavigationControllerImpl::RendererDidNavigateToExistingPage(

Powered by Google App Engine
This is Rietveld 408576698