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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 972313002: Make <webview> use out-of-process iframe architecture. (Closed) Base URL: ssh://saopaulo.wat/mnt/dev/shared/src@testoopif2z-better-chrome
Patch Set: some review comments addressed Created 5 years, 9 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/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index fd53a0c31a5cd16d81fd1f9a7f1e6e7f22cd68a6..11f427125d4b0573c62c77e528ae940a36c976e6 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// Note that all IPC sent out from this class will be dropped on the
+// floor b/c we don't have a BrowserPlugin anymore.
#include "content/browser/browser_plugin/browser_plugin_guest.h"
#include <algorithm>
@@ -103,6 +105,9 @@ BrowserPluginGuest::BrowserPluginGuest(bool has_render_view,
}
int BrowserPluginGuest::GetGuestProxyRoutingID() {
+ // Don't create the proxy here, we'll create it later.
+ return MSG_ROUTING_NONE;
+
if (guest_proxy_routing_id_ != MSG_ROUTING_NONE)
return guest_proxy_routing_id_;
@@ -265,15 +270,16 @@ void BrowserPluginGuest::InitInternal(
guest_window_rect_ = params.view_rect;
if (owner_web_contents_ != owner_web_contents) {
- WebContentsViewGuest* new_view =
- static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
- if (owner_web_contents_)
- new_view->OnGuestDetached(owner_web_contents_->GetView());
+ // View is not created yet in the case if OOPIF
+ //WebContentsViewGuest* new_view =
+ // static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
+ //if (owner_web_contents_)
+ // new_view->OnGuestDetached(owner_web_contents_->GetView());
// Once a BrowserPluginGuest has an embedder WebContents, it's considered to
// be attached.
owner_web_contents_ = owner_web_contents;
- new_view->OnGuestAttached(owner_web_contents_->GetView());
+ //new_view->OnGuestAttached(owner_web_contents_->GetView());
}
RendererPreferences* renderer_prefs =
@@ -629,17 +635,17 @@ void BrowserPluginGuest::Attach(
// If a RenderView has already been created for this new window, then we need
// to initialize the browser-side state now so that the RenderFrameHostManager
// does not create a new RenderView on navigation.
- if (has_render_view_) {
- // This will trigger a callback to RenderViewReady after a round-trip IPC.
- static_cast<RenderViewHostImpl*>(
- GetWebContents()->GetRenderViewHost())->Init();
- WebContentsViewGuest* web_contents_view =
- static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
- if (!web_contents()->GetRenderViewHost()->GetView()) {
- web_contents_view->CreateViewForWidget(
- web_contents()->GetRenderViewHost(), true);
- }
- }
+ //if (has_render_view_) {
+ // // This will trigger a callback to RenderViewReady after a round-trip IPC.
+ // static_cast<RenderViewHostImpl*>(
+ // GetWebContents()->GetRenderViewHost())->Init();
+ // WebContentsViewGuest* web_contents_view =
+ // static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
+ // if (!web_contents()->GetRenderViewHost()->GetView()) {
+ // web_contents_view->CreateViewForWidget(
+ // web_contents()->GetRenderViewHost(), true);
+ // }
+ //}
InitInternal(params, embedder_web_contents);
@@ -648,15 +654,15 @@ void BrowserPluginGuest::Attach(
delegate_->DidAttach(GetGuestProxyRoutingID());
- has_render_view_ = true;
+ //has_render_view_ = true;
- // Enable input method for guest if it's enabled for the embedder.
- if (static_cast<RenderViewHostImpl*>(
- owner_web_contents_->GetRenderViewHost())->input_method_active()) {
- RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>(
- GetWebContents()->GetRenderViewHost());
- guest_rvh->SetInputMethodActive(true);
- }
+ //// Enable input method for guest if it's enabled for the embedder.
+ //if (static_cast<RenderViewHostImpl*>(
+ // owner_web_contents_->GetRenderViewHost())->input_method_active()) {
+ // RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>(
+ // GetWebContents()->GetRenderViewHost());
+ // guest_rvh->SetInputMethodActive(true);
+ //}
RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Attached"));
}

Powered by Google App Engine
This is Rietveld 408576698