 Chromium Code Reviews
 Chromium Code Reviews Issue 1208143002:
  Move existing kSitePerProcess checks to a policy-oracle object  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@swapped_out_cmdline_checks
    
  
    Issue 1208143002:
  Move existing kSitePerProcess checks to a policy-oracle object  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@swapped_out_cmdline_checks| Index: content/browser/frame_host/navigator_impl.cc | 
| diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc | 
| index b5d31369efca8643be54f111442b1b4e374f9069..a417c0e2c4321ed59e5cc37c22606371e03efcff 100644 | 
| --- a/content/browser/frame_host/navigator_impl.cc | 
| +++ b/content/browser/frame_host/navigator_impl.cc | 
| @@ -36,6 +36,7 @@ | 
| #include "content/public/common/content_client.h" | 
| #include "content/public/common/content_switches.h" | 
| #include "content/public/common/resource_response.h" | 
| +#include "content/public/common/site_isolation_policy.h" | 
| #include "content/public/common/url_constants.h" | 
| #include "content/public/common/url_utils.h" | 
| #include "net/base/net_errors.h" | 
| @@ -71,8 +72,7 @@ FrameMsg_Navigate_Type::Value GetNavigationType( | 
| } | 
| RenderFrameHostManager* GetRenderManager(RenderFrameHostImpl* rfh) { | 
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 
| - switches::kSitePerProcess)) | 
| + if (SiteIsolationPolicy::AreCrossProcessFramesPossible()) | 
| return rfh->frame_tree_node()->render_manager(); | 
| return rfh->frame_tree_node()->frame_tree()->root()->render_manager(); | 
| @@ -352,8 +352,7 @@ void NavigatorImpl::DidNavigate( | 
| const FrameHostMsg_DidCommitProvisionalLoad_Params& input_params) { | 
| FrameHostMsg_DidCommitProvisionalLoad_Params params(input_params); | 
| FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree(); | 
| - bool use_site_per_process = base::CommandLine::ForCurrentProcess()->HasSwitch( | 
| - switches::kSitePerProcess); | 
| + bool oopifs_possible = SiteIsolationPolicy::AreCrossProcessFramesPossible(); | 
| 
nasko
2015/07/08 12:52:23
nit: oopifs_enabled?
 
ncarter (slow)
2015/07/10 23:29:18
I'm sticking with _possible.
 
Charlie Reis
2015/07/13 22:13:14
+1 to "possible," since it doesn't imply how widel
 
ncarter (slow)
2015/07/20 17:45:46
Leaving as Possible.
 | 
| if (ui::PageTransitionIsMainFrame(params.transition)) { | 
| if (delegate_) { | 
| @@ -378,7 +377,7 @@ void NavigatorImpl::DidNavigate( | 
| delegate_->DidNavigateMainFramePreCommit(is_navigation_within_page); | 
| } | 
| - if (!use_site_per_process) | 
| + if (!oopifs_possible) | 
| frame_tree->root()->render_manager()->DidNavigateFrame( | 
| render_frame_host, params.gesture == NavigationGestureUser); | 
| } | 
| @@ -393,7 +392,7 @@ void NavigatorImpl::DidNavigate( | 
| // When using --site-per-process, we notify the RFHM for all navigations, | 
| // not just main frame navigations. | 
| - if (use_site_per_process) { | 
| + if (oopifs_possible) { | 
| FrameTreeNode* frame = render_frame_host->frame_tree_node(); | 
| frame->render_manager()->DidNavigateFrame( | 
| render_frame_host, params.gesture == NavigationGestureUser); | 
| @@ -544,10 +543,8 @@ void NavigatorImpl::RequestTransferURL( | 
| // Send the navigation to the current FrameTreeNode if it's destined for a | 
| // subframe in the current tab. We'll assume it's for the main frame | 
| // (possibly of a new or different WebContents) otherwise. | 
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 
| - switches::kSitePerProcess) && | 
| - disposition == CURRENT_TAB && | 
| - render_frame_host->GetParent()) { | 
| + if (SiteIsolationPolicy::AreCrossProcessFramesPossible() && | 
| + disposition == CURRENT_TAB && render_frame_host->GetParent()) { | 
| frame_tree_node_id = | 
| render_frame_host->frame_tree_node()->frame_tree_node_id(); | 
| } |