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

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

Issue 23841002: 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: unittests. Created 7 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/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..46e1320751de7fe7e92173658d8923ae8f1d40ed 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -6,7 +6,10 @@
#include "base/containers/hash_tables.h"
#include "base/lazy_instance.h"
-#include "content/browser/renderer_host/render_view_host_impl.h"
+#include "content/browser/renderer_host/frame_tree.h"
+#include "content/common/frame_messages.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_process_host.h"
namespace content {
@@ -27,10 +30,12 @@ RenderFrameHostImpl* RenderFrameHostImpl::FromID(
}
RenderFrameHostImpl::RenderFrameHostImpl(
- RenderViewHostImpl* render_view_host,
+ RenderProcessHost* render_process_host,
+ FrameTree* frame_tree,
int routing_id,
bool is_swapped_out)
- : render_view_host_(render_view_host),
+ : render_process_host_(render_process_host),
+ frame_tree_(frame_tree),
routing_id_(routing_id),
is_swapped_out_(is_swapped_out) {
GetProcess()->AddRoute(routing_id_, this);
@@ -51,7 +56,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 +70,19 @@ void RenderFrameHostImpl::Init() {
}
RenderProcessHost* RenderFrameHostImpl::GetProcess() const {
- // TODO(ajwong): This should return its own process once cross-process
- // subframe navigations are supported.
- return render_view_host_->GetProcess();
+ return render_process_host_;
+}
+
+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

Powered by Google App Engine
This is Rietveld 408576698