OLD | NEW |
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/browser/frame_host/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 render_frame_host->frame_tree_node()->SetCurrentOrigin( | 611 render_frame_host->frame_tree_node()->SetCurrentOrigin( |
612 params.origin, params.has_potentially_trustworthy_unique_origin); | 612 params.origin, params.has_potentially_trustworthy_unique_origin); |
613 | 613 |
614 render_frame_host->frame_tree_node()->SetInsecureRequestPolicy( | 614 render_frame_host->frame_tree_node()->SetInsecureRequestPolicy( |
615 params.insecure_request_policy); | 615 params.insecure_request_policy); |
616 | 616 |
617 // Navigating to a new location means a new, fresh set of http headers and/or | 617 // Navigating to a new location means a new, fresh set of http headers and/or |
618 // <meta> elements - we need to reset CSP and Feature Policy. | 618 // <meta> elements - we need to reset CSP and Feature Policy. |
619 if (!is_navigation_within_page) { | 619 if (!is_navigation_within_page) { |
620 render_frame_host->frame_tree_node()->ResetContentSecurityPolicy(); | 620 render_frame_host->frame_tree_node()->ResetContentSecurityPolicy(); |
621 render_frame_host->frame_tree_node()->ResetFeaturePolicy(); | 621 render_frame_host->frame_tree_node()->ResetFeaturePolicyHeader(); |
622 } | 622 } |
623 | 623 |
624 // When using --site-per-process, we notify the RFHM for all navigations, | 624 // When using --site-per-process, we notify the RFHM for all navigations, |
625 // not just main frame navigations. | 625 // not just main frame navigations. |
626 if (oopifs_possible) { | 626 if (oopifs_possible) { |
627 FrameTreeNode* frame = render_frame_host->frame_tree_node(); | 627 FrameTreeNode* frame = render_frame_host->frame_tree_node(); |
628 frame->render_manager()->DidNavigateFrame( | 628 frame->render_manager()->DidNavigateFrame( |
629 render_frame_host, params.gesture == NavigationGestureUser); | 629 render_frame_host, params.gesture == NavigationGestureUser); |
630 } | 630 } |
631 | 631 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 // Separately, update the frame's last successful URL except for net error | 681 // Separately, update the frame's last successful URL except for net error |
682 // pages, since those do not end up in the correct process after transfers | 682 // pages, since those do not end up in the correct process after transfers |
683 // (see https://crbug.com/560511). Instead, the next cross-process navigation | 683 // (see https://crbug.com/560511). Instead, the next cross-process navigation |
684 // or transfer should decide whether to swap as if the net error had not | 684 // or transfer should decide whether to swap as if the net error had not |
685 // occurred. | 685 // occurred. |
686 // TODO(creis): Remove this block and always set the URL once transfers handle | 686 // TODO(creis): Remove this block and always set the URL once transfers handle |
687 // network errors or PlzNavigate is enabled. See https://crbug.com/588314. | 687 // network errors or PlzNavigate is enabled. See https://crbug.com/588314. |
688 if (!params.url_is_unreachable) | 688 if (!params.url_is_unreachable) |
689 render_frame_host->set_last_successful_url(params.url); | 689 render_frame_host->set_last_successful_url(params.url); |
690 | 690 |
| 691 // After setting the last committed origin, reset the feature policy in the |
| 692 // RenderFrameHost to a blank policy based on the parent frame. |
| 693 render_frame_host->ResetFeaturePolicy(); |
| 694 |
691 // Send notification about committed provisional loads. This notification is | 695 // Send notification about committed provisional loads. This notification is |
692 // different from the NAV_ENTRY_COMMITTED notification which doesn't include | 696 // different from the NAV_ENTRY_COMMITTED notification which doesn't include |
693 // the actual URL navigated to and isn't sent for AUTO_SUBFRAME navigations. | 697 // the actual URL navigated to and isn't sent for AUTO_SUBFRAME navigations. |
694 if (details.type != NAVIGATION_TYPE_NAV_IGNORE && delegate_) { | 698 if (details.type != NAVIGATION_TYPE_NAV_IGNORE && delegate_) { |
695 DCHECK_EQ(!render_frame_host->GetParent(), | 699 DCHECK_EQ(!render_frame_host->GetParent(), |
696 did_navigate ? details.is_main_frame : false); | 700 did_navigate ? details.is_main_frame : false); |
697 ui::PageTransition transition_type = params.transition; | 701 ui::PageTransition transition_type = params.transition; |
698 // Whether or not a page transition was triggered by going backward or | 702 // Whether or not a page transition was triggered by going backward or |
699 // forward in the history is only stored in the navigation controller's | 703 // forward in the history is only stored in the navigation controller's |
700 // entry list. | 704 // entry list. |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 if (navigation_handle) | 1325 if (navigation_handle) |
1322 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); | 1326 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); |
1323 | 1327 |
1324 controller_->SetPendingEntry(std::move(entry)); | 1328 controller_->SetPendingEntry(std::move(entry)); |
1325 if (delegate_) | 1329 if (delegate_) |
1326 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 1330 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
1327 } | 1331 } |
1328 } | 1332 } |
1329 | 1333 |
1330 } // namespace content | 1334 } // namespace content |
OLD | NEW |