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

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

Issue 2396693004: [wrapper-tracing] MutationObserver: Add write barriers (Closed)
Patch Set: Move WB below setting the flag, actually making the getter work 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/Node.cpp ('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,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details. 13 * Library General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU Library General Public License 15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to 16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA. 18 * Boston, MA 02110-1301, USA.
19 * 19 *
20 */ 20 */
21 21
22 #ifndef NodeRareData_h 22 #ifndef NodeRareData_h
23 #define NodeRareData_h 23 #define NodeRareData_h
24 24
25 #include "bindings/core/v8/ScriptWrappableVisitor.h"
25 #include "core/dom/MutationObserverRegistration.h" 26 #include "core/dom/MutationObserverRegistration.h"
26 #include "core/dom/NodeListsNodeData.h" 27 #include "core/dom/NodeListsNodeData.h"
27 #include "platform/heap/Handle.h" 28 #include "platform/heap/Handle.h"
28 #include "wtf/HashSet.h" 29 #include "wtf/HashSet.h"
29 30
30 namespace blink { 31 namespace blink {
31 32
32 class NodeMutationObserverData final 33 class NodeMutationObserverData final
33 : public GarbageCollected<NodeMutationObserverData> { 34 : public GarbageCollected<NodeMutationObserverData> {
34 WTF_MAKE_NONCOPYABLE(NodeMutationObserverData); 35 WTF_MAKE_NONCOPYABLE(NodeMutationObserverData);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 DCHECK(ThreadState::current()->isGCForbidden()); 78 DCHECK(ThreadState::current()->isGCForbidden());
78 if (!m_nodeLists) 79 if (!m_nodeLists)
79 m_nodeLists = NodeListsNodeData::create(); 80 m_nodeLists = NodeListsNodeData::create();
80 return *m_nodeLists; 81 return *m_nodeLists;
81 } 82 }
82 83
83 NodeMutationObserverData* mutationObserverData() { 84 NodeMutationObserverData* mutationObserverData() {
84 return m_mutationObserverData.get(); 85 return m_mutationObserverData.get();
85 } 86 }
86 NodeMutationObserverData& ensureMutationObserverData() { 87 NodeMutationObserverData& ensureMutationObserverData() {
87 if (!m_mutationObserverData) 88 if (!m_mutationObserverData) {
88 m_mutationObserverData = NodeMutationObserverData::create(); 89 m_mutationObserverData = NodeMutationObserverData::create();
90 ScriptWrappableVisitor::writeBarrier(this, m_mutationObserverData);
91 }
89 return *m_mutationObserverData; 92 return *m_mutationObserverData;
90 } 93 }
91 94
92 unsigned connectedSubframeCount() const { return m_connectedFrameCount; } 95 unsigned connectedSubframeCount() const { return m_connectedFrameCount; }
93 void incrementConnectedSubframeCount(); 96 void incrementConnectedSubframeCount();
94 void decrementConnectedSubframeCount() { 97 void decrementConnectedSubframeCount() {
95 DCHECK(m_connectedFrameCount); 98 DCHECK(m_connectedFrameCount);
96 --m_connectedFrameCount; 99 --m_connectedFrameCount;
97 } 100 }
98 101
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 unsigned m_elementFlags : NumberOfElementFlags; 143 unsigned m_elementFlags : NumberOfElementFlags;
141 unsigned m_restyleFlags : NumberOfDynamicRestyleFlags; 144 unsigned m_restyleFlags : NumberOfDynamicRestyleFlags;
142 145
143 protected: 146 protected:
144 unsigned m_isElementRareData : 1; 147 unsigned m_isElementRareData : 1;
145 }; 148 };
146 149
147 } // namespace blink 150 } // namespace blink
148 151
149 #endif // NodeRareData_h 152 #endif // NodeRareData_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698