OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/frame_host/render_frame_proxy_host.h" | 5 #include "content/browser/frame_host/render_frame_proxy_host.h" |
6 | 6 |
7 #include "content/browser/frame_host/cross_process_frame_connector.h" | 7 #include "content/browser/frame_host/cross_process_frame_connector.h" |
8 #include "content/browser/frame_host/frame_tree.h" | |
9 #include "content/browser/frame_host/frame_tree_node.h" | 8 #include "content/browser/frame_host/frame_tree_node.h" |
10 #include "content/browser/frame_host/render_frame_host_impl.h" | 9 #include "content/browser/frame_host/render_frame_host_impl.h" |
11 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 10 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
12 #include "content/browser/renderer_host/render_view_host_impl.h" | |
13 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 11 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
14 #include "content/browser/site_instance_impl.h" | 12 #include "content/browser/site_instance_impl.h" |
15 #include "content/common/frame_messages.h" | 13 #include "content/common/frame_messages.h" |
16 #include "ipc/ipc_message.h" | 14 #include "ipc/ipc_message.h" |
17 | 15 |
18 namespace content { | 16 namespace content { |
19 | 17 |
20 RenderFrameProxyHost::RenderFrameProxyHost(SiteInstance* site_instance, | 18 RenderFrameProxyHost::RenderFrameProxyHost(SiteInstance* site_instance, |
21 FrameTreeNode* frame_tree_node) | 19 FrameTreeNode* frame_tree_node) |
22 : routing_id_(site_instance->GetProcess()->GetNextRoutingID()), | 20 : routing_id_(site_instance->GetProcess()->GetNextRoutingID()), |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return true; | 75 return true; |
78 | 76 |
79 // TODO(nasko): This can be removed once we don't have a swapped out state on | 77 // TODO(nasko): This can be removed once we don't have a swapped out state on |
80 // RenderFrameHosts. See https://crbug.com/357747. | 78 // RenderFrameHosts. See https://crbug.com/357747. |
81 if (render_frame_host_.get()) | 79 if (render_frame_host_.get()) |
82 return render_frame_host_->OnMessageReceived(msg); | 80 return render_frame_host_->OnMessageReceived(msg); |
83 | 81 |
84 return false; | 82 return false; |
85 } | 83 } |
86 | 84 |
87 bool RenderFrameProxyHost::InitRenderFrameProxy() { | |
88 // The process may (if we're sharing a process with another host that already | |
89 // initialized it) or may not (we have our own process or the old process | |
90 // crashed) have been initialized. Calling Init multiple times will be | |
91 // ignored, so this is safe. | |
92 if (!site_instance_->GetProcess()->Init()) | |
93 return false; | |
94 | |
95 DCHECK(GetProcess()->HasConnection()); | |
96 | |
97 int parent_routing_id = MSG_ROUTING_NONE; | |
98 if (frame_tree_node_->parent()) { | |
99 parent_routing_id = frame_tree_node_->parent()->render_manager()-> | |
100 GetRoutingIdForSiteInstance(site_instance_); | |
101 CHECK_NE(parent_routing_id, MSG_ROUTING_NONE); | |
102 } | |
103 | |
104 Send(new FrameMsg_NewFrameProxy( | |
105 routing_id_, | |
106 parent_routing_id, | |
107 frame_tree_node_->frame_tree()->GetRenderViewHost( | |
108 site_instance_)->GetRoutingID())); | |
109 | |
110 return true; | |
111 } | |
112 | |
113 } // namespace content | 85 } // namespace content |
OLD | NEW |