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

Side by Side Diff: Source/core/dom/ContainerNodeAlgorithms.h

Issue 53303002: Have HTMLFrameOwnerElement / SubframeLoadingDisabler deal with references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tiny fix Created 7 years, 1 month 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 | « Source/core/dom/ContainerNode.cpp ('k') | Source/core/frame/Frame.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 * (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 306
307 ElementShadow* shadow = root.isElementNode() ? toElement(root).shadow() : 0; 307 ElementShadow* shadow = root.isElementNode() ? toElement(root).shadow() : 0;
308 if (shadow) 308 if (shadow)
309 collectFrameOwners(*shadow); 309 collectFrameOwners(*shadow);
310 } 310 }
311 311
312 inline void ChildFrameDisconnector::disconnectCollectedFrameOwners() 312 inline void ChildFrameDisconnector::disconnectCollectedFrameOwners()
313 { 313 {
314 // Must disable frame loading in the subtree so an unload handler cannot 314 // Must disable frame loading in the subtree so an unload handler cannot
315 // insert more frames and create loaded frames in detached subtrees. 315 // insert more frames and create loaded frames in detached subtrees.
316 SubframeLoadingDisabler disabler(&m_root); 316 SubframeLoadingDisabler disabler(m_root);
317 317
318 for (unsigned i = 0; i < m_frameOwners.size(); ++i) { 318 for (unsigned i = 0; i < m_frameOwners.size(); ++i) {
319 HTMLFrameOwnerElement* owner = m_frameOwners[i].get(); 319 HTMLFrameOwnerElement* owner = m_frameOwners[i].get();
320 // Don't need to traverse up the tree for the first owner since no 320 // Don't need to traverse up the tree for the first owner since no
321 // script could have moved it. 321 // script could have moved it.
322 if (!i || m_root.containsIncludingShadowDOM(owner)) 322 if (!i || m_root.containsIncludingShadowDOM(owner))
323 owner->disconnectContentFrame(); 323 owner->disconnectContentFrame();
324 } 324 }
325 } 325 }
326 326
(...skipping 12 matching lines...) Expand all
339 for (Node* child = m_root.firstChild(); child; child = child->nextSiblin g()) 339 for (Node* child = m_root.firstChild(); child; child = child->nextSiblin g())
340 collectFrameOwners(*child); 340 collectFrameOwners(*child);
341 } 341 }
342 342
343 disconnectCollectedFrameOwners(); 343 disconnectCollectedFrameOwners();
344 } 344 }
345 345
346 } // namespace WebCore 346 } // namespace WebCore
347 347
348 #endif // ContainerNodeAlgorithms_h 348 #endif // ContainerNodeAlgorithms_h
OLDNEW
« no previous file with comments | « Source/core/dom/ContainerNode.cpp ('k') | Source/core/frame/Frame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698