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

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

Issue 265793017: Oilpan: move node/element rare data objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + assert for Nodes having no renderer on destruction. Created 6 years, 7 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) 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 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 14 matching lines...) Expand all
25 #include "core/animation/ActiveAnimations.h" 25 #include "core/animation/ActiveAnimations.h"
26 #include "core/dom/DatasetDOMStringMap.h" 26 #include "core/dom/DatasetDOMStringMap.h"
27 #include "core/dom/NamedNodeMap.h" 27 #include "core/dom/NamedNodeMap.h"
28 #include "core/dom/NodeRareData.h" 28 #include "core/dom/NodeRareData.h"
29 #include "core/dom/PseudoElement.h" 29 #include "core/dom/PseudoElement.h"
30 #include "core/dom/custom/CustomElementDefinition.h" 30 #include "core/dom/custom/CustomElementDefinition.h"
31 #include "core/dom/shadow/ElementShadow.h" 31 #include "core/dom/shadow/ElementShadow.h"
32 #include "core/html/ClassList.h" 32 #include "core/html/ClassList.h"
33 #include "core/html/ime/InputMethodContext.h" 33 #include "core/html/ime/InputMethodContext.h"
34 #include "core/rendering/style/StyleInheritedData.h" 34 #include "core/rendering/style/StyleInheritedData.h"
35 #include "platform/heap/Handle.h"
35 #include "wtf/OwnPtr.h" 36 #include "wtf/OwnPtr.h"
36 37
37 namespace WebCore { 38 namespace WebCore {
38 39
39 class HTMLElement; 40 class HTMLElement;
40 41
41 class ElementRareData : public NodeRareData { 42 class ElementRareData : public NodeRareData {
42 public: 43 public:
43 static PassOwnPtr<ElementRareData> create(RenderObject* renderer) 44 static PassOwnPtrWillBeRawPtr<ElementRareData> create(RenderObject* renderer )
44 { 45 {
45 return adoptPtr(new ElementRareData(renderer)); 46 return adoptPtrWillBeNoop(new ElementRareData(renderer));
46 } 47 }
47 48
48 ~ElementRareData(); 49 ~ElementRareData();
49 50
50 void setPseudoElement(PseudoId, PassRefPtr<PseudoElement>); 51 void setPseudoElement(PseudoId, PassRefPtr<PseudoElement>);
51 PseudoElement* pseudoElement(PseudoId) const; 52 PseudoElement* pseudoElement(PseudoId) const;
52 53
53 void resetStyleState(); 54 void resetStyleState();
54 55
55 short tabIndex() const { return m_tabindex; } 56 short tabIndex() const { return m_tabindex; }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 m_inputMethodContext = InputMethodContext::create(element); 113 m_inputMethodContext = InputMethodContext::create(element);
113 return *m_inputMethodContext; 114 return *m_inputMethodContext;
114 } 115 }
115 116
116 bool hasPseudoElements() const; 117 bool hasPseudoElements() const;
117 void clearPseudoElements(); 118 void clearPseudoElements();
118 119
119 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti on) { m_customElementDefinition = definition; } 120 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti on) { m_customElementDefinition = definition; }
120 CustomElementDefinition* customElementDefinition() const { return m_customEl ementDefinition.get(); } 121 CustomElementDefinition* customElementDefinition() const { return m_customEl ementDefinition.get(); }
121 122
123 void traceAfterDispatch(Visitor*);
124
122 private: 125 private:
123 short m_tabindex; 126 short m_tabindex;
124 127
125 IntSize m_savedLayerScrollOffset; 128 IntSize m_savedLayerScrollOffset;
126 129
127 OwnPtr<DatasetDOMStringMap> m_dataset; 130 OwnPtr<DatasetDOMStringMap> m_dataset;
128 OwnPtr<ClassList> m_classList; 131 OwnPtr<ClassList> m_classList;
129 OwnPtr<ElementShadow> m_shadow; 132 OwnPtr<ElementShadow> m_shadow;
130 OwnPtr<NamedNodeMap> m_attributeMap; 133 OwnPtr<NamedNodeMap> m_attributeMap;
131 OwnPtr<InputMethodContext> m_inputMethodContext; 134 OwnPtr<InputMethodContext> m_inputMethodContext;
132 OwnPtrWillBePersistent<ActiveAnimations> m_activeAnimations; 135 OwnPtrWillBeMember<ActiveAnimations> m_activeAnimations;
133 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; 136 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper;
134 137
135 RefPtr<RenderStyle> m_computedStyle; 138 RefPtr<RenderStyle> m_computedStyle;
136 RefPtr<CustomElementDefinition> m_customElementDefinition; 139 RefPtr<CustomElementDefinition> m_customElementDefinition;
137 140
138 RefPtr<PseudoElement> m_generatedBefore; 141 RefPtr<PseudoElement> m_generatedBefore;
139 RefPtr<PseudoElement> m_generatedAfter; 142 RefPtr<PseudoElement> m_generatedAfter;
140 RefPtr<PseudoElement> m_backdrop; 143 RefPtr<PseudoElement> m_backdrop;
141 144
142 explicit ElementRareData(RenderObject*); 145 explicit ElementRareData(RenderObject*);
143 }; 146 };
144 147
145 inline ElementRareData::ElementRareData(RenderObject* renderer) 148 inline ElementRareData::ElementRareData(RenderObject* renderer)
146 : NodeRareData(renderer) 149 : NodeRareData(renderer)
147 , m_tabindex(0) 150 , m_tabindex(0)
148 { 151 {
152 m_isElementRareData = true;
149 } 153 }
150 154
151 inline ElementRareData::~ElementRareData() 155 inline ElementRareData::~ElementRareData()
152 { 156 {
157 #if !ENABLE(OILPAN)
153 ASSERT(!m_shadow); 158 ASSERT(!m_shadow);
159 #endif
154 ASSERT(!m_generatedBefore); 160 ASSERT(!m_generatedBefore);
155 ASSERT(!m_generatedAfter); 161 ASSERT(!m_generatedAfter);
156 ASSERT(!m_backdrop); 162 ASSERT(!m_backdrop);
157 } 163 }
158 164
159 inline bool ElementRareData::hasPseudoElements() const 165 inline bool ElementRareData::hasPseudoElements() const
160 { 166 {
161 return m_generatedBefore || m_generatedAfter || m_backdrop; 167 return m_generatedBefore || m_generatedAfter || m_backdrop;
162 } 168 }
163 169
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 212 }
207 213
208 inline void ElementRareData::resetStyleState() 214 inline void ElementRareData::resetStyleState()
209 { 215 {
210 clearElementFlag(StyleAffectedByEmpty); 216 clearElementFlag(StyleAffectedByEmpty);
211 } 217 }
212 218
213 } // namespace 219 } // namespace
214 220
215 #endif // ElementRareData_h 221 #endif // ElementRareData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698