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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2253233002: Don't mark navigations as in-page when DSNs are mismatched. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5512 matching lines...) Expand 10 before | Expand all | Expand 10 after
5523 history_load_type = request_params.is_same_document_history_load 5523 history_load_type = request_params.is_same_document_history_load
5524 ? blink::WebHistorySameDocumentLoad 5524 ? blink::WebHistorySameDocumentLoad
5525 : blink::WebHistoryDifferentDocumentLoad; 5525 : blink::WebHistoryDifferentDocumentLoad;
5526 load_type = request_params.is_history_navigation_in_new_child 5526 load_type = request_params.is_history_navigation_in_new_child
5527 ? blink::WebFrameLoadType::InitialHistoryLoad 5527 ? blink::WebFrameLoadType::InitialHistoryLoad
5528 : blink::WebFrameLoadType::BackForward; 5528 : blink::WebFrameLoadType::BackForward;
5529 should_load_request = true; 5529 should_load_request = true;
5530 5530
5531 // If this is marked as a same document load but we haven't committed 5531 // If this is marked as a same document load but we haven't committed
5532 // anything, treat it as a new load. The browser shouldn't let this 5532 // anything, treat it as a new load. The browser shouldn't let this
5533 // happen. 5533 // happen. Also treat it as a new load, if the DSN in
5534 // TODO(creis): Add a similar check if the DSN doesn't match, and add a 5534 // |current_history_item_| and the item navigated to mismatch.
5535 // NOTREACHED when we're confident this won't happen. 5535 if (history_load_type == blink::WebHistorySameDocumentLoad) {
5536 if (history_load_type == blink::WebHistorySameDocumentLoad && 5536 if (current_history_item_.isNull()) {
5537 current_history_item_.isNull()) { 5537 history_load_type = blink::WebHistoryDifferentDocumentLoad;
5538 history_load_type = blink::WebHistoryDifferentDocumentLoad; 5538 } else if (current_history_item_.documentSequenceNumber() !=
5539 item_for_history_navigation.documentSequenceNumber()) {
5540 history_load_type = blink::WebHistoryDifferentDocumentLoad;
5541 NOTREACHED();
Charlie Reis 2016/08/22 12:20:21 I don't think we can have a NOTREACHED in this cas
5542 }
5539 } 5543 }
5540 5544
5541 // If this navigation is to a history item for a new child frame, we may 5545 // If this navigation is to a history item for a new child frame, we may
5542 // want to ignore it in some cases. If a Javascript navigation (i.e., 5546 // want to ignore it in some cases. If a Javascript navigation (i.e.,
5543 // client redirect) interrupted it and has either been scheduled, 5547 // client redirect) interrupted it and has either been scheduled,
5544 // started loading, or has committed, we should ignore the history item. 5548 // started loading, or has committed, we should ignore the history item.
5545 // Similarly, if the history item just says to stay on about:blank, 5549 // Similarly, if the history item just says to stay on about:blank,
5546 // don't load it again, which might clobber injected content. 5550 // don't load it again, which might clobber injected content.
5547 bool interrupted_by_client_redirect = 5551 bool interrupted_by_client_redirect =
5548 frame_->isNavigationScheduledWithin(0) || 5552 frame_->isNavigationScheduledWithin(0) ||
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
6343 // event target. Potentially a Pepper plugin will receive the event. 6347 // event target. Potentially a Pepper plugin will receive the event.
6344 // In order to tell whether a plugin gets the last mouse event and which it 6348 // In order to tell whether a plugin gets the last mouse event and which it
6345 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6349 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6346 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6350 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6347 // |pepper_last_mouse_event_target_|. 6351 // |pepper_last_mouse_event_target_|.
6348 pepper_last_mouse_event_target_ = nullptr; 6352 pepper_last_mouse_event_target_ = nullptr;
6349 #endif 6353 #endif
6350 } 6354 }
6351 6355
6352 } // namespace content 6356 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698