OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
251 // RenderFrameHost during cleanup. | 251 // RenderFrameHost during cleanup. |
252 ClearAllWebUI(); | 252 ClearAllWebUI(); |
253 | 253 |
254 GetProcess()->RemoveRoute(routing_id_); | 254 GetProcess()->RemoveRoute(routing_id_); |
255 g_routing_id_frame_map.Get().erase( | 255 g_routing_id_frame_map.Get().erase( |
256 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); | 256 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); |
257 | 257 |
258 if (delegate_ && render_frame_created_) | 258 if (delegate_ && render_frame_created_) |
259 delegate_->RenderFrameDeleted(this); | 259 delegate_->RenderFrameDeleted(this); |
260 | 260 |
261 // If this was swapped out, it already decremented the active frame count of | 261 bool is_active = IsRFHStateActive(rfh_state_); |
262 // the SiteInstance it belongs to. | 262 |
263 if (IsRFHStateActive(rfh_state_)) | 263 // If this RenderFrameHost is swapped out, it already decremented the active |
264 // frame count of the SiteInstance it belongs to. | |
265 if (is_active) | |
264 GetSiteInstance()->decrement_active_frame_count(); | 266 GetSiteInstance()->decrement_active_frame_count(); |
265 | 267 |
268 // If this RenderFrameHost is swapping with a RenderFrameProxyHost, the | |
269 // RenderFrame will already be deleted in the renderer process. Main frame | |
270 // RenderFrames will be cleaned up as part of deleting its RenderView. In all | |
271 // other cases, the RenderFrame should be cleaned up (if it exists). | |
272 if (is_active && !frame_tree_node_->IsMainFrame() && render_frame_created_) | |
dcheng
2015/12/14 22:14:41
Nit: I would personally find this easier to read i
Charlie Reis
2015/12/14 22:21:14
I asked for this change because the previous comme
| |
273 Send(new FrameMsg_Delete(routing_id_)); | |
274 | |
266 // NULL out the swapout timer; in crash dumps this member will be null only if | 275 // NULL out the swapout timer; in crash dumps this member will be null only if |
267 // the dtor has run. | 276 // the dtor has run. |
268 swapout_event_monitor_timeout_.reset(); | 277 swapout_event_monitor_timeout_.reset(); |
269 | 278 |
270 for (const auto& iter: visual_state_callbacks_) { | 279 for (const auto& iter: visual_state_callbacks_) { |
271 iter.second.Run(false); | 280 iter.second.Run(false); |
272 } | 281 } |
273 | 282 |
274 if (render_widget_host_ && | 283 if (render_widget_host_ && |
275 render_widget_host_->owned_by_render_frame_host()) { | 284 render_widget_host_->owned_by_render_frame_host()) { |
(...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2500 *dst = src; | 2509 *dst = src; |
2501 | 2510 |
2502 if (src.routing_id != -1) | 2511 if (src.routing_id != -1) |
2503 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); | 2512 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); |
2504 | 2513 |
2505 if (src.parent_routing_id != -1) | 2514 if (src.parent_routing_id != -1) |
2506 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2515 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
2507 } | 2516 } |
2508 | 2517 |
2509 } // namespace content | 2518 } // namespace content |
OLD | NEW |