Add IsSwappedOutStateForbidden() to RenderFrameHostManager and RenderFrameProxy.
The method returns true if we are in --site-per-process. Using a function
like this (instead of consulting the switch directly in so many places)
documents the fact that these --site-per-process checks are related,
makes them easier to rip out when the time comes, and simplifies
the implementation of bug 481066.
BUG=481066
Review URL: https://codereview.chromium.org/1195393007
Cr-Commit-Position: refs/heads/master@{#335781}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 90ed17d..3846ba56 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3949,8 +3949,7 @@
int WebContentsImpl::CreateSwappedOutRenderView(
SiteInstance* instance) {
int render_view_routing_id = MSG_ROUTING_NONE;
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ if (RenderFrameHostManager::IsSwappedOutStateForbidden()) {
GetRenderManager()->CreateRenderFrameProxy(instance);
} else {
GetRenderManager()->CreateRenderFrame(