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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1409693009: Fix leaking of RenderFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased on ToT and couple of more nits fixes. Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 // RenderFrameHost during cleanup. 252 // RenderFrameHost during cleanup.
253 ClearAllWebUI(); 253 ClearAllWebUI();
254 254
255 GetProcess()->RemoveRoute(routing_id_); 255 GetProcess()->RemoveRoute(routing_id_);
256 g_routing_id_frame_map.Get().erase( 256 g_routing_id_frame_map.Get().erase(
257 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); 257 RenderFrameHostID(GetProcess()->GetID(), routing_id_));
258 258
259 if (delegate_ && render_frame_created_) 259 if (delegate_ && render_frame_created_)
260 delegate_->RenderFrameDeleted(this); 260 delegate_->RenderFrameDeleted(this);
261 261
262 // If this was swapped out, it already decremented the active frame count of 262 bool is_active = IsRFHStateActive(rfh_state_);
263 // the SiteInstance it belongs to. 263
264 if (IsRFHStateActive(rfh_state_)) 264 // If this RenderFrameHost is swapped out, it already decremented the active
265 // frame count of the SiteInstance it belongs to.
266 if (is_active)
265 GetSiteInstance()->decrement_active_frame_count(); 267 GetSiteInstance()->decrement_active_frame_count();
266 268
269 // If this RenderFrameHost is swapping with a RenderFrameProxyHost, the
270 // RenderFrame will already be deleted in the renderer process. Main frame
271 // RenderFrames will be cleaned up as part of deleting its RenderView. In all
272 // other cases, the RenderFrame should be cleaned up (if it exists).
273 if (is_active && !frame_tree_node_->IsMainFrame() && render_frame_created_)
274 Send(new FrameMsg_Delete(routing_id_));
275
267 // NULL out the swapout timer; in crash dumps this member will be null only if 276 // NULL out the swapout timer; in crash dumps this member will be null only if
268 // the dtor has run. 277 // the dtor has run.
269 swapout_event_monitor_timeout_.reset(); 278 swapout_event_monitor_timeout_.reset();
270 279
271 for (const auto& iter: visual_state_callbacks_) { 280 for (const auto& iter: visual_state_callbacks_) {
272 iter.second.Run(false); 281 iter.second.Run(false);
273 } 282 }
274 283
275 if (render_widget_host_ && 284 if (render_widget_host_ &&
276 render_widget_host_->owned_by_render_frame_host()) { 285 render_widget_host_->owned_by_render_frame_host()) {
(...skipping 2230 matching lines...) Expand 10 before | Expand all | Expand 10 after
2507 *dst = src; 2516 *dst = src;
2508 2517
2509 if (src.routing_id != -1) 2518 if (src.routing_id != -1)
2510 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); 2519 dst->tree_id = RoutingIDToAXTreeID(src.routing_id);
2511 2520
2512 if (src.parent_routing_id != -1) 2521 if (src.parent_routing_id != -1)
2513 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); 2522 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id);
2514 } 2523 }
2515 2524
2516 } // namespace content 2525 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698