Chromium Code Reviews| 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 <iterator> | 7 #include <iterator> |
| 8 | 8 |
| 9 #include "base/debug/dump_without_crashing.h" | 9 #include "base/debug/dump_without_crashing.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 729 // | 729 // |
| 730 // Similarly, HTTP 204 (No Content) responses leave the renderer showing the | 730 // Similarly, HTTP 204 (No Content) responses leave the renderer showing the |
| 731 // previous page. The navigation should be allowed to finish without running | 731 // previous page. The navigation should be allowed to finish without running |
| 732 // the unload handler or swapping in the pending RenderFrameHost. | 732 // the unload handler or swapping in the pending RenderFrameHost. |
| 733 if (is_download_ || is_stream_ || | 733 if (is_download_ || is_stream_ || |
| 734 (response_headers_.get() && response_headers_->response_code() == 204)) { | 734 (response_headers_.get() && response_headers_->response_code() == 204)) { |
| 735 return true; | 735 return true; |
| 736 } | 736 } |
| 737 | 737 |
| 738 // The content embedder can decide that a transfer to a different process is | 738 // The content embedder can decide that a transfer to a different process is |
| 739 // required for this URL. | 739 // required for this URL. Start the transfer if needed. |
| 740 bool should_transfer = | 740 if (GetContentClient()->browser()->ShouldSwapProcessesForRedirect( |
| 741 GetContentClient()->browser()->ShouldSwapProcessesForRedirect( | |
| 742 frame_tree_node_->navigator()->GetController()->GetBrowserContext(), | 741 frame_tree_node_->navigator()->GetController()->GetBrowserContext(), |
| 743 original_url_, url_); | 742 original_url_, url_)) { |
| 744 | |
| 745 RenderFrameHostManager* manager = | |
| 746 render_frame_host_->frame_tree_node()->render_manager(); | |
| 747 | |
| 748 // In the site-per-process model, the RenderFrameHostManager may also decide | |
| 749 // (independently from the content embedder's ShouldSwapProcessesForRedirect | |
| 750 // above) that a process transfer is needed. Process transfers are skipped for | |
| 751 // WebUI processes for now, since e.g. chrome://settings has multiple | |
| 752 // "cross-site" chrome:// frames, and that doesn't yet work cross-process. | |
| 753 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() && | |
| 754 !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | |
|
Charlie Reis
2017/01/21 00:46:44
Removing this whole block looks wrong to me. I ex
nasko
2017/01/23 16:51:49
Yes, you are correct. I thought I ran successfully
| |
| 755 render_frame_host_->GetProcess()->GetID())) { | |
| 756 should_transfer |= manager->IsRendererTransferNeededForNavigation( | |
| 757 render_frame_host_, url_); | |
| 758 } | |
| 759 | |
| 760 // Start the transfer if needed. | |
| 761 if (should_transfer) { | |
| 762 // This may destroy the NavigationHandle if the transfer fails. | 743 // This may destroy the NavigationHandle if the transfer fails. |
| 763 base::WeakPtr<NavigationHandleImpl> weak_self = weak_factory_.GetWeakPtr(); | 744 base::WeakPtr<NavigationHandleImpl> weak_self = weak_factory_.GetWeakPtr(); |
| 764 manager->OnCrossSiteResponse(render_frame_host_, request_id_, | 745 render_frame_host_->frame_tree_node() |
| 765 redirect_chain_, sanitized_referrer_, | 746 ->render_manager() |
| 766 transition_, should_replace_current_entry_); | 747 ->OnCrossSiteResponse(render_frame_host_, request_id_, redirect_chain_, |
| 748 sanitized_referrer_, transition_, | |
| 749 should_replace_current_entry_); | |
| 767 if (!weak_self) | 750 if (!weak_self) |
| 768 return false; | 751 return false; |
| 769 } | 752 } |
| 770 | 753 |
| 771 return true; | 754 return true; |
| 772 } | 755 } |
| 773 | 756 |
| 774 void NavigationHandleImpl::RunCompleteCallback( | 757 void NavigationHandleImpl::RunCompleteCallback( |
| 775 NavigationThrottle::ThrottleCheckResult result) { | 758 NavigationThrottle::ThrottleCheckResult result) { |
| 776 DCHECK(result != NavigationThrottle::DEFER); | 759 DCHECK(result != NavigationThrottle::DEFER); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 806 content::AncestorThrottle::MaybeCreateThrottleFor(this); | 789 content::AncestorThrottle::MaybeCreateThrottleFor(this); |
| 807 if (ancestor_throttle) | 790 if (ancestor_throttle) |
| 808 throttles_.push_back(std::move(ancestor_throttle)); | 791 throttles_.push_back(std::move(ancestor_throttle)); |
| 809 | 792 |
| 810 throttles_.insert(throttles_.begin(), | 793 throttles_.insert(throttles_.begin(), |
| 811 std::make_move_iterator(throttles_to_register.begin()), | 794 std::make_move_iterator(throttles_to_register.begin()), |
| 812 std::make_move_iterator(throttles_to_register.end())); | 795 std::make_move_iterator(throttles_to_register.end())); |
| 813 } | 796 } |
| 814 | 797 |
| 815 } // namespace content | 798 } // namespace content |
| OLD | NEW |