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

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

Issue 1184423005: Add item and document sequence numbers to FrameNavigationEntry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 0491cfb0794e3e3b497d048ce104a8d52b42f3e6..0c2ac1cd6dfb4c5efc7c2b70fa357f8c7e4723e0 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -808,8 +808,9 @@ bool NavigationControllerImpl::RendererDidNavigate(
new_type == NAVIGATION_TYPE_AUTO_SUBFRAME;
ignore_mismatch |= details->type == NAVIGATION_TYPE_NAV_IGNORE &&
new_type == NAVIGATION_TYPE_AUTO_SUBFRAME;
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ bool is_site_per_process = base::CommandLine::ForCurrentProcess()->HasSwitch(
Charlie Reis 2015/06/17 22:56:23 I'll undo this. (I was using it below in an earli
Avi (use Gerrit) 2015/06/18 00:57:00 Acknowledged.
Charlie Reis 2015/06/18 20:30:17 Done.
+ switches::kSitePerProcess);
+ if (is_site_per_process) {
// We know that the old classifier is wrong for OOPIFs, so use the new one
// in --site-per-process mode.
details->type = new_type;
@@ -1223,6 +1224,11 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
new_entry->SetOriginalRequestURL(params.original_request_url);
new_entry->SetIsOverridingUserAgent(params.is_overriding_user_agent);
+ // Update the FrameNavigationEntry for new main frame commits.
+ FrameNavigationEntry* frame_entry = new_entry->root_node()->frame_entry.get();
+ frame_entry->set_item_sequence_number(params.item_sequence_number);
+ frame_entry->set_document_sequence_number(params.document_sequence_number);
+
// history.pushState() is classified as a navigation to a new page, but
// sets was_within_same_page to true. In this case, we already have the
// title and favicon available, so set them immediately.
@@ -1399,8 +1405,9 @@ void NavigationControllerImpl::RendererDidNavigateNewSubframe(
switches::kSitePerProcess)) {
// Make sure new_entry takes ownership of frame_entry in a scoped_refptr.
FrameNavigationEntry* frame_entry = new FrameNavigationEntry(
- rfh->frame_tree_node()->frame_tree_node_id(), rfh->GetSiteInstance(),
- params.url, params.referrer);
+ rfh->frame_tree_node()->frame_tree_node_id(),
+ params.item_sequence_number, params.document_sequence_number,
+ rfh->GetSiteInstance(), params.url, params.referrer);
new_entry = GetLastCommittedEntry()->CloneAndReplace(rfh->frame_tree_node(),
frame_entry);
CHECK(frame_entry->HasOneRef());
@@ -1456,6 +1463,8 @@ bool NavigationControllerImpl::RendererDidNavigateAutoSubframe(
// it may be a "history auto" case where we update an existing one.
NavigationEntryImpl* last_committed = GetLastCommittedEntry();
last_committed->AddOrUpdateFrameEntry(rfh->frame_tree_node(),
+ params.item_sequence_number,
+ params.document_sequence_number,
rfh->GetSiteInstance(), params.url,
params.referrer, params.page_state);

Powered by Google App Engine
This is Rietveld 408576698