OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 HTMLFrameOwnerElement::UpdateSuspendScope::UpdateSuspendScope() | 56 HTMLFrameOwnerElement::UpdateSuspendScope::UpdateSuspendScope() |
57 { | 57 { |
58 ++s_updateSuspendCount; | 58 ++s_updateSuspendCount; |
59 } | 59 } |
60 | 60 |
61 void HTMLFrameOwnerElement::UpdateSuspendScope::performDeferredWidgetTreeOperati
ons() | 61 void HTMLFrameOwnerElement::UpdateSuspendScope::performDeferredWidgetTreeOperati
ons() |
62 { | 62 { |
63 WidgetToParentMap map; | 63 WidgetToParentMap map; |
64 widgetNewParentMap().swap(map); | 64 widgetNewParentMap().swap(map); |
65 WidgetToParentMap::iterator end = map.end(); | 65 for (const auto& widget : map) { |
66 for (WidgetToParentMap::iterator it = map.begin(); it != end; ++it) { | 66 Widget* child = widget.key.get(); |
67 Widget* child = it->key.get(); | |
68 FrameView* currentParent = toFrameView(child->parent()); | 67 FrameView* currentParent = toFrameView(child->parent()); |
69 FrameView* newParent = it->value; | 68 FrameView* newParent = widget.value; |
70 if (newParent != currentParent) { | 69 if (newParent != currentParent) { |
71 if (currentParent) | 70 if (currentParent) |
72 currentParent->removeChild(child); | 71 currentParent->removeChild(child); |
73 if (newParent) | 72 if (newParent) |
74 newParent->addChild(child); | 73 newParent->addChild(child); |
75 #if ENABLE(OILPAN) | 74 #if ENABLE(OILPAN) |
76 if (currentParent && !newParent) | 75 if (currentParent && !newParent) |
77 child->dispose(); | 76 child->dispose(); |
78 #endif | 77 #endif |
79 } | 78 } |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 void HTMLFrameOwnerElement::trace(Visitor* visitor) | 266 void HTMLFrameOwnerElement::trace(Visitor* visitor) |
268 { | 267 { |
269 visitor->trace(m_contentFrame); | 268 visitor->trace(m_contentFrame); |
270 visitor->trace(m_widget); | 269 visitor->trace(m_widget); |
271 HTMLElement::trace(visitor); | 270 HTMLElement::trace(visitor); |
272 FrameOwner::trace(visitor); | 271 FrameOwner::trace(visitor); |
273 } | 272 } |
274 | 273 |
275 | 274 |
276 } // namespace blink | 275 } // namespace blink |
OLD | NEW |