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

Unified Diff: content/browser/frame_host/render_frame_proxy_host.cc

Issue 404613005: Start using RenderFrameProxyHost objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/frame_host/render_frame_proxy_host.cc
diff --git a/content/browser/frame_host/render_frame_proxy_host.cc b/content/browser/frame_host/render_frame_proxy_host.cc
index 2c84798fa2c2dcd1a5ead7da5146d30173cb4aef..e6e44e96dbf64289b86788d2583d5fd7ab8ffbce 100644
--- a/content/browser/frame_host/render_frame_proxy_host.cc
+++ b/content/browser/frame_host/render_frame_proxy_host.cc
@@ -5,9 +5,11 @@
#include "content/browser/frame_host/render_frame_proxy_host.h"
#include "content/browser/frame_host/cross_process_frame_connector.h"
+#include "content/browser/frame_host/frame_tree.h"
#include "content/browser/frame_host/frame_tree_node.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/frame_host/render_widget_host_view_child_frame.h"
+#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/site_instance_impl.h"
#include "content/common/frame_messages.h"
@@ -36,6 +38,11 @@ RenderFrameProxyHost::RenderFrameProxyHost(SiteInstance* site_instance,
// navigated back to the same SiteInstance as its parent.
cross_process_frame_connector_.reset(new CrossProcessFrameConnector(this));
}
+
+ RenderFrameHostManager* manager = NULL;
+ if (frame_tree_node_->parent()) {
+ manager = frame_tree_node_->parent()->render_manager();
+ }
ncarter (slow) 2014/07/21 20:31:57 These lines seem to have no effect.
kenrb 2014/07/24 17:53:53 Removed.
}
RenderFrameProxyHost::~RenderFrameProxyHost() {
@@ -82,4 +89,31 @@ bool RenderFrameProxyHost::OnMessageReceived(const IPC::Message& msg) {
return false;
}
+bool RenderFrameProxyHost::InitRenderFrameProxy() {
+ // The process may (if we're sharing a process with another host that already
+ // initialized it) or may not (we have our own process or the old process
+ // crashed) have been initialized. Calling Init multiple times will be
+ // ignored, so this is safe.
+ if (!site_instance_->GetProcess()->Init())
+ return false;
+
+ DCHECK(GetProcess()->HasConnection());
+ DCHECK(GetProcess()->GetBrowserContext());
ncarter (slow) 2014/07/21 20:31:57 This DCHECK can be dropped; from what I can tell a
kenrb 2014/07/24 17:53:53 Removed.
+
+ int parent_routing_id = MSG_ROUTING_NONE;
+ if (frame_tree_node_->parent()) {
+ parent_routing_id = frame_tree_node_->parent()->render_manager()->
+ GetRoutingIdForSiteInstance(site_instance_);
+ CHECK_NE(parent_routing_id, MSG_ROUTING_NONE);
+ }
+
+ Send(new FrameMsg_NewFrameProxy(
+ routing_id_,
+ parent_routing_id,
+ frame_tree_node_->frame_tree()->GetRenderViewHost(
+ site_instance_)->GetRoutingID()));
+
+ return true;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698