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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1052223008: Shutdown RenderWidgetHost owned by RenderFrameHost when destroying the RenderFrameHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing Ken's comment. Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | no next file » | 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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 2215 matching lines...) Expand 10 before | Expand all | Expand 10 after
2226 2226
2227 // We need to clean up subframes by removing them from the map and deleting 2227 // We need to clean up subframes by removing them from the map and deleting
2228 // the RenderFrameImpl. In contrast, the main frame is owned by its 2228 // the RenderFrameImpl. In contrast, the main frame is owned by its
2229 // containing RenderViewHost (so that they have the same lifetime), so only 2229 // containing RenderViewHost (so that they have the same lifetime), so only
2230 // removal from the map is needed and no deletion. 2230 // removal from the map is needed and no deletion.
2231 FrameMap::iterator it = g_frame_map.Get().find(frame); 2231 FrameMap::iterator it = g_frame_map.Get().find(frame);
2232 CHECK(it != g_frame_map.Get().end()); 2232 CHECK(it != g_frame_map.Get().end());
2233 CHECK_EQ(it->second, this); 2233 CHECK_EQ(it->second, this);
2234 g_frame_map.Get().erase(it); 2234 g_frame_map.Get().erase(it);
2235 2235
2236 if (is_subframe) 2236 if (is_subframe) {
2237 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
2238 switches::kSitePerProcess) && render_widget_) {
2239 render_widget_->UnregisterRenderFrame(this);
2240 }
2237 frame->parent()->removeChild(frame); 2241 frame->parent()->removeChild(frame);
2242 }
2238 2243
2239 // |frame| is invalid after here. Be sure to clear frame_ as well, since this 2244 // |frame| is invalid after here. Be sure to clear frame_ as well, since this
2240 // object may not be deleted immediately and other methods may try to access 2245 // object may not be deleted immediately and other methods may try to access
2241 // it. 2246 // it.
2242 frame->close(); 2247 frame->close();
2243 frame_ = nullptr; 2248 frame_ = nullptr;
2244 2249
2245 if (is_subframe) { 2250 if (is_subframe) {
2246 delete this; 2251 delete this;
2247 // Object is invalid after this point. 2252 // Object is invalid after this point.
(...skipping 2609 matching lines...) Expand 10 before | Expand all | Expand 10 after
4857 #elif defined(ENABLE_BROWSER_CDMS) 4862 #elif defined(ENABLE_BROWSER_CDMS)
4858 cdm_manager_, 4863 cdm_manager_,
4859 #endif 4864 #endif
4860 this); 4865 this);
4861 } 4866 }
4862 4867
4863 return cdm_factory_; 4868 return cdm_factory_;
4864 } 4869 }
4865 4870
4866 } // namespace content 4871 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698