Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: content/browser/web_contents/web_contents_impl.cc

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
Patch Set: Attempt to fix compile. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 951652aec614ea3cea69b3af2041af3aea9cc8ae..41e49ddfb92c1b619b4515dd3ece4c9b316b57fc 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -88,6 +88,7 @@
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/bindings_policy.h"
+#include "content/public/common/browser_plugin_guest_mode.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/page_zoom.h"
@@ -1238,8 +1239,7 @@ void WebContentsImpl::DispatchBeforeUnload(bool for_cross_site_transition) {
void WebContentsImpl::AttachToOuterWebContentsFrame(
WebContents* outer_web_contents,
RenderFrameHost* outer_contents_frame) {
- CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess));
+ CHECK(BrowserPluginGuestMode::UseCrossProcessFramesForGuests());
// Create a link to our outer WebContents.
node_.reset(new WebContentsTreeNode());
node_->ConnectToOuterWebContents(
@@ -1333,8 +1333,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
if (browser_plugin_guest_ &&
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
scoped_ptr<WebContentsView> platform_view(CreateWebContentsView(
this, delegate, &render_view_host_delegate_view_));
@@ -1635,9 +1634,7 @@ void WebContentsImpl::CreateNewWindow(
// SiteInstance in its own BrowsingInstance.
bool is_guest = BrowserPluginGuest::IsGuest(this);
- if (is_guest &&
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ if (is_guest && BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
// TODO(lazyboy): CreateNewWindow doesn't work for OOPIF-based <webview>
// yet.
NOTREACHED();
@@ -4051,8 +4048,7 @@ void WebContentsImpl::EnsureOpenerProxiesExist(RenderFrameHost* source_rfh) {
// then we should not create a RenderView. AttachToOuterWebContentsFrame()
// already created a RenderFrameProxyHost for that purpose.
if (GetBrowserPluginEmbedder() &&
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
return;
}
@@ -4277,8 +4273,7 @@ bool WebContentsImpl::CreateRenderViewForRenderManager(
// frame RWHVs are unique in that they do not have their own WebContents.
bool is_guest_in_site_per_process =
!!browser_plugin_guest_.get() &&
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess);
+ BrowserPluginGuestMode::UseCrossProcessFramesForGuests();
if (!for_main_frame_navigation || is_guest_in_site_per_process) {
RenderWidgetHostViewChildFrame* rwh_view_child =
new RenderWidgetHostViewChildFrame(render_view_host);
« no previous file with comments | « content/browser/web_contents/opened_by_dom_browsertest.cc ('k') | content/browser/web_contents/web_contents_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698