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

Unified Diff: content/browser/renderer_host/render_frame_host_impl.cc

Issue 25503004: Create a new RenderFrameHost per child frame when --site-per-process is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on ToT. Created 7 years, 2 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/renderer_host/render_frame_host_impl.cc
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index ec621c10dca3f15e9bc40ba269d519621247a81f..d6b7ed54691a6937624d592177d0420e25565a80 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -6,7 +6,11 @@
#include "base/containers/hash_tables.h"
#include "base/lazy_instance.h"
+#include "content/browser/renderer_host/frame_tree.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
+#include "content/common/frame_messages.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_process_host.h"
namespace content {
@@ -28,9 +32,11 @@ RenderFrameHostImpl* RenderFrameHostImpl::FromID(
RenderFrameHostImpl::RenderFrameHostImpl(
RenderViewHostImpl* render_view_host,
+ FrameTree* frame_tree,
int routing_id,
bool is_swapped_out)
: render_view_host_(render_view_host),
+ frame_tree_(frame_tree),
routing_id_(routing_id),
is_swapped_out_(is_swapped_out) {
GetProcess()->AddRoute(routing_id_, this);
@@ -51,7 +57,13 @@ bool RenderFrameHostImpl::Send(IPC::Message* message) {
}
bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
- return false;
+ bool handled = true;
+ bool msg_is_ok = true;
+ IPC_BEGIN_MESSAGE_MAP_EX(RenderFrameHostImpl, msg, msg_is_ok)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach)
+ IPC_END_MESSAGE_MAP_EX()
+
+ return handled;
}
void RenderFrameHostImpl::Init() {
@@ -59,9 +71,21 @@ void RenderFrameHostImpl::Init() {
}
RenderProcessHost* RenderFrameHostImpl::GetProcess() const {
- // TODO(ajwong): This should return its own process once cross-process
- // subframe navigations are supported.
+ // TODO(nasko): This should return its own process, once we have working
+ // cross-process navigation for subframes.
return render_view_host_->GetProcess();
}
+void RenderFrameHostImpl::OnCreateChildFrame(int new_frame_routing_id,
+ int64 parent_frame_id,
+ int64 frame_id,
+ const std::string& frame_name) {
+ frame_tree_->AddFrame(new_frame_routing_id, parent_frame_id, frame_id,
+ frame_name);
+}
+
+void RenderFrameHostImpl::OnDetach(int64 parent_frame_id, int64 frame_id) {
+ frame_tree_->RemoveFrame(parent_frame_id, frame_id);
+}
+
} // namespace content
« no previous file with comments | « content/browser/renderer_host/render_frame_host_impl.h ('k') | content/browser/renderer_host/render_frame_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698