OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/navigation_handle_impl.h" | 5 #include "content/browser/frame_host/navigation_handle_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "content/browser/browsing_data/clear_site_data_throttle.h" | 10 #include "content/browser/browsing_data/clear_site_data_throttle.h" |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
658 // The content embedder can decide that a transfer to a different process is | 658 // The content embedder can decide that a transfer to a different process is |
659 // required for this URL. | 659 // required for this URL. |
660 bool should_transfer = | 660 bool should_transfer = |
661 GetContentClient()->browser()->ShouldSwapProcessesForRedirect( | 661 GetContentClient()->browser()->ShouldSwapProcessesForRedirect( |
662 frame_tree_node_->navigator()->GetController()->GetBrowserContext(), | 662 frame_tree_node_->navigator()->GetController()->GetBrowserContext(), |
663 original_url_, url_); | 663 original_url_, url_); |
664 | 664 |
665 RenderFrameHostManager* manager = | 665 RenderFrameHostManager* manager = |
666 render_frame_host_->frame_tree_node()->render_manager(); | 666 render_frame_host_->frame_tree_node()->render_manager(); |
667 | 667 |
668 // It is possible for the RenderFrameHost to have been marked as pending | |
669 // deletion following the commit of another ongoing navigation. In that case, | |
670 // don't attempt to transfer, but don't resume the navigation either. | |
671 if (render_frame_host_ != manager->current_frame_host() && | |
Charlie Reis
2016/09/30 20:25:26
We used to use is_active() for this (in OnCrossSit
clamy
2016/10/04 11:54:41
Acknowledged.
| |
672 render_frame_host_ != manager->pending_frame_host()) { | |
673 return false; | |
clamy
2016/09/30 14:06:15
This will just suspend the navigation. Alternative
Charlie Reis
2016/09/30 20:25:26
We definitely want to cancel the navigation. The
nasko
2016/09/30 23:21:33
+1 on cancelling the navigation. Keeping it suspen
clamy
2016/10/04 11:54:41
Done. The cancellation if the NavigationHandle isn
| |
674 } | |
675 | |
668 // In the site-per-process model, the RenderFrameHostManager may also decide | 676 // In the site-per-process model, the RenderFrameHostManager may also decide |
669 // (independently from the content embedder's ShouldSwapProcessesForRedirect | 677 // (independently from the content embedder's ShouldSwapProcessesForRedirect |
670 // above) that a process transfer is needed. Process transfers are skipped for | 678 // above) that a process transfer is needed. Process transfers are skipped for |
671 // WebUI processes for now, since e.g. chrome://settings has multiple | 679 // WebUI processes for now, since e.g. chrome://settings has multiple |
672 // "cross-site" chrome:// frames, and that doesn't yet work cross-process. | 680 // "cross-site" chrome:// frames, and that doesn't yet work cross-process. |
673 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() && | 681 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() && |
674 !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 682 !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
675 render_frame_host_->GetProcess()->GetID())) { | 683 render_frame_host_->GetProcess()->GetID())) { |
676 should_transfer |= manager->IsRendererTransferNeededForNavigation( | 684 should_transfer |= manager->IsRendererTransferNeededForNavigation( |
677 render_frame_host_, url_); | 685 render_frame_host_, url_); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
723 throttles_to_register.push_back(std::move(clear_site_data_throttle)); | 731 throttles_to_register.push_back(std::move(clear_site_data_throttle)); |
724 | 732 |
725 if (throttles_to_register.size() > 0) { | 733 if (throttles_to_register.size() > 0) { |
726 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), | 734 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), |
727 throttles_to_register.end()); | 735 throttles_to_register.end()); |
728 throttles_to_register.weak_clear(); | 736 throttles_to_register.weak_clear(); |
729 } | 737 } |
730 } | 738 } |
731 | 739 |
732 } // namespace content | 740 } // namespace content |
OLD | NEW |