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

Side by Side Diff: third_party/WebKit/Source/core/dom/NodeRareData.h

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 | « third_party/WebKit/Source/core/dom/NodeListsNodeData.h ('k') | no next file » | 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) 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> 3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com>
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 return new NodeRareData(layoutObject); 69 return new NodeRareData(layoutObject);
70 } 70 }
71 71
72 void clearNodeLists() { m_nodeLists.clear(); } 72 void clearNodeLists() { m_nodeLists.clear(); }
73 NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); } 73 NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); }
74 // ensureNodeLists() and a following NodeListsNodeData functions must be 74 // ensureNodeLists() and a following NodeListsNodeData functions must be
75 // wrapped with a ThreadState::GCForbiddenScope in order to avoid an 75 // wrapped with a ThreadState::GCForbiddenScope in order to avoid an
76 // initialized m_nodeLists is cleared by NodeRareData::traceAfterDispatch(). 76 // initialized m_nodeLists is cleared by NodeRareData::traceAfterDispatch().
77 NodeListsNodeData& ensureNodeLists() { 77 NodeListsNodeData& ensureNodeLists() {
78 DCHECK(ThreadState::current()->isGCForbidden()); 78 DCHECK(ThreadState::current()->isGCForbidden());
79 if (!m_nodeLists) 79 if (!m_nodeLists) {
80 m_nodeLists = NodeListsNodeData::create(); 80 m_nodeLists = NodeListsNodeData::create();
81 ScriptWrappableVisitor::writeBarrier(this, m_nodeLists);
82 }
81 return *m_nodeLists; 83 return *m_nodeLists;
82 } 84 }
83 85
84 NodeMutationObserverData* mutationObserverData() { 86 NodeMutationObserverData* mutationObserverData() {
85 return m_mutationObserverData.get(); 87 return m_mutationObserverData.get();
86 } 88 }
87 NodeMutationObserverData& ensureMutationObserverData() { 89 NodeMutationObserverData& ensureMutationObserverData() {
88 if (!m_mutationObserverData) { 90 if (!m_mutationObserverData) {
89 m_mutationObserverData = NodeMutationObserverData::create(); 91 m_mutationObserverData = NodeMutationObserverData::create();
90 ScriptWrappableVisitor::writeBarrier(this, m_mutationObserverData); 92 ScriptWrappableVisitor::writeBarrier(this, m_mutationObserverData);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 unsigned m_elementFlags : NumberOfElementFlags; 145 unsigned m_elementFlags : NumberOfElementFlags;
144 unsigned m_restyleFlags : NumberOfDynamicRestyleFlags; 146 unsigned m_restyleFlags : NumberOfDynamicRestyleFlags;
145 147
146 protected: 148 protected:
147 unsigned m_isElementRareData : 1; 149 unsigned m_isElementRareData : 1;
148 }; 150 };
149 151
150 } // namespace blink 152 } // namespace blink
151 153
152 #endif // NodeRareData_h 154 #endif // NodeRareData_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/NodeListsNodeData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698