| 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/browser/appcache/appcache_navigation_handle.h" | 10 #include "content/browser/appcache/appcache_navigation_handle.h" |
| (...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 // see it is a download and abort the request. | 908 // see it is a download and abort the request. |
| 909 // | 909 // |
| 910 // Similarly, HTTP 204 (No Content) responses leave the renderer showing the | 910 // Similarly, HTTP 204 (No Content) responses leave the renderer showing the |
| 911 // previous page. The navigation should be allowed to finish without running | 911 // previous page. The navigation should be allowed to finish without running |
| 912 // the unload handler or swapping in the pending RenderFrameHost. | 912 // the unload handler or swapping in the pending RenderFrameHost. |
| 913 if (is_download_ || is_stream_ || | 913 if (is_download_ || is_stream_ || |
| 914 (response_headers_.get() && response_headers_->response_code() == 204)) { | 914 (response_headers_.get() && response_headers_->response_code() == 204)) { |
| 915 return true; | 915 return true; |
| 916 } | 916 } |
| 917 | 917 |
| 918 // The content embedder can decide that a transfer to a different process is | 918 // In the site-per-process model, the RenderFrameHostManager may decide |
| 919 // required for this URL. | 919 // that a process transfer is needed. Process transfers are skipped for |
| 920 bool should_transfer = | 920 // WebUI processes for now, since e.g. chrome://settings has multiple |
| 921 GetContentClient()->browser()->ShouldSwapProcessesForRedirect( | 921 // "cross-site" chrome:// frames, and that doesn't yet work cross-process. |
| 922 frame_tree_node_->navigator()->GetController()->GetBrowserContext(), | 922 bool should_transfer = false; |
| 923 original_url_, url_); | |
| 924 | |
| 925 RenderFrameHostManager* manager = | 923 RenderFrameHostManager* manager = |
| 926 render_frame_host_->frame_tree_node()->render_manager(); | 924 render_frame_host_->frame_tree_node()->render_manager(); |
| 927 | |
| 928 // In the site-per-process model, the RenderFrameHostManager may also decide | |
| 929 // (independently from the content embedder's ShouldSwapProcessesForRedirect | |
| 930 // above) that a process transfer is needed. Process transfers are skipped for | |
| 931 // WebUI processes for now, since e.g. chrome://settings has multiple | |
| 932 // "cross-site" chrome:// frames, and that doesn't yet work cross-process. | |
| 933 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() && | 925 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() && |
| 934 !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 926 !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
| 935 render_frame_host_->GetProcess()->GetID())) { | 927 render_frame_host_->GetProcess()->GetID())) { |
| 936 should_transfer |= manager->IsRendererTransferNeededForNavigation( | 928 should_transfer |= manager->IsRendererTransferNeededForNavigation( |
| 937 render_frame_host_, url_); | 929 render_frame_host_, url_); |
| 938 } | 930 } |
| 939 | 931 |
| 940 // Start the transfer if needed. | 932 // Start the transfer if needed. |
| 941 if (should_transfer) { | 933 if (should_transfer) { |
| 942 // This may destroy the NavigationHandle if the transfer fails. | 934 // This may destroy the NavigationHandle if the transfer fails. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 if (node->current_url().EqualsIgnoringRef(url_)) { | 1039 if (node->current_url().EqualsIgnoringRef(url_)) { |
| 1048 if (found_self_reference) | 1040 if (found_self_reference) |
| 1049 return true; | 1041 return true; |
| 1050 found_self_reference = true; | 1042 found_self_reference = true; |
| 1051 } | 1043 } |
| 1052 } | 1044 } |
| 1053 return false; | 1045 return false; |
| 1054 } | 1046 } |
| 1055 | 1047 |
| 1056 } // namespace content | 1048 } // namespace content |
| OLD | NEW |