Changeset 124444 in webkit
- Timestamp:
- Aug 2, 2012 5:52:27 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r124443 r124444 1 2012-08-02 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: remove extraObjectSize parameter from MemoryClassInfo constructor 4 https://bugs.webkit.org/show_bug.cgi?id=92981 5 6 Reviewed by Alexander Pavlov. 7 8 Refactored MemoryInstrumentation to get rid of extraSize parameter from 9 MemoryObjectInfo constructor and MemoryObjectInfo::reportObjectInfo. The 10 extra size should always be reported as an object that occupies these extra 11 bytes. 12 13 * dom/ElementAttributeData.cpp: 14 (WebCore::ElementAttributeData::reportMemoryUsage): 15 (WebCore): 16 * dom/ElementAttributeData.h: 17 (WebCore): 18 (ElementAttributeData): 19 * dom/MemoryInstrumentation.h: 20 (WebCore::MemoryObjectInfo::reportObjectInfo): 21 (WebCore::MemoryClassInfo::MemoryClassInfo): 22 1 23 2012-08-02 Sheriff Bot <webkit.review.bot@gmail.com> 2 24 -
trunk/Source/WebCore/dom/ElementAttributeData.cpp
r123636 r124444 29 29 #include "Attr.h" 30 30 #include "CSSStyleSheet.h" 31 #include "MemoryInstrumentation.h" 31 32 #include "StyledElement.h" 32 33 … … 282 283 // The loop above should have cleaned out this element's Attr map. 283 284 ASSERT(!element->hasAttrList()); 285 } 286 287 void ElementAttributeData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 288 { 289 MemoryClassInfo<ElementAttributeData> info(memoryObjectInfo, this, MemoryInstrumentation::DOM); 290 info.addInstrumentedMember(m_inlineStyleDecl); 291 info.addInstrumentedMember(m_attributeStyle); 292 info.addMember(m_classNames); 293 info.addString(m_idForStyleResolution); 294 if (m_isMutable) 295 info.addVectorPtr(m_mutableAttributeVector); 296 else 297 info.addRawBuffer(m_attributes, m_arraySize * sizeof(Attribute)); 284 298 } 285 299 -
trunk/Source/WebCore/dom/ElementAttributeData.h
r123636 r124444 28 28 29 29 #include "Attribute.h" 30 #include "MemoryInstrumentation.h"31 30 #include "SpaceSplitString.h" 32 31 #include "StylePropertySet.h" … … 37 36 class Attr; 38 37 class Element; 38 class MemoryObjectInfo; 39 39 40 40 enum EInUpdateStyleAttribute { NotInUpdateStyleAttribute, InUpdateStyleAttribute }; … … 95 95 void detachAttrObjectsFromElement(Element*) const; 96 96 97 void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 98 { 99 MemoryClassInfo<ElementAttributeData> info(memoryObjectInfo, this, MemoryInstrumentation::DOM, m_arraySize * sizeof(Attribute)); 100 info.addInstrumentedMember(m_inlineStyleDecl.get()); 101 info.addInstrumentedMember(m_attributeStyle.get()); 102 info.addMember(m_classNames); 103 info.addString(m_idForStyleResolution); 104 if (m_isMutable) 105 info.addVector(*m_mutableAttributeVector); 106 } 97 void reportMemoryUsage(MemoryObjectInfo*) const; 107 98 108 99 private: -
trunk/Source/WebCore/dom/MemoryInstrumentation.h
r124412 r124444 146 146 template <typename T> friend class MemoryClassInfo; 147 147 148 template <typename T> void reportObjectInfo(const T*, MemoryInstrumentation::ObjectType objectType , size_t extraObjectSize)148 template <typename T> void reportObjectInfo(const T*, MemoryInstrumentation::ObjectType objectType) 149 149 { 150 150 if (m_objectType != MemoryInstrumentation::Other) 151 151 return; 152 152 m_objectType = objectType; 153 m_objectSize = sizeof(T) + extraObjectSize;153 m_objectSize = sizeof(T); 154 154 } 155 155 … … 162 162 class MemoryClassInfo { 163 163 public: 164 MemoryClassInfo(MemoryObjectInfo* memoryObjectInfo, const T* ptr, MemoryInstrumentation::ObjectType objectType , size_t extraObjectSize = 0)164 MemoryClassInfo(MemoryObjectInfo* memoryObjectInfo, const T* ptr, MemoryInstrumentation::ObjectType objectType) 165 165 : m_memoryObjectInfo(memoryObjectInfo) 166 166 , m_memoryInstrumentation(memoryObjectInfo->memoryInstrumentation()) 167 167 { 168 m_memoryObjectInfo->reportObjectInfo(ptr, objectType , extraObjectSize);168 m_memoryObjectInfo->reportObjectInfo(ptr, objectType); 169 169 m_objectType = memoryObjectInfo->objectType(); 170 170 }
Note: See TracChangeset
for help on using the changeset viewer.