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

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

Issue 1477023003: Refactor the Heap into ThreadHeap to prepare for per thread heaps Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 m_inlineStyle = other.m_inlineStyle->immutableCopyIfNeeded(); 157 m_inlineStyle = other.m_inlineStyle->immutableCopyIfNeeded();
158 } 158 }
159 159
160 for (unsigned i = 0; i < m_arraySize; ++i) 160 for (unsigned i = 0; i < m_arraySize; ++i)
161 new (&m_attributeArray[i]) Attribute(other.m_attributeVector.at(i)); 161 new (&m_attributeArray[i]) Attribute(other.m_attributeVector.at(i));
162 } 162 }
163 163
164 PassRefPtrWillBeRawPtr<ShareableElementData> ShareableElementData::createWithAtt ributes(const Vector<Attribute>& attributes) 164 PassRefPtrWillBeRawPtr<ShareableElementData> ShareableElementData::createWithAtt ributes(const Vector<Attribute>& attributes)
165 { 165 {
166 #if ENABLE(OILPAN) 166 #if ENABLE(OILPAN)
167 void* slot = Heap::allocate<ElementData>(sizeForShareableElementDataWithAttr ibuteCount(attributes.size())); 167 void* slot = ThreadHeap::allocate<ElementData>(sizeForShareableElementDataWi thAttributeCount(attributes.size()));
168 #else 168 #else
169 void* slot = WTF::Partitions::fastMalloc(sizeForShareableElementDataWithAttr ibuteCount(attributes.size()), WTF_HEAP_PROFILER_TYPE_NAME(ShareableElementData) ); 169 void* slot = WTF::Partitions::fastMalloc(sizeForShareableElementDataWithAttr ibuteCount(attributes.size()), WTF_HEAP_PROFILER_TYPE_NAME(ShareableElementData) );
170 #endif 170 #endif
171 return adoptRefWillBeNoop(new (slot) ShareableElementData(attributes)); 171 return adoptRefWillBeNoop(new (slot) ShareableElementData(attributes));
172 } 172 }
173 173
174 UniqueElementData::UniqueElementData() 174 UniqueElementData::UniqueElementData()
175 { 175 {
176 } 176 }
177 177
(...skipping 19 matching lines...) Expand all
197 } 197 }
198 198
199 PassRefPtrWillBeRawPtr<UniqueElementData> UniqueElementData::create() 199 PassRefPtrWillBeRawPtr<UniqueElementData> UniqueElementData::create()
200 { 200 {
201 return adoptRefWillBeNoop(new UniqueElementData); 201 return adoptRefWillBeNoop(new UniqueElementData);
202 } 202 }
203 203
204 PassRefPtrWillBeRawPtr<ShareableElementData> UniqueElementData::makeShareableCop y() const 204 PassRefPtrWillBeRawPtr<ShareableElementData> UniqueElementData::makeShareableCop y() const
205 { 205 {
206 #if ENABLE(OILPAN) 206 #if ENABLE(OILPAN)
207 void* slot = Heap::allocate<ElementData>(sizeForShareableElementDataWithAttr ibuteCount(m_attributeVector.size())); 207 void* slot = ThreadHeap::allocate<ElementData>(sizeForShareableElementDataWi thAttributeCount(m_attributeVector.size()));
208 #else 208 #else
209 void* slot = WTF::Partitions::fastMalloc(sizeForShareableElementDataWithAttr ibuteCount(m_attributeVector.size()), WTF_HEAP_PROFILER_TYPE_NAME(ShareableEleme ntData)); 209 void* slot = WTF::Partitions::fastMalloc(sizeForShareableElementDataWithAttr ibuteCount(m_attributeVector.size()), WTF_HEAP_PROFILER_TYPE_NAME(ShareableEleme ntData));
210 #endif 210 #endif
211 return adoptRefWillBeNoop(new (slot) ShareableElementData(*this)); 211 return adoptRefWillBeNoop(new (slot) ShareableElementData(*this));
212 } 212 }
213 213
214 DEFINE_TRACE_AFTER_DISPATCH(UniqueElementData) 214 DEFINE_TRACE_AFTER_DISPATCH(UniqueElementData)
215 { 215 {
216 visitor->trace(m_presentationAttributeStyle); 216 visitor->trace(m_presentationAttributeStyle);
217 ElementData::traceAfterDispatch(visitor); 217 ElementData::traceAfterDispatch(visitor);
218 } 218 }
219 219
220 } // namespace blink 220 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ElementData.h ('k') | third_party/WebKit/Source/core/dom/IntersectionObserver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698