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

Side by Side Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 1770523002: Track connected subframes per-Document instead of per-Node. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix various crashes but still doesn't refcount tracked nodes (and needs to) Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 return; 2222 return;
2223 } 2223 }
2224 2224
2225 #if ENABLE(SECURITY_ASSERT) 2225 #if ENABLE(SECURITY_ASSERT)
2226 m_deletionHasBegun = true; 2226 m_deletionHasBegun = true;
2227 #endif 2227 #endif
2228 delete this; 2228 delete this;
2229 } 2229 }
2230 #endif 2230 #endif
2231 2231
2232 unsigned Node::connectedSubframeCount() const
2233 {
2234 return hasRareData() ? rareData()->connectedSubframeCount() : 0;
2235 }
2236
2237 void Node::incrementConnectedSubframeCount(unsigned amount)
2238 {
2239 ASSERT(isContainerNode());
2240 ensureRareData().incrementConnectedSubframeCount(amount);
2241 }
2242
2243 void Node::decrementConnectedSubframeCount(unsigned amount)
2244 {
2245 rareData()->decrementConnectedSubframeCount(amount);
2246 }
2247
2248 void Node::updateAncestorConnectedSubframeCountForInsertion() const
2249 {
2250 unsigned count = connectedSubframeCount();
2251
2252 if (!count)
2253 return;
2254
2255 ScriptForbiddenScope forbidScriptDuringRawIteration;
2256 for (Node* node = parentOrShadowHostNode(); node; node = node->parentOrShado wHostNode())
2257 node->incrementConnectedSubframeCount(count);
2258 }
2259
2260 PassRefPtrWillBeRawPtr<StaticNodeList> Node::getDestinationInsertionPoints() 2232 PassRefPtrWillBeRawPtr<StaticNodeList> Node::getDestinationInsertionPoints()
2261 { 2233 {
2262 updateDistribution(); 2234 updateDistribution();
2263 WillBeHeapVector<RawPtrWillBeMember<InsertionPoint>, 8> insertionPoints; 2235 WillBeHeapVector<RawPtrWillBeMember<InsertionPoint>, 8> insertionPoints;
2264 collectDestinationInsertionPoints(*this, insertionPoints); 2236 collectDestinationInsertionPoints(*this, insertionPoints);
2265 WillBeHeapVector<RefPtrWillBeMember<Node>> filteredInsertionPoints; 2237 WillBeHeapVector<RefPtrWillBeMember<Node>> filteredInsertionPoints;
2266 for (size_t i = 0; i < insertionPoints.size(); ++i) { 2238 for (size_t i = 0; i < insertionPoints.size(); ++i) {
2267 InsertionPoint* insertionPoint = insertionPoints[i]; 2239 InsertionPoint* insertionPoint = insertionPoints[i];
2268 ASSERT(insertionPoint->containingShadowRoot()); 2240 ASSERT(insertionPoint->containingShadowRoot());
2269 if (!insertionPoint->containingShadowRoot()->isOpenOrV0()) 2241 if (!insertionPoint->containingShadowRoot()->isOpenOrV0())
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
2441 2413
2442 void showNodePath(const blink::Node* node) 2414 void showNodePath(const blink::Node* node)
2443 { 2415 {
2444 if (node) 2416 if (node)
2445 node->showNodePathForThis(); 2417 node->showNodePathForThis();
2446 else 2418 else
2447 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2419 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2448 } 2420 }
2449 2421
2450 #endif 2422 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/dom/NodeRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698