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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 5521 matching lines...) Expand 10 before | Expand all | Expand 10 after
5532 // PageState. 5532 // PageState.
5533 item_for_history_navigation = entry->root(); 5533 item_for_history_navigation = entry->root();
5534 history_load_type = request_params.is_same_document_history_load 5534 history_load_type = request_params.is_same_document_history_load
5535 ? blink::WebHistorySameDocumentLoad 5535 ? blink::WebHistorySameDocumentLoad
5536 : blink::WebHistoryDifferentDocumentLoad; 5536 : blink::WebHistoryDifferentDocumentLoad;
5537 load_type = request_params.is_history_navigation_in_new_child 5537 load_type = request_params.is_history_navigation_in_new_child
5538 ? blink::WebFrameLoadType::InitialHistoryLoad 5538 ? blink::WebFrameLoadType::InitialHistoryLoad
5539 : blink::WebFrameLoadType::BackForward; 5539 : blink::WebFrameLoadType::BackForward;
5540 should_load_request = true; 5540 should_load_request = true;
5541 5541
5542 // If this is marked as a same document load but we haven't committed 5542 if (history_load_type == blink::WebHistorySameDocumentLoad) {
5543 // anything, treat it as a new load. The browser shouldn't let this 5543 // If this is marked as a same document load but we haven't committed
5544 // happen. 5544 // anything, treat it as a new load. The browser shouldn't let this
5545 // TODO(creis): Add a similar check if the DSN doesn't match, and add a 5545 // happen.
5546 // NOTREACHED when we're confident this won't happen. 5546 if (current_history_item_.isNull()) {
Charlie Reis 2016/09/07 17:42:09 I don't want to lose track of adding a NOTREACHED
5547 if (history_load_type == blink::WebHistorySameDocumentLoad && 5547 history_load_type = blink::WebHistoryDifferentDocumentLoad;
5548 current_history_item_.isNull()) { 5548 } else {
5549 history_load_type = blink::WebHistoryDifferentDocumentLoad; 5549 // Additionally, if the |current_history_item_|'s document
5550 // sequence number doesn't match the one sent from the browser, it
5551 // is possible that this renderer has committed a different
5552 // document. In such case, don't use WebHistorySameDocumentLoad.
5553 if (current_history_item_.documentSequenceNumber() !=
5554 item_for_history_navigation.documentSequenceNumber()) {
5555 history_load_type = blink::WebHistoryDifferentDocumentLoad;
5556 }
5557 }
5550 } 5558 }
5551 5559
5552 // If this navigation is to a history item for a new child frame, we may 5560 // If this navigation is to a history item for a new child frame, we may
5553 // want to ignore it in some cases. If a Javascript navigation (i.e., 5561 // want to ignore it in some cases. If a Javascript navigation (i.e.,
5554 // client redirect) interrupted it and has either been scheduled, 5562 // client redirect) interrupted it and has either been scheduled,
5555 // started loading, or has committed, we should ignore the history item. 5563 // started loading, or has committed, we should ignore the history item.
5556 // Similarly, if the history item just says to stay on about:blank, 5564 // Similarly, if the history item just says to stay on about:blank,
5557 // don't load it again, which might clobber injected content. 5565 // don't load it again, which might clobber injected content.
5558 bool interrupted_by_client_redirect = 5566 bool interrupted_by_client_redirect =
5559 frame_->isNavigationScheduledWithin(0) || 5567 frame_->isNavigationScheduledWithin(0) ||
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
6351 // event target. Potentially a Pepper plugin will receive the event. 6359 // event target. Potentially a Pepper plugin will receive the event.
6352 // In order to tell whether a plugin gets the last mouse event and which it 6360 // In order to tell whether a plugin gets the last mouse event and which it
6353 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6361 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6354 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6362 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6355 // |pepper_last_mouse_event_target_|. 6363 // |pepper_last_mouse_event_target_|.
6356 pepper_last_mouse_event_target_ = nullptr; 6364 pepper_last_mouse_event_target_ = nullptr;
6357 #endif 6365 #endif
6358 } 6366 }
6359 6367
6360 } // namespace content 6368 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698