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

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

Issue 2435003002: [wrapper-tracing] Add NodeList write barriers (Closed)
Patch Set: 2nd try Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/NodeListsNodeData.h » ('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) 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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 3965 matching lines...) Expand 10 before | Expand all | Expand 10 after
3976 if (m_cssTarget) 3976 if (m_cssTarget)
3977 m_cssTarget->pseudoStateChanged(CSSSelector::PseudoTarget); 3977 m_cssTarget->pseudoStateChanged(CSSSelector::PseudoTarget);
3978 m_cssTarget = newTarget; 3978 m_cssTarget = newTarget;
3979 if (m_cssTarget) 3979 if (m_cssTarget)
3980 m_cssTarget->pseudoStateChanged(CSSSelector::PseudoTarget); 3980 m_cssTarget->pseudoStateChanged(CSSSelector::PseudoTarget);
3981 } 3981 }
3982 3982
3983 void Document::registerNodeList(const LiveNodeListBase* list) { 3983 void Document::registerNodeList(const LiveNodeListBase* list) {
3984 DCHECK(!m_nodeLists[list->invalidationType()].contains(list)); 3984 DCHECK(!m_nodeLists[list->invalidationType()].contains(list));
3985 m_nodeLists[list->invalidationType()].add(list); 3985 m_nodeLists[list->invalidationType()].add(list);
3986 ScriptWrappableVisitor::writeBarrier(this, list);
3986 if (list->isRootedAtTreeScope()) 3987 if (list->isRootedAtTreeScope())
3987 m_listsInvalidatedAtDocument.add(list); 3988 m_listsInvalidatedAtDocument.add(list);
3988 } 3989 }
3989 3990
3990 void Document::unregisterNodeList(const LiveNodeListBase* list) { 3991 void Document::unregisterNodeList(const LiveNodeListBase* list) {
3991 DCHECK(m_nodeLists[list->invalidationType()].contains(list)); 3992 DCHECK(m_nodeLists[list->invalidationType()].contains(list));
3992 m_nodeLists[list->invalidationType()].remove(list); 3993 m_nodeLists[list->invalidationType()].remove(list);
3993 if (list->isRootedAtTreeScope()) { 3994 if (list->isRootedAtTreeScope()) {
3994 DCHECK(m_listsInvalidatedAtDocument.contains(list)); 3995 DCHECK(m_listsInvalidatedAtDocument.contains(list));
3995 m_listsInvalidatedAtDocument.remove(list); 3996 m_listsInvalidatedAtDocument.remove(list);
3996 } 3997 }
3997 } 3998 }
3998 3999
3999 void Document::registerNodeListWithIdNameCache(const LiveNodeListBase* list) { 4000 void Document::registerNodeListWithIdNameCache(const LiveNodeListBase* list) {
4000 DCHECK(!m_nodeLists[InvalidateOnIdNameAttrChange].contains(list)); 4001 DCHECK(!m_nodeLists[InvalidateOnIdNameAttrChange].contains(list));
4001 m_nodeLists[InvalidateOnIdNameAttrChange].add(list); 4002 m_nodeLists[InvalidateOnIdNameAttrChange].add(list);
4003 ScriptWrappableVisitor::writeBarrier(this, list);
4002 } 4004 }
4003 4005
4004 void Document::unregisterNodeListWithIdNameCache(const LiveNodeListBase* list) { 4006 void Document::unregisterNodeListWithIdNameCache(const LiveNodeListBase* list) {
4005 DCHECK(m_nodeLists[InvalidateOnIdNameAttrChange].contains(list)); 4007 DCHECK(m_nodeLists[InvalidateOnIdNameAttrChange].contains(list));
4006 m_nodeLists[InvalidateOnIdNameAttrChange].remove(list); 4008 m_nodeLists[InvalidateOnIdNameAttrChange].remove(list);
4007 } 4009 }
4008 4010
4009 void Document::attachNodeIterator(NodeIterator* ni) { 4011 void Document::attachNodeIterator(NodeIterator* ni) {
4010 m_nodeIterators.add(ni); 4012 m_nodeIterators.add(ni);
4011 } 4013 }
(...skipping 2383 matching lines...) Expand 10 before | Expand all | Expand 10 after
6395 } 6397 }
6396 6398
6397 void showLiveDocumentInstances() { 6399 void showLiveDocumentInstances() {
6398 WeakDocumentSet& set = liveDocumentSet(); 6400 WeakDocumentSet& set = liveDocumentSet();
6399 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6401 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6400 for (Document* document : set) 6402 for (Document* document : set)
6401 fprintf(stderr, "- Document %p URL: %s\n", document, 6403 fprintf(stderr, "- Document %p URL: %s\n", document,
6402 document->url().getString().utf8().data()); 6404 document->url().getString().utf8().data());
6403 } 6405 }
6404 #endif 6406 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/NodeListsNodeData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698