| 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/render_frame_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 return proxy_host; | 1032 return proxy_host; |
| 1033 } | 1033 } |
| 1034 | 1034 |
| 1035 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1035 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
| 1036 SiteInstance* site_instance) { | 1036 SiteInstance* site_instance) { |
| 1037 static_cast<SiteInstanceImpl*>(site_instance)->RemoveObserver(this); | 1037 static_cast<SiteInstanceImpl*>(site_instance)->RemoveObserver(this); |
| 1038 proxy_hosts_.erase(site_instance->GetId()); | 1038 proxy_hosts_.erase(site_instance->GetId()); |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 bool RenderFrameHostManager::ShouldTransitionCrossSite() { | 1041 bool RenderFrameHostManager::ShouldTransitionCrossSite() { |
| 1042 // The logic below is weaker than "are all sites isolated" -- it asks instead, | 1042 // False in single-process mode, which does not support cross-process |
| 1043 // "is any site isolated". That's appropriate here since we're just trying to | 1043 // navigations or OOPIFs. |
| 1044 // figure out if we're in any kind of site isolated mode, and in which case, | |
| 1045 // we ignore the kSingleProcess and kProcessPerTab settings. | |
| 1046 // | |
| 1047 // TODO(nick): Move all handling of kSingleProcess/kProcessPerTab into | |
| 1048 // SiteIsolationPolicy so we have a consistent behavior around the interaction | |
| 1049 // of the process model flags. | |
| 1050 // | |
| 1051 // TODO(creis, alexmos): This looks like it will break single-process and | |
| 1052 // process-per-tab. See https://crbug.com/688617. | |
| 1053 if (SiteIsolationPolicy::AreCrossProcessFramesPossible()) | |
| 1054 return true; | |
| 1055 | |
| 1056 // False in the single-process mode, as it makes RVHs to accumulate | |
| 1057 // in swapped_out_hosts_. | |
| 1058 // True if we are using process-per-site-instance (default) or | |
| 1059 // process-per-site (kProcessPerSite). | |
| 1060 // TODO(nick): Move handling of kSingleProcess and kProcessPerTab into | |
| 1061 // SiteIsolationPolicy. | |
| 1062 return !base::CommandLine::ForCurrentProcess()->HasSwitch( | 1044 return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1063 switches::kSingleProcess) && | 1045 switches::kSingleProcess); |
| 1064 !base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 1065 switches::kProcessPerTab); | |
| 1066 } | 1046 } |
| 1067 | 1047 |
| 1068 bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation( | 1048 bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation( |
| 1069 const GURL& current_effective_url, | 1049 const GURL& current_effective_url, |
| 1070 bool current_is_view_source_mode, | 1050 bool current_is_view_source_mode, |
| 1071 SiteInstance* new_site_instance, | 1051 SiteInstance* new_site_instance, |
| 1072 const GURL& new_effective_url, | 1052 const GURL& new_effective_url, |
| 1073 bool new_is_view_source_mode) const { | 1053 bool new_is_view_source_mode) const { |
| 1074 // A subframe must stay in the same BrowsingInstance as its parent. | 1054 // A subframe must stay in the same BrowsingInstance as its parent. |
| 1075 // TODO(nasko): Ensure that SiteInstance swap is still triggered for subframes | 1055 // TODO(nasko): Ensure that SiteInstance swap is still triggered for subframes |
| (...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2848 ->is_hidden() != delegate_->IsHidden()) { | 2828 ->is_hidden() != delegate_->IsHidden()) { |
| 2849 if (delegate_->IsHidden()) { | 2829 if (delegate_->IsHidden()) { |
| 2850 view->Hide(); | 2830 view->Hide(); |
| 2851 } else { | 2831 } else { |
| 2852 view->Show(); | 2832 view->Show(); |
| 2853 } | 2833 } |
| 2854 } | 2834 } |
| 2855 } | 2835 } |
| 2856 | 2836 |
| 2857 } // namespace content | 2837 } // namespace content |
| OLD | NEW |