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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 874743003: Revert of Remove the use of page id from building the commit params. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/renderer/render_frame_impl.h ('k') | content/renderer/render_view_impl.h » ('j') | 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 366c7030e004a8327b3e05ce97282154e43215e1..8fa21dc458b1cac2fe80adfc54126e31a35d352e 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2555,7 +2555,7 @@
// new navigation.
navigation_state->set_request_committed(true);
- SendDidCommitProvisionalLoad(frame, commit_type);
+ SendDidCommitProvisionalLoad(frame);
// Check whether we have new encoding name.
UpdateEncoding(frame, frame->view()->pageEncoding().utf8());
@@ -3619,9 +3619,7 @@
}
// Tell the embedding application that the URL of the active page has changed.
-void RenderFrameImpl::SendDidCommitProvisionalLoad(
- blink::WebFrame* frame,
- blink::WebHistoryCommitType commit_type) {
+void RenderFrameImpl::SendDidCommitProvisionalLoad(blink::WebFrame* frame) {
DCHECK(!frame_ || frame_ == frame);
WebDataSource* ds = frame->dataSource();
DCHECK(ds);
@@ -3684,7 +3682,7 @@
render_view_->navigation_gesture_ = NavigationGestureUnknown;
// Make navigation state a part of the DidCommitProvisionalLoad message so
- // that committed entry has it at all times.
+ // that commited entry has it at all times.
HistoryEntry* entry = render_view_->history_controller()->GetCurrentEntry();
if (entry)
params.page_state = HistoryEntryToPageState(entry);
@@ -3789,12 +3787,13 @@
// Subframe navigation: the type depends on whether this navigation
// generated a new session history entry. When they do generate a session
// history entry, it means the user initiated the navigation and we should
- // mark it as such.
- bool is_history_navigation = commit_type == blink::WebBackForwardCommit;
- if (is_history_navigation || ds->replacesCurrentHistoryItem())
+ // mark it as such. This test checks if this is the first time
+ // SendDidCommitProvisionalLoad has been called since WillNavigateToURL was
+ // called to initiate the load.
+ if (render_view_->page_id_ > render_view_->last_page_id_sent_to_browser_)
+ params.transition = ui::PAGE_TRANSITION_MANUAL_SUBFRAME;
+ else
params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME;
- else
- params.transition = ui::PAGE_TRANSITION_MANUAL_SUBFRAME;
DCHECK(!navigation_state->history_list_was_cleared());
params.history_list_was_cleared = false;
@@ -3804,6 +3803,10 @@
if (!is_swapped_out())
Send(new FrameHostMsg_DidCommitProvisionalLoad(routing_id_, params));
}
+
+ render_view_->last_page_id_sent_to_browser_ =
+ std::max(render_view_->last_page_id_sent_to_browser_,
+ render_view_->page_id_);
// If we end up reusing this WebRequest (for example, due to a #ref click),
// we don't want the transition type to persist. Just clear it.
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698