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

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

Issue 1874543002: Inside of content, prefer SiteInstanceImpl to SiteInstance. Base URL: https://chromium.googlesource.com/chromium/src.git@site_instance_unittest
Patch Set: Created 4 years, 8 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 4a747f40931d86f6befceb1a96e34560b12795dc..b56dd17e7ed0fa84904871239866705c70994ab6 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1271,6 +1271,9 @@ void WebContentsImpl::DispatchBeforeUnload(bool for_cross_site_transition) {
void WebContentsImpl::AttachToOuterWebContentsFrame(
WebContents* outer_web_contents,
RenderFrameHost* outer_contents_frame) {
+ DCHECK(outer_contents_frame);
+ RenderFrameHostImpl* outer_contents_frame_impl =
+ static_cast<RenderFrameHostImpl*>(outer_contents_frame);
CHECK(BrowserPluginGuestMode::UseCrossProcessFramesForGuests());
RenderFrameHostManager* render_manager = GetRenderManager();
@@ -1289,16 +1292,13 @@ void WebContentsImpl::AttachToOuterWebContentsFrame(
node_.reset(new WebContentsTreeNode());
node_->ConnectToOuterWebContents(
static_cast<WebContentsImpl*>(outer_web_contents),
- static_cast<RenderFrameHostImpl*>(outer_contents_frame));
-
- DCHECK(outer_contents_frame);
+ outer_contents_frame_impl);
// Create a proxy in top-level RenderFrameHostManager, pointing to the
// SiteInstance of the outer WebContents. The proxy will be used to send
// postMessage to the inner WebContents.
render_manager->CreateOuterDelegateProxy(
- outer_contents_frame->GetSiteInstance(),
- static_cast<RenderFrameHostImpl*>(outer_contents_frame));
+ outer_contents_frame_impl->GetSiteInstance(), outer_contents_frame_impl);
render_manager->SetRWHViewForInnerContents(
render_manager->GetRenderWidgetHostView());
@@ -1377,9 +1377,10 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
params.main_frame_routing_id != MSG_ROUTING_NONE &&
params.main_frame_widget_routing_id != MSG_ROUTING_NONE));
- scoped_refptr<SiteInstance> site_instance = params.site_instance;
+ scoped_refptr<SiteInstanceImpl> site_instance =
+ static_cast<SiteInstanceImpl*>(params.site_instance.get());
if (!site_instance)
- site_instance = SiteInstance::Create(params.browser_context);
+ site_instance = SiteInstanceImpl::Create(params.browser_context);
// A main RenderFrameHost always has a RenderWidgetHost, since it is always a
// local root by definition.
« no previous file with comments | « content/browser/site_per_process_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