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

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

Issue 2165523004: Force MimeHandlerView to always use BrowserPlugin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Two quick fixes (One outstanding from lfg@'s comments) Created 4 years, 3 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 6aabf786c74fc3c2979ebaf2c4bcde724c3023cb..41e2287a5de84a4db630a165d4b1d87f073293fe 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -91,6 +91,7 @@
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_url_parameters.h"
+#include "content/public/browser/guest_mode.h"
#include "content/public/browser/invalidate_type.h"
#include "content/public/browser/javascript_dialog_manager.h"
#include "content/public/browser/load_notification_details.h"
@@ -1403,7 +1404,7 @@ void WebContentsImpl::DispatchBeforeUnload() {
void WebContentsImpl::AttachToOuterWebContentsFrame(
WebContents* outer_web_contents,
RenderFrameHost* outer_contents_frame) {
- CHECK(BrowserPluginGuestMode::UseCrossProcessFramesForGuests());
+ CHECK(guest_mode::IsCrossProcessFrameGuest(this));
RenderFrameHostManager* render_manager = GetRenderManager();
// When the WebContents being initialized has an opener, the browser side
@@ -1559,8 +1560,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
#endif
if (!view_) {
- if (browser_plugin_guest_ &&
- BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
+ if (guest_mode::IsCrossProcessFrameGuest(this)) {
view_.reset(new WebContentsViewChildFrame(
this, delegate, &render_view_host_delegate_view_));
} else {
@@ -1570,7 +1570,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
}
if (browser_plugin_guest_ &&
Charlie Reis 2016/09/07 00:22:29 Why does this still have the browser_plugin_guest_
EhsanK 2016/09/08 18:14:58 The null check is inherent to the method call. So
Charlie Reis 2016/09/15 20:56:10 That doesn't answer why line 1563 is missing the n
EhsanK 2016/09/21 21:34:53 On line 1563, the call to guest_mode::IsCrossProce
Charlie Reis 2016/09/21 22:18:21 Oh, I see now. Thanks.
- !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
+ !guest_mode::IsCrossProcessFrameGuest(this)) {
view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(),
std::move(view_),
&render_view_host_delegate_view_));
@@ -4175,13 +4175,12 @@ void WebContentsImpl::RemoveBrowserPluginEmbedder() {
}
WebContentsImpl* WebContentsImpl::GetOuterWebContents() {
- if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
- if (node_)
- return node_->outer_web_contents();
- } else {
- if (GetBrowserPluginGuest())
- return GetBrowserPluginGuest()->embedder_web_contents();
- }
+ if (guest_mode::IsCrossProcessFrameGuest(this) && node_)
+ return node_->outer_web_contents();
+
+ if (browser_plugin_guest_)
+ return browser_plugin_guest_->embedder_web_contents();
+
return nullptr;
}
@@ -4611,7 +4610,7 @@ void WebContentsImpl::EnsureOpenerProxiesExist(RenderFrameHost* source_rfh) {
// then we should not create a RenderView. AttachToOuterWebContentsFrame()
// already created a RenderFrameProxyHost for that purpose.
if (GetBrowserPluginEmbedder() &&
- BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
+ guest_mode::IsCrossProcessFrameGuest(source_web_contents)) {
return;
}

Powered by Google App Engine
This is Rietveld 408576698