OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <utility> | 10 #include <utility> |
(...skipping 4325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4336 if (source_web_contents) { | 4336 if (source_web_contents) { |
4337 // If this message is going to outer WebContents from inner WebContents, | 4337 // If this message is going to outer WebContents from inner WebContents, |
4338 // then we should not create a RenderView. AttachToOuterWebContentsFrame() | 4338 // then we should not create a RenderView. AttachToOuterWebContentsFrame() |
4339 // already created a RenderFrameProxyHost for that purpose. | 4339 // already created a RenderFrameProxyHost for that purpose. |
4340 if (GetBrowserPluginEmbedder() && | 4340 if (GetBrowserPluginEmbedder() && |
4341 BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { | 4341 BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { |
4342 return; | 4342 return; |
4343 } | 4343 } |
4344 | 4344 |
4345 if (this != source_web_contents && GetBrowserPluginGuest()) { | 4345 if (this != source_web_contents && GetBrowserPluginGuest()) { |
4346 // We create a swapped out RenderView or RenderFrameProxyHost for the | 4346 // We create a RenderFrameProxyHost for the embedder in the guest's render |
4347 // embedder in the guest's render process but we intentionally do not | 4347 // process but we intentionally do not expose the embedder's opener chain |
4348 // expose the embedder's opener chain to it. | 4348 // to it. |
4349 if (SiteIsolationPolicy::IsSwappedOutStateForbidden()) { | 4349 source_web_contents->GetRenderManager()->CreateRenderFrameProxy( |
4350 source_web_contents->GetRenderManager()->CreateRenderFrameProxy( | 4350 GetSiteInstance()); |
4351 GetSiteInstance()); | |
4352 } else { | |
4353 source_web_contents->CreateSwappedOutRenderView(GetSiteInstance()); | |
4354 } | |
4355 } else { | 4351 } else { |
4356 RenderFrameHostImpl* source_rfhi = | 4352 RenderFrameHostImpl* source_rfhi = |
4357 static_cast<RenderFrameHostImpl*>(source_rfh); | 4353 static_cast<RenderFrameHostImpl*>(source_rfh); |
4358 source_rfhi->frame_tree_node()->render_manager()->CreateOpenerProxies( | 4354 source_rfhi->frame_tree_node()->render_manager()->CreateOpenerProxies( |
4359 GetSiteInstance(), nullptr); | 4355 GetSiteInstance(), nullptr); |
4360 } | 4356 } |
4361 } | 4357 } |
4362 } | 4358 } |
4363 | 4359 |
4364 bool WebContentsImpl::AddMessageToConsole(int32_t level, | 4360 bool WebContentsImpl::AddMessageToConsole(int32_t level, |
4365 const base::string16& message, | 4361 const base::string16& message, |
4366 int32_t line_no, | 4362 int32_t line_no, |
4367 const base::string16& source_id) { | 4363 const base::string16& source_id) { |
4368 if (!delegate_) | 4364 if (!delegate_) |
4369 return false; | 4365 return false; |
4370 return delegate_->AddMessageToConsole(this, level, message, line_no, | 4366 return delegate_->AddMessageToConsole(this, level, message, line_no, |
4371 source_id); | 4367 source_id); |
4372 } | 4368 } |
4373 | 4369 |
4374 int WebContentsImpl::CreateSwappedOutRenderView( | 4370 int WebContentsImpl::CreateSwappedOutRenderView( |
Charlie Reis
2016/03/11 21:56:56
Looks like there's no remaining callers of this?
nasko
2016/03/11 22:35:33
Thanks for catching this! Added to the list of thi
| |
4375 SiteInstance* instance) { | 4371 SiteInstance* instance) { |
4376 int render_view_routing_id = MSG_ROUTING_NONE; | 4372 int render_view_routing_id = MSG_ROUTING_NONE; |
4377 if (SiteIsolationPolicy::IsSwappedOutStateForbidden()) { | 4373 GetRenderManager()->CreateRenderFrameProxy(instance); |
4378 GetRenderManager()->CreateRenderFrameProxy(instance); | |
4379 } else { | |
4380 GetRenderManager()->CreateRenderFrame( | |
4381 instance, CREATE_RF_SWAPPED_OUT | CREATE_RF_HIDDEN, | |
4382 &render_view_routing_id); | |
4383 } | |
4384 return render_view_routing_id; | 4374 return render_view_routing_id; |
4385 } | 4375 } |
4386 | 4376 |
4387 void WebContentsImpl::OnUserInteraction( | 4377 void WebContentsImpl::OnUserInteraction( |
4388 RenderWidgetHostImpl* render_widget_host, | 4378 RenderWidgetHostImpl* render_widget_host, |
4389 const blink::WebInputEvent::Type type) { | 4379 const blink::WebInputEvent::Type type) { |
4390 // Ignore when the renderer is swapped out. | 4380 // Ignore when the renderer is swapped out. |
4391 // TODO(dominickn,creis): support widgets for out-of-process iframes. | 4381 // TODO(dominickn,creis): support widgets for out-of-process iframes. |
4392 if (render_widget_host != GetRenderViewHost()->GetWidget()) | 4382 if (render_widget_host != GetRenderViewHost()->GetWidget()) |
4393 return; | 4383 return; |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4854 else | 4844 else |
4855 WasHidden(); | 4845 WasHidden(); |
4856 } | 4846 } |
4857 | 4847 |
4858 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 4848 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
4859 JavaScriptDialogManager* dialog_manager) { | 4849 JavaScriptDialogManager* dialog_manager) { |
4860 dialog_manager_ = dialog_manager; | 4850 dialog_manager_ = dialog_manager; |
4861 } | 4851 } |
4862 | 4852 |
4863 } // namespace content | 4853 } // namespace content |
OLD | NEW |