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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2316133003: Don't mark navigations as in-page when DSNs are mismatched. (Closed)
Patch Set: Disable the new test in PlzNavigate, until I can investigate the cause of the failure. Created 4 years, 3 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/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 4c5d7a3e37e4de3e3fa88be809293cc7e867c2ec..1fd0a0139f5eafdb4d2fe205ee1995727a545ef9 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -5539,14 +5539,22 @@ void RenderFrameImpl::NavigateInternal(
: blink::WebFrameLoadType::BackForward;
should_load_request = true;
- // If this is marked as a same document load but we haven't committed
- // anything, treat it as a new load. The browser shouldn't let this
- // happen.
- // TODO(creis): Add a similar check if the DSN doesn't match, and add a
- // NOTREACHED when we're confident this won't happen.
Charlie Reis 2016/09/07 17:42:09 I don't want to lose track of adding a NOTREACHED
- if (history_load_type == blink::WebHistorySameDocumentLoad &&
- current_history_item_.isNull()) {
- history_load_type = blink::WebHistoryDifferentDocumentLoad;
+ if (history_load_type == blink::WebHistorySameDocumentLoad) {
+ // If this is marked as a same document load but we haven't committed
+ // anything, treat it as a new load. The browser shouldn't let this
+ // happen.
+ if (current_history_item_.isNull()) {
+ history_load_type = blink::WebHistoryDifferentDocumentLoad;
+ } else {
+ // Additionally, if the |current_history_item_|'s document
+ // sequence number doesn't match the one sent from the browser, it
+ // is possible that this renderer has committed a different
+ // document. In such case, don't use WebHistorySameDocumentLoad.
+ if (current_history_item_.documentSequenceNumber() !=
+ item_for_history_navigation.documentSequenceNumber()) {
+ history_load_type = blink::WebHistoryDifferentDocumentLoad;
+ }
+ }
}
// If this navigation is to a history item for a new child frame, we may

Powered by Google App Engine
This is Rietveld 408576698