| 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/frame_tree_node.h" | 5 #include "content/browser/frame_host/frame_tree_node.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 | 8 |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "content/browser/frame_host/navigator.h" | 10 #include "content/browser/frame_host/navigator.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 if ((*iter) == child) | 49 if ((*iter) == child) |
| 50 break; | 50 break; |
| 51 } | 51 } |
| 52 | 52 |
| 53 if (iter != children_.end()) | 53 if (iter != children_.end()) |
| 54 children_.erase(iter); | 54 children_.erase(iter); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void FrameTreeNode::ResetForMainFrame( | 57 void FrameTreeNode::ResetForMainFrame( |
| 58 RenderFrameHostImpl* new_render_frame_host) { | 58 RenderFrameHostImpl* new_render_frame_host) { |
| 59 DCHECK_EQ(0UL, children_.size()); | |
| 60 | |
| 61 owns_render_frame_host_ = false; | 59 owns_render_frame_host_ = false; |
| 62 frame_id_ = kInvalidFrameId; | 60 frame_id_ = kInvalidFrameId; |
| 63 current_url_ = GURL(); | 61 current_url_ = GURL(); |
| 62 |
| 63 // The children may not have been cleared if a cross-process navigation |
| 64 // commits before the old process cleans everything up. Make sure the child |
| 65 // nodes get deleted. |
| 64 children_.clear(); | 66 children_.clear(); |
| 65 | 67 |
| 66 render_frame_host_ = new_render_frame_host; | 68 render_frame_host_ = new_render_frame_host; |
| 67 } | 69 } |
| 68 | 70 |
| 69 } // namespace content | 71 } // namespace content |
| OLD | NEW |