Chromium Code Reviews| 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 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1068 static_cast<SiteInstanceImpl*>(site_instance)->AddObserver(this); | 1068 static_cast<SiteInstanceImpl*>(site_instance)->AddObserver(this); |
| 1069 return proxy_host; | 1069 return proxy_host; |
| 1070 } | 1070 } |
| 1071 | 1071 |
| 1072 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1072 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
| 1073 SiteInstance* site_instance) { | 1073 SiteInstance* site_instance) { |
| 1074 static_cast<SiteInstanceImpl*>(site_instance)->RemoveObserver(this); | 1074 static_cast<SiteInstanceImpl*>(site_instance)->RemoveObserver(this); |
| 1075 proxy_hosts_.erase(site_instance->GetId()); | 1075 proxy_hosts_.erase(site_instance->GetId()); |
| 1076 } | 1076 } |
| 1077 | 1077 |
| 1078 bool RenderFrameHostManager::ShouldTransitionCrossSite() { | 1078 bool RenderFrameHostManager::ShouldTransitionCrossSite() { |
|
alexmos
2017/06/30 20:40:38
Just noticed that the comment for this in the head
| |
| 1079 // The logic below is weaker than "are all sites isolated" -- it asks instead, | 1079 // False in single-process mode, which does not support cross-process |
| 1080 // "is any site isolated". That's appropriate here since we're just trying to | 1080 // navigations or OOPIFs. Also false in --process-per-tab, which uses one |
| 1081 // figure out if we're in any kind of site isolated mode, and in which case, | 1081 // process per BrowsingInstance. ("Tab" is an over-simplifcation, since it's |
| 1082 // we ignore the kSingleProcess and kProcessPerTab settings. | 1082 // really a group of tabs, and it is still possible to swap BrowsingInstances |
| 1083 // | 1083 // within a tab.) |
|
alexmos
2017/06/30 02:23:29
Yes, I agree that it makes sense to prioritize --s
alexmos
2017/06/30 20:40:38
Note that Lukasz is removing --process-per-tab fro
Charlie Reis
2017/06/30 23:45:15
These are excellent questions. :)
I'm getting th
Charlie Reis
2017/07/10 16:18:38
In more detail...
On 2017/06/30 23:45:15, Charlie
| |
| 1084 // TODO(nick): Move all handling of kSingleProcess/kProcessPerTab into | |
| 1085 // SiteIsolationPolicy so we have a consistent behavior around the interaction | |
| 1086 // of the process model flags. | |
| 1087 // | |
| 1088 // TODO(creis, alexmos): This looks like it will break single-process and | |
| 1089 // process-per-tab. See https://crbug.com/688617. | |
| 1090 if (SiteIsolationPolicy::AreCrossProcessFramesPossible()) | |
| 1091 return true; | |
| 1092 | |
| 1093 // False in the single-process mode, as it makes RVHs to accumulate | |
| 1094 // in swapped_out_hosts_. | |
| 1095 // True if we are using process-per-site-instance (default) or | |
| 1096 // process-per-site (kProcessPerSite). | |
| 1097 // TODO(nick): Move handling of kSingleProcess and kProcessPerTab into | |
| 1098 // SiteIsolationPolicy. | |
| 1099 return !base::CommandLine::ForCurrentProcess()->HasSwitch( | 1084 return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1100 switches::kSingleProcess) && | 1085 switches::kSingleProcess) && |
| 1101 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 1086 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1102 switches::kProcessPerTab); | 1087 switches::kProcessPerTab); |
| 1103 } | 1088 } |
| 1104 | 1089 |
| 1105 bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation( | 1090 bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation( |
| 1106 const GURL& current_effective_url, | 1091 const GURL& current_effective_url, |
| 1107 bool current_is_view_source_mode, | 1092 bool current_is_view_source_mode, |
| 1108 SiteInstance* new_site_instance, | 1093 SiteInstance* new_site_instance, |
| (...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2829 ->is_hidden() != delegate_->IsHidden()) { | 2814 ->is_hidden() != delegate_->IsHidden()) { |
| 2830 if (delegate_->IsHidden()) { | 2815 if (delegate_->IsHidden()) { |
| 2831 view->Hide(); | 2816 view->Hide(); |
| 2832 } else { | 2817 } else { |
| 2833 view->Show(); | 2818 view->Show(); |
| 2834 } | 2819 } |
| 2835 } | 2820 } |
| 2836 } | 2821 } |
| 2837 | 2822 |
| 2838 } // namespace content | 2823 } // namespace content |
| OLD | NEW |