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

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

Issue 950223006: Fix RenderFrameHostChanged WebContentsObserver methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove leftover log and empty lines Created 5 years, 10 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/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 38f4192c62ab9c49290126814c0db5313c88ade3..21e0ecbd32e2eccb9c1ebd0bdf80e407ea658da9 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -184,6 +184,10 @@ RenderFrameHostImpl::~RenderFrameHostImpl() {
g_routing_id_frame_map.Get().erase(
RenderFrameHostID(GetProcess()->GetID(), routing_id_));
+ // Notify the FrameTree that this RFH is going away, allowing it to shut down
+ // the corresponding RenderViewHost if it is no longer needed.
+ frame_tree_->UnregisterRenderFrameHost(this);
Charlie Reis 2015/03/02 18:38:25 Moving this makes me nervous about UaFs. Are we s
nasko 2015/03/02 19:30:53 I don't know if observers will need to access Rend
Charlie Reis 2015/03/02 22:44:30 Yes, that's my concern, though. I just looked mor
Charlie Reis 2015/03/02 22:58:49 Oops, this didn't come up in the patch diffs, so I
+
if (delegate_ && render_frame_created_)
delegate_->RenderFrameDeleted(this);
@@ -194,10 +198,6 @@ RenderFrameHostImpl::~RenderFrameHostImpl() {
if (IsRFHStateActive(rfh_state_))
GetSiteInstance()->decrement_active_frame_count();
- // Notify the FrameTree that this RFH is going away, allowing it to shut down
- // the corresponding RenderViewHost if it is no longer needed.
- frame_tree_->UnregisterRenderFrameHost(this);
-
// NULL out the swapout timer; in crash dumps this member will be null only if
// the dtor has run.
swapout_event_monitor_timeout_.reset();

Powered by Google App Engine
This is Rietveld 408576698