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

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

Issue 241223002: Start using RenderFrameProxyHost objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Commits the right URL now. Created 6 years, 6 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..93e94c7eb0f007809a0576ab9a8d59c39ea02bd7 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,12 +38,27 @@ 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();
+ }
+
+ LOG(ERROR) << "RFPH::RFPH[" << this << "]:"
+ " process:" << site_instance_->GetProcess()->GetID() <<
+ ", routing:" << routing_id_ <<
+ ", site:" << site_instance_->GetSiteURL() <<
+ ", parent: " << manager;
+
}
RenderFrameProxyHost::~RenderFrameProxyHost() {
if (GetProcess()->HasConnection())
Send(new FrameMsg_DeleteProxy(routing_id_));
+ LOG(ERROR) << "RFPH::~RFPH[" << this << "]: "
+ << site_instance_->GetSiteURL();
+
GetProcess()->RemoveRoute(routing_id_);
}
@@ -82,4 +99,37 @@ bool RenderFrameProxyHost::OnMessageReceived(const IPC::Message& msg) {
return false;
}
+bool RenderFrameProxyHost::InitRenderFrameProxy() {
+ LOG(ERROR) << "RFPH::Init[" << this << "]:";
+ // 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()) {
+ LOG(ERROR) << "RFPH::Init[" << this << "]:"
+ << " failed to init process";
+ return false;
+ }
+
+ DCHECK(GetProcess()->HasConnection());
+ DCHECK(GetProcess()->GetBrowserContext());
+
+ int parent_routing_id = MSG_ROUTING_NONE;
+ if (frame_tree_node_->parent()) {
+ parent_routing_id = frame_tree_node_->parent()->render_manager()->
ncarter (slow) 2014/06/25 01:07:56 I wonder if |parent_routing_id| should/could be a
+ GetRoutingIdForSiteInstance(site_instance_);
+ LOG(ERROR) << "RFPH::Init[" << this << "]:"
+ << " parent:" << parent_routing_id;
+ 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