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 "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "content/browser/frame_host/cross_process_frame_connector.h" | 8 #include "content/browser/frame_host/cross_process_frame_connector.h" |
9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
10 #include "content/browser/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // initialization only needs to happen on an initial cross-process | 61 // initialization only needs to happen on an initial cross-process |
62 // navigation, when the RenderFrameHost leaves the same process as its | 62 // navigation, when the RenderFrameHost leaves the same process as its |
63 // parent. The same CrossProcessFrameConnector is used for subsequent cross- | 63 // parent. The same CrossProcessFrameConnector is used for subsequent cross- |
64 // process navigations, but it will be destroyed if the frame is | 64 // process navigations, but it will be destroyed if the frame is |
65 // navigated back to the same SiteInstance as its parent. | 65 // navigated back to the same SiteInstance as its parent. |
66 cross_process_frame_connector_.reset(new CrossProcessFrameConnector(this)); | 66 cross_process_frame_connector_.reset(new CrossProcessFrameConnector(this)); |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 RenderFrameProxyHost::~RenderFrameProxyHost() { | 70 RenderFrameProxyHost::~RenderFrameProxyHost() { |
71 if (GetProcess()->HasConnection()) | 71 if (GetProcess()->HasConnection()) { |
72 Send(new FrameMsg_DeleteProxy(routing_id_)); | 72 // TODO(nasko): For now, don't send this IPC for top-level frames, as |
| 73 // the top-level RenderFrame will delete the RenderFrameProxy. |
| 74 // This can be removed once we don't have a swapped out state on |
| 75 // RenderFrame. See https://crbug.com/357747 |
| 76 if (!frame_tree_node_->IsMainFrame()) |
| 77 Send(new FrameMsg_DeleteProxy(routing_id_)); |
| 78 } |
73 | 79 |
74 GetProcess()->RemoveRoute(routing_id_); | 80 GetProcess()->RemoveRoute(routing_id_); |
75 g_routing_id_frame_proxy_map.Get().erase( | 81 g_routing_id_frame_proxy_map.Get().erase( |
76 RenderFrameProxyHostID(GetProcess()->GetID(), routing_id_)); | 82 RenderFrameProxyHostID(GetProcess()->GetID(), routing_id_)); |
77 } | 83 } |
78 | 84 |
79 void RenderFrameProxyHost::SetChildRWHView(RenderWidgetHostView* view) { | 85 void RenderFrameProxyHost::SetChildRWHView(RenderWidgetHostView* view) { |
80 cross_process_frame_connector_->set_view( | 86 cross_process_frame_connector_->set_view( |
81 static_cast<RenderWidgetHostViewChildFrame*>(view)); | 87 static_cast<RenderWidgetHostViewChildFrame*>(view)); |
82 } | 88 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 void RenderFrameProxyHost::DisownOpener() { | 159 void RenderFrameProxyHost::DisownOpener() { |
154 Send(new FrameMsg_DisownOpener(GetRoutingID())); | 160 Send(new FrameMsg_DisownOpener(GetRoutingID())); |
155 } | 161 } |
156 | 162 |
157 void RenderFrameProxyHost::OnOpenURL( | 163 void RenderFrameProxyHost::OnOpenURL( |
158 const FrameHostMsg_OpenURL_Params& params) { | 164 const FrameHostMsg_OpenURL_Params& params) { |
159 frame_tree_node_->current_frame_host()->OpenURL(params); | 165 frame_tree_node_->current_frame_host()->OpenURL(params); |
160 } | 166 } |
161 | 167 |
162 } // namespace content | 168 } // namespace content |
OLD | NEW |