| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |