diff options
Diffstat (limited to 'third_party/WebKit/Source')
422 files changed, 32 insertions, 7082 deletions
diff --git a/third_party/WebKit/Source/bindings/v8/DOMDataStore.cpp b/third_party/WebKit/Source/bindings/v8/DOMDataStore.cpp index fc4a395..bbcac2b 100644 --- a/third_party/WebKit/Source/bindings/v8/DOMDataStore.cpp +++ b/third_party/WebKit/Source/bindings/v8/DOMDataStore.cpp @@ -33,7 +33,6 @@ #include "bindings/v8/DOMWrapperMap.h" #include "bindings/v8/V8Binding.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/MainThread.h" namespace WebCore { @@ -74,10 +73,4 @@ DOMDataStore* DOMDataStore::current(v8::Isolate* isolate) return mainWorldStore(); } -void DOMDataStore::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Binding); - info.addMember(m_wrapperMap, "wrapperMap"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/bindings/v8/DOMDataStore.h b/third_party/WebKit/Source/bindings/v8/DOMDataStore.h index 9a41731..0b73453 100644 --- a/third_party/WebKit/Source/bindings/v8/DOMDataStore.h +++ b/third_party/WebKit/Source/bindings/v8/DOMDataStore.h @@ -114,8 +114,6 @@ public: return m_wrapperMap.get(V8T::toInternalPointer(object)); } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: template<typename V8T, typename T> inline void set(T* object, v8::Handle<v8::Object> wrapper, v8::Isolate* isolate, const WrapperConfiguration& configuration) diff --git a/third_party/WebKit/Source/bindings/v8/DOMWrapperMap.h b/third_party/WebKit/Source/bindings/v8/DOMWrapperMap.h index 5287117..86807d0 100644 --- a/third_party/WebKit/Source/bindings/v8/DOMWrapperMap.h +++ b/third_party/WebKit/Source/bindings/v8/DOMWrapperMap.h @@ -34,10 +34,8 @@ #include "bindings/v8/UnsafePersistent.h" #include "bindings/v8/V8Utilities.h" #include "bindings/v8/WrapperTypeInfo.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include <v8.h> #include "wtf/HashMap.h" -#include "wtf/MemoryInstrumentationHashMap.h" namespace WebCore { @@ -88,12 +86,6 @@ public: } } - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Binding); - info.addMember(m_map, "map"); - } - void removeAndDispose(KeyType* key) { typename MapType::iterator it = m_map.find(key); diff --git a/third_party/WebKit/Source/bindings/v8/ScriptDebugServer.cpp b/third_party/WebKit/Source/bindings/v8/ScriptDebugServer.cpp index 077f83a..25e8474 100644 --- a/third_party/WebKit/Source/bindings/v8/ScriptDebugServer.cpp +++ b/third_party/WebKit/Source/bindings/v8/ScriptDebugServer.cpp @@ -42,6 +42,7 @@ #include "wtf/StdLibExtras.h" #include "wtf/Vector.h" #include "wtf/dtoa/utils.h" +#include "wtf/text/CString.h" namespace WebCore { diff --git a/third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp b/third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp index f152935..1e34ad8 100644 --- a/third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp +++ b/third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp @@ -40,7 +40,6 @@ #include "bindings/v8/V8DOMWrapper.h" #include "bindings/v8/WrapperTypeInfo.h" #include "core/dom/Document.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/inspector/BindingVisitors.h" #include <v8-profiler.h> @@ -333,12 +332,6 @@ void ScriptProfiler::visitExternalArrays(ExternalArrayVisitor* visitor) v8::V8::VisitHandlesWithClassIds(&wrapperVisitor); } -void ScriptProfiler::collectBindingMemoryInfo(MemoryInstrumentation* instrumentation) -{ - V8PerIsolateData* data = V8PerIsolateData::current(); - instrumentation->addRootObject(data); -} - size_t ScriptProfiler::profilerSnapshotsSize() { v8::Isolate* isolate = v8::Isolate::GetCurrent(); diff --git a/third_party/WebKit/Source/bindings/v8/ScriptProfiler.h b/third_party/WebKit/Source/bindings/v8/ScriptProfiler.h index 61d4e22..39225796 100644 --- a/third_party/WebKit/Source/bindings/v8/ScriptProfiler.h +++ b/third_party/WebKit/Source/bindings/v8/ScriptProfiler.h @@ -80,7 +80,6 @@ public: static void visitNodeWrappers(WrappedNodeVisitor*); static void visitExternalStrings(ExternalStringVisitor*); static void visitExternalArrays(ExternalArrayVisitor*); - static void collectBindingMemoryInfo(MemoryInstrumentation*); static size_t profilerSnapshotsSize(); static HashMap<String, double>* currentProfileNameIdleTimeMap(); }; diff --git a/third_party/WebKit/Source/bindings/v8/ScriptWrappable.h b/third_party/WebKit/Source/bindings/v8/ScriptWrappable.h index fae6080..0afa631 100644 --- a/third_party/WebKit/Source/bindings/v8/ScriptWrappable.h +++ b/third_party/WebKit/Source/bindings/v8/ScriptWrappable.h @@ -34,7 +34,6 @@ #include "bindings/v8/UnsafePersistent.h" #include "bindings/v8/V8Utilities.h" #include "bindings/v8/WrapperTypeInfo.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include <v8.h> // Helper to call webCoreInitializeScriptWrappableForInterface in the global namespace. @@ -46,7 +45,7 @@ template <class C> inline void initializeScriptWrappableHelper(C* object) namespace WebCore { -class ScriptWrappable : public MemoryReporterTag { +class ScriptWrappable { public: ScriptWrappable() : m_wrapperOrTypeInfo(0) { } @@ -94,12 +93,6 @@ public: ASSERT(containsTypeInfo()); } - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.ignoreMember(m_wrapperOrTypeInfo); - } - static bool wrapperCanBeStoredInObject(const void*) { return false; } static bool wrapperCanBeStoredInObject(const ScriptWrappable*) { return true; } diff --git a/third_party/WebKit/Source/bindings/v8/V8Binding.cpp b/third_party/WebKit/Source/bindings/v8/V8Binding.cpp index c16f74a..7c79964 100644 --- a/third_party/WebKit/Source/bindings/v8/V8Binding.cpp +++ b/third_party/WebKit/Source/bindings/v8/V8Binding.cpp @@ -46,7 +46,6 @@ #include "core/dom/Element.h" #include "core/dom/NodeFilter.h" #include "core/dom/QualifiedName.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/inspector/BindingVisitors.h" #include "core/loader/FrameLoader.h" #include "core/loader/FrameLoaderClient.h" diff --git a/third_party/WebKit/Source/bindings/v8/V8PerIsolateData.cpp b/third_party/WebKit/Source/bindings/v8/V8PerIsolateData.cpp index 6238dfd..16d55e9 100644 --- a/third_party/WebKit/Source/bindings/v8/V8PerIsolateData.cpp +++ b/third_party/WebKit/Source/bindings/v8/V8PerIsolateData.cpp @@ -33,18 +33,6 @@ #include "bindings/v8/V8HiddenPropertyName.h" #include "bindings/v8/V8ObjectConstructor.h" #include "bindings/v8/V8ScriptRunner.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationVector.h" - -namespace WTF { - -// WrapperTypeInfo are statically allocated, don't count them. -template<> struct SequenceMemoryInstrumentationTraits<WebCore::WrapperTypeInfo*> { - template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&) { } -}; - -} namespace WebCore { @@ -104,27 +92,6 @@ v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate() return m_toStringTemplate.newLocal(m_isolate); } -void V8PerIsolateData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Binding); - info.addMember(m_rawTemplatesForMainWorld, "rawTemplatesForMainWorld"); - info.addMember(m_rawTemplatesForNonMainWorld, "rawTemplatesForNonMainWorld"); - info.addMember(m_templatesForMainWorld, "templatesForMainWorld"); - info.addMember(m_templatesForNonMainWorld, "templatesForNonMainWorld"); - info.addMember(m_stringCache, "stringCache"); - info.addMember(m_domDataList, "domDataList"); - info.addMember(m_workerDomDataStore, "workerDomDataStore"); - info.addMember(m_hiddenPropertyName, "hiddenPropertyName"); - info.addMember(m_gcEventData, "gcEventData"); - - info.addPrivateBuffer(ScriptProfiler::profilerSnapshotsSize(), WebCoreMemoryTypes::InspectorProfilerAgent, "HeapSnapshots", "snapshots"); - - info.ignoreMember(m_toStringTemplate); - info.ignoreMember(m_lazyEventListenerToStringTemplate); - info.ignoreMember(m_liveRoot); - info.ignoreMember(m_regexContext); -} - v8::Handle<v8::FunctionTemplate> V8PerIsolateData::privateTemplate(WrapperWorldType currentWorldType, void* privatePointer, v8::FunctionCallback callback, v8::Handle<v8::Value> data, v8::Handle<v8::Signature> signature, int length) { TemplateMap& templates = templateMap(currentWorldType); diff --git a/third_party/WebKit/Source/bindings/v8/V8PerIsolateData.h b/third_party/WebKit/Source/bindings/v8/V8PerIsolateData.h index 5314de9..5423e7d 100644 --- a/third_party/WebKit/Source/bindings/v8/V8PerIsolateData.h +++ b/third_party/WebKit/Source/bindings/v8/V8PerIsolateData.h @@ -122,8 +122,6 @@ public: GCEventData* gcEventData() { return m_gcEventData.get(); } - void reportMemoryUsage(MemoryObjectInfo*) const; - // Gives the system a hint that we should request garbage collection // upon the next close or navigation event, because some expensive // objects have been allocated that we want to take every opportunity diff --git a/third_party/WebKit/Source/bindings/v8/V8ValueCache.cpp b/third_party/WebKit/Source/bindings/v8/V8ValueCache.cpp index a426764..7e20131 100644 --- a/third_party/WebKit/Source/bindings/v8/V8ValueCache.cpp +++ b/third_party/WebKit/Source/bindings/v8/V8ValueCache.cpp @@ -28,19 +28,8 @@ #include "bindings/v8/V8Binding.h" #include "bindings/v8/V8Utilities.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationSequence.h" #include "wtf/text/StringHash.h" -namespace WTF { - -template<> struct SequenceMemoryInstrumentationTraits<v8::String*> { - template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&) { } -}; - -} - namespace WebCore { v8::Local<v8::String> StringCache::makeExternalString(const String& string) @@ -110,12 +99,4 @@ v8::Local<v8::String> StringCache::createStringAndInsertIntoCache(StringImpl* st return newString; } -void StringCache::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Binding); - info.addMember(m_stringCache, "stringCache"); - info.ignoreMember(m_lastV8String); - info.addMember(m_lastStringImpl, "lastStringImpl"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/bindings/v8/V8ValueCache.h b/third_party/WebKit/Source/bindings/v8/V8ValueCache.h index 881254a..e7eb52d 100644 --- a/third_party/WebKit/Source/bindings/v8/V8ValueCache.h +++ b/third_party/WebKit/Source/bindings/v8/V8ValueCache.h @@ -63,7 +63,6 @@ public: } void remove(StringImpl*); - void reportMemoryUsage(MemoryObjectInfo*) const; private: static v8::Local<v8::String> makeExternalString(const String&); diff --git a/third_party/WebKit/Source/core/core.gypi b/third_party/WebKit/Source/core/core.gypi index 8ed0376..a66655e 100644 --- a/third_party/WebKit/Source/core/core.gypi +++ b/third_party/WebKit/Source/core/core.gypi @@ -753,7 +753,6 @@ 'css/resolver/MatchedPropertiesCache.h', 'css/resolver/MatchResult.cpp', 'css/resolver/MatchResult.h', - 'css/resolver/MediaQueryResult.cpp', 'css/resolver/MediaQueryResult.h', 'css/resolver/ScopedStyleResolver.cpp', 'css/resolver/ScopedStyleResolver.h', @@ -899,8 +898,6 @@ 'inspector/DOMEditor.h', 'inspector/DOMPatchSupport.cpp', 'inspector/DOMPatchSupport.h', - 'inspector/HeapGraphSerializer.cpp', - 'inspector/HeapGraphSerializer.h', 'inspector/IdentifiersFactory.cpp', 'inspector/IdentifiersFactory.h', 'inspector/InjectedScript.cpp', @@ -991,8 +988,6 @@ 'inspector/JavaScriptCallFrame.h', 'inspector/JSONParser.cpp', 'inspector/JSONParser.h', - 'inspector/MemoryInstrumentationImpl.cpp', - 'inspector/MemoryInstrumentationImpl.h', 'inspector/NetworkResourcesData.cpp', 'inspector/NetworkResourcesData.h', 'inspector/PageConsoleAgent.cpp', @@ -1956,8 +1951,6 @@ 'dom/ViewportArguments.h', 'dom/VisitedLinkState.cpp', 'dom/VisitedLinkState.h', - 'dom/WebCoreMemoryInstrumentation.cpp', - 'dom/WebCoreMemoryInstrumentation.h', 'dom/WheelEvent.cpp', 'dom/WheelEvent.h', 'dom/WindowEventContext.cpp', @@ -2543,8 +2536,6 @@ 'platform/PlatformEvent.h', 'platform/PlatformInstrumentation.cpp', 'platform/PlatformInstrumentation.h', - 'platform/PlatformMemoryInstrumentation.cpp', - 'platform/PlatformMemoryInstrumentation.h', 'platform/PlatformSpeechSynthesisUtterance.cpp', 'platform/PlatformSpeechSynthesisUtterance.h', 'platform/PlatformSpeechSynthesisVoice.cpp', @@ -2986,8 +2977,6 @@ 'platform/graphics/skia/FontPlatformDataSkia.cpp', 'platform/graphics/skia/GlyphPageTreeNodeSkia.cpp', 'platform/graphics/skia/ImageSkia.cpp', - 'platform/graphics/skia/MemoryInstrumentationSkia.cpp', - 'platform/graphics/skia/MemoryInstrumentationSkia.h', 'platform/graphics/skia/NativeImageSkia.cpp', 'platform/graphics/skia/NativeImageSkia.h', 'platform/graphics/skia/OpaqueRegionSkia.cpp', @@ -3749,7 +3738,6 @@ 'platform/image-decoders/webp/WEBPImageDecoderTest.cpp', 'platform/text/DateTimeFormatTest.cpp', 'tests/FakeWebGraphicsContext3D.h', - 'tests/HeapGraphSerializerTest.cpp', 'tests/HTMLDimension.cpp', 'tests/LayoutUnit.cpp', 'tests/LinkRelAttribute.cpp', diff --git a/third_party/WebKit/Source/core/css/CSSArrayFunctionValue.cpp b/third_party/WebKit/Source/core/css/CSSArrayFunctionValue.cpp index 54cfb6a..b2dddbd57 100644 --- a/third_party/WebKit/Source/core/css/CSSArrayFunctionValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSArrayFunctionValue.cpp @@ -30,8 +30,6 @@ #include "config.h" #include "core/css/CSSArrayFunctionValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" - namespace WebCore { CSSArrayFunctionValue::CSSArrayFunctionValue() @@ -59,11 +57,5 @@ bool CSSArrayFunctionValue::equals(const CSSArrayFunctionValue& other) const return CSSValueList::equals(other); } -void CSSArrayFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSValueList::reportDescendantMemoryUsage(memoryObjectInfo); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSArrayFunctionValue.h b/third_party/WebKit/Source/core/css/CSSArrayFunctionValue.h index 5251229..2e25e9c 100644 --- a/third_party/WebKit/Source/core/css/CSSArrayFunctionValue.h +++ b/third_party/WebKit/Source/core/css/CSSArrayFunctionValue.h @@ -48,8 +48,6 @@ public: bool equals(const CSSArrayFunctionValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSArrayFunctionValue(); CSSArrayFunctionValue(const CSSArrayFunctionValue& cloneFrom); diff --git a/third_party/WebKit/Source/core/css/CSSAspectRatioValue.cpp b/third_party/WebKit/Source/core/css/CSSAspectRatioValue.cpp index bced41f..3a1fa31 100644 --- a/third_party/WebKit/Source/core/css/CSSAspectRatioValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSAspectRatioValue.cpp @@ -29,8 +29,6 @@ #include "config.h" #include "core/css/CSSAspectRatioValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" - namespace WebCore { String CSSAspectRatioValue::customCssText() const @@ -43,9 +41,4 @@ bool CSSAspectRatioValue::equals(const CSSAspectRatioValue& other) const return m_numeratorValue == other.m_numeratorValue && m_denominatorValue == other.m_denominatorValue; } -void CSSAspectRatioValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); -} - } diff --git a/third_party/WebKit/Source/core/css/CSSAspectRatioValue.h b/third_party/WebKit/Source/core/css/CSSAspectRatioValue.h index a9c5cc2..15bbce3 100644 --- a/third_party/WebKit/Source/core/css/CSSAspectRatioValue.h +++ b/third_party/WebKit/Source/core/css/CSSAspectRatioValue.h @@ -47,8 +47,6 @@ public: bool equals(const CSSAspectRatioValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSAspectRatioValue(float numeratorValue, float denominatorValue) : CSSValue(AspectRatioClass) diff --git a/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.cpp b/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.cpp index bcebb8d..792f9c2 100644 --- a/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.cpp @@ -26,7 +26,6 @@ #include "config.h" #include "core/css/CSSBorderImageSliceValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/WTFString.h" namespace WebCore { @@ -54,10 +53,4 @@ bool CSSBorderImageSliceValue::equals(const CSSBorderImageSliceValue& other) con return m_fill == other.m_fill && compareCSSValuePtr(m_slices, other.m_slices); } -void CSSBorderImageSliceValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_slices, "slices"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.h b/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.h index 758b934..37c1354 100644 --- a/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.h +++ b/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.h @@ -47,8 +47,6 @@ public: bool equals(const CSSBorderImageSliceValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - // These four values are used to make "cuts" in the border image. They can be numbers // or percentages. RefPtr<CSSPrimitiveValue> m_slices; diff --git a/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp b/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp index 7a367f6..a2aebba 100644 --- a/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp @@ -33,7 +33,6 @@ #include "core/css/CSSPrimitiveValueMappings.h" #include "core/css/resolver/StyleResolver.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/OwnPtr.h" #include "wtf/PassOwnPtr.h" #include "wtf/text/StringBuilder.h" @@ -169,11 +168,6 @@ bool CSSCalcValue::hasVariableReference() const return m_expression->hasVariableReference(); } -void CSSCalcValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); -} - double CSSCalcValue::clampToPermittedRange(double value) const { return m_nonNegative && value < 0 ? 0 : value; @@ -288,12 +282,6 @@ public: return compareCSSValuePtr(m_value, static_cast<const CSSCalcPrimitiveValue&>(other).m_value); } - virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const OVERRIDE - { - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_value, "value"); - } - virtual Type type() const { return CssCalcPrimitiveValue; } virtual CSSPrimitiveValue::UnitTypes primitiveType() const { @@ -455,13 +443,6 @@ public: return evaluate(leftValue, rightValue); } - virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const OVERRIDE - { - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_leftSide, "leftSide"); - info.addMember(m_rightSide, "rightSide"); - } - static String buildCssText(const String& leftExpression, const String& rightExpression, CalcOperator op) { StringBuilder result; diff --git a/third_party/WebKit/Source/core/css/CSSCalculationValue.h b/third_party/WebKit/Source/core/css/CSSCalculationValue.h index 2968a2d..5951906 100644 --- a/third_party/WebKit/Source/core/css/CSSCalculationValue.h +++ b/third_party/WebKit/Source/core/css/CSSCalculationValue.h @@ -73,7 +73,6 @@ public: virtual String serializeResolvingVariables(const HashMap<AtomicString, String>&) const = 0; virtual bool hasVariableReference() const = 0; virtual bool equals(const CSSCalcExpressionNode& other) const { return m_category == other.m_category && m_isInteger == other.m_isInteger; } - virtual void reportMemoryUsage(MemoryObjectInfo*) const = 0; virtual Type type() const = 0; CalculationCategory category() const { return m_category; } @@ -115,8 +114,6 @@ public: String customSerializeResolvingVariables(const HashMap<AtomicString, String>&) const; bool hasVariableReference() const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSCalcValue(PassRefPtr<CSSCalcExpressionNode> expression, CalculationPermittedValueRange range) : CSSValue(CalculationClass) diff --git a/third_party/WebKit/Source/core/css/CSSCanvasValue.cpp b/third_party/WebKit/Source/core/css/CSSCanvasValue.cpp index 842afaa..73fbfed 100644 --- a/third_party/WebKit/Source/core/css/CSSCanvasValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSCanvasValue.cpp @@ -26,7 +26,6 @@ #include "config.h" #include "core/css/CSSCanvasValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/rendering/RenderObject.h" #include "wtf/text/StringBuilder.h" @@ -100,12 +99,4 @@ bool CSSCanvasValue::equals(const CSSCanvasValue& other) const return m_name == other.m_name; } -void CSSCanvasValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSImageGeneratorValue::reportBaseClassMemoryUsage(memoryObjectInfo); - info.addMember(m_name, "name"); - info.addMember(m_element, "element"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSCanvasValue.h b/third_party/WebKit/Source/core/css/CSSCanvasValue.h index c8613fe..c67015f 100644 --- a/third_party/WebKit/Source/core/css/CSSCanvasValue.h +++ b/third_party/WebKit/Source/core/css/CSSCanvasValue.h @@ -49,8 +49,6 @@ public: bool equals(const CSSCanvasValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSCanvasValue(const String& name) : CSSImageGeneratorValue(CanvasClass) diff --git a/third_party/WebKit/Source/core/css/CSSCharsetRule.cpp b/third_party/WebKit/Source/core/css/CSSCharsetRule.cpp index 6799d89..0eb2d71 100644 --- a/third_party/WebKit/Source/core/css/CSSCharsetRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSCharsetRule.cpp @@ -21,8 +21,6 @@ #include "config.h" #include "core/css/CSSCharsetRule.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" - namespace WebCore { CSSCharsetRule::CSSCharsetRule(CSSStyleSheet* parent, const String& encoding) @@ -36,11 +34,4 @@ String CSSCharsetRule::cssText() const return "@charset \"" + m_encoding + "\";"; } -void CSSCharsetRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSRule::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_encoding, "encoding"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSCharsetRule.h b/third_party/WebKit/Source/core/css/CSSCharsetRule.h index 4ea26f0..a284fb1 100644 --- a/third_party/WebKit/Source/core/css/CSSCharsetRule.h +++ b/third_party/WebKit/Source/core/css/CSSCharsetRule.h @@ -38,7 +38,6 @@ public: virtual CSSRule::Type type() const OVERRIDE { return CHARSET_RULE; } virtual String cssText() const OVERRIDE; virtual void reattach(StyleRuleBase* rule) OVERRIDE { ASSERT_UNUSED(rule, !rule); } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; const String& encoding() const { return m_encoding; } void setEncoding(const String& encoding, ExceptionCode&) { m_encoding = encoding; } diff --git a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp index a0e8c8c..8ccea82 100644 --- a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp +++ b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp @@ -55,7 +55,6 @@ #include "core/dom/Document.h" #include "core/dom/ExceptionCode.h" #include "core/dom/PseudoElement.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/page/RuntimeCSSEnabled.h" #include "core/page/animation/AnimationController.h" #include "core/platform/graphics/FontFeatureSettings.h" @@ -2940,12 +2939,6 @@ PassRefPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::copyPropertiesI return MutableStylePropertySet::create(list.data(), list.size()); } -void CSSComputedStyleDeclaration::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_node, "node"); -} - CSSRule* CSSComputedStyleDeclaration::parentRule() const { return 0; diff --git a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.h b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.h index b0f6cc8..a8526cb 100644 --- a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.h +++ b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.h @@ -69,8 +69,6 @@ public: PassRefPtr<MutableStylePropertySet> copyPropertiesInSet(const Vector<CSSPropertyID>&) const; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: CSSComputedStyleDeclaration(PassRefPtr<Node>, bool allowVisitedStyle, const String&); diff --git a/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp b/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp index 77e4588..224ca45 100644 --- a/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp @@ -27,7 +27,6 @@ #include "core/css/CSSCrossfadeValue.h" #include "core/css/CSSImageValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/cache/CachedImage.h" #include "core/platform/graphics/CrossfadeGeneratedImage.h" #include "core/rendering/RenderObject.h" @@ -166,19 +165,6 @@ void CSSCrossfadeValue::loadSubimages(CachedResourceLoader* cachedResourceLoader m_crossfadeSubimageObserver.setReady(true); } -void CSSCrossfadeValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSImageGeneratorValue::reportBaseClassMemoryUsage(memoryObjectInfo); - info.addMember(m_fromValue, "fromValue"); - info.addMember(m_toValue, "toValue"); - info.addMember(m_percentageValue, "percentageValue"); - // FIXME: add instrumentation for - // m_cachedFromImage - // m_cachedToImage - // m_generatedImage -} - PassRefPtr<Image> CSSCrossfadeValue::image(RenderObject* renderer, const IntSize& size) { if (size.isEmpty()) diff --git a/third_party/WebKit/Source/core/css/CSSCrossfadeValue.h b/third_party/WebKit/Source/core/css/CSSCrossfadeValue.h index c0c953c..724e639 100644 --- a/third_party/WebKit/Source/core/css/CSSCrossfadeValue.h +++ b/third_party/WebKit/Source/core/css/CSSCrossfadeValue.h @@ -67,8 +67,6 @@ public: bool equals(const CSSCrossfadeValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSCrossfadeValue(PassRefPtr<CSSValue> fromValue, PassRefPtr<CSSValue> toValue) : CSSImageGeneratorValue(CrossfadeClass) diff --git a/third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp b/third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp index 032971a..fa653e3 100644 --- a/third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp @@ -25,7 +25,6 @@ #include "SVGNames.h" #include "core/css/CSSImageSetValue.h" #include "core/css/CSSImageValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/cache/CachedImage.h" #include "core/loader/cache/CachedResourceLoader.h" #include "core/rendering/style/StyleCachedImage.h" @@ -36,7 +35,6 @@ #include "core/svg/SVGLengthContext.h" #include "core/svg/SVGURIReference.h" #include "wtf/MathExtras.h" -#include "wtf/MemoryInstrumentationHashSet.h" #include "wtf/text/WTFString.h" namespace WebCore { @@ -199,12 +197,4 @@ bool CSSCursorImageValue::equals(const CSSCursorImageValue& other) const && compareCSSValuePtr(m_imageValue, other.m_imageValue); } -void CSSCursorImageValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - m_imageValue->reportMemoryUsage(memoryObjectInfo); - // FIXME: report m_image. It has never been allocated from any of our rendering custom heaps. - info.addMember(m_referencedElements, "referencedElements"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSCursorImageValue.h b/third_party/WebKit/Source/core/css/CSSCursorImageValue.h index 9dc6a4e..1f05c47 100644 --- a/third_party/WebKit/Source/core/css/CSSCursorImageValue.h +++ b/third_party/WebKit/Source/core/css/CSSCursorImageValue.h @@ -58,8 +58,6 @@ public: bool equals(const CSSCursorImageValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSCursorImageValue(PassRefPtr<CSSValue> imageValue, bool hasHotSpot, const IntPoint& hotSpot); diff --git a/third_party/WebKit/Source/core/css/CSSFilterRule.cpp b/third_party/WebKit/Source/core/css/CSSFilterRule.cpp index 8810884..c72a16e 100644 --- a/third_party/WebKit/Source/core/css/CSSFilterRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSFilterRule.cpp @@ -33,7 +33,6 @@ #include "core/css/PropertySetCSSStyleDeclaration.h" #include "core/css/StylePropertySet.h" #include "core/css/StyleRule.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -84,13 +83,5 @@ void CSSFilterRule::reattach(StyleRuleBase* rule) m_propertiesCSSOMWrapper->reattach(m_filterRule->mutableProperties()); } -void CSSFilterRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSRule::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_filterRule); - info.addMember(m_propertiesCSSOMWrapper); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSFilterRule.h b/third_party/WebKit/Source/core/css/CSSFilterRule.h index a26e9fb..9e60587 100644 --- a/third_party/WebKit/Source/core/css/CSSFilterRule.h +++ b/third_party/WebKit/Source/core/css/CSSFilterRule.h @@ -47,7 +47,6 @@ public: virtual CSSRule::Type type() const OVERRIDE { return WEBKIT_FILTER_RULE; } virtual String cssText() const OVERRIDE; virtual void reattach(StyleRuleBase*) OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; CSSStyleDeclaration* style() const; diff --git a/third_party/WebKit/Source/core/css/CSSFilterValue.cpp b/third_party/WebKit/Source/core/css/CSSFilterValue.cpp index b96e31e..4e25d95 100644 --- a/third_party/WebKit/Source/core/css/CSSFilterValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSFilterValue.cpp @@ -27,7 +27,6 @@ #include "core/css/CSSFilterValue.h" #include "core/css/CSSValueList.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/PassRefPtr.h" #include "wtf/text/WTFString.h" @@ -107,11 +106,5 @@ bool CSSFilterValue::equals(const CSSFilterValue& other) const return m_type == other.m_type && CSSValueList::equals(other); } -void CSSFilterValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSValueList::reportDescendantMemoryUsage(memoryObjectInfo); -} - } diff --git a/third_party/WebKit/Source/core/css/CSSFilterValue.h b/third_party/WebKit/Source/core/css/CSSFilterValue.h index 5bf7355..d937e0c 100644 --- a/third_party/WebKit/Source/core/css/CSSFilterValue.h +++ b/third_party/WebKit/Source/core/css/CSSFilterValue.h @@ -65,8 +65,6 @@ public: bool equals(const CSSFilterValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSFilterValue(FilterOperationType); CSSFilterValue(const CSSFilterValue& cloneFrom); diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceRule.cpp b/third_party/WebKit/Source/core/css/CSSFontFaceRule.cpp index 49bde93..f6cda03 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSFontFaceRule.cpp @@ -25,7 +25,6 @@ #include "core/css/PropertySetCSSStyleDeclaration.h" #include "core/css/StylePropertySet.h" #include "core/css/StyleRule.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -70,12 +69,4 @@ void CSSFontFaceRule::reattach(StyleRuleBase* rule) m_propertiesCSSOMWrapper->reattach(m_fontFaceRule->mutableProperties()); } -void CSSFontFaceRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSRule::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_fontFaceRule, "fontFaceRule"); - info.addMember(m_propertiesCSSOMWrapper, "propertiesCSSOMWrapper"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceRule.h b/third_party/WebKit/Source/core/css/CSSFontFaceRule.h index 121a13e..a042e8f 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceRule.h +++ b/third_party/WebKit/Source/core/css/CSSFontFaceRule.h @@ -39,7 +39,6 @@ public: virtual CSSRule::Type type() const OVERRIDE { return FONT_FACE_RULE; } virtual String cssText() const OVERRIDE; virtual void reattach(StyleRuleBase*) OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; CSSStyleDeclaration* style() const; diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp index 35012f5..fcac127 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp @@ -30,7 +30,6 @@ #include "core/css/StyleSheetContents.h" #include "core/dom/Document.h" #include "core/dom/Node.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/cache/CachedFont.h" #include "core/loader/cache/CachedResourceLoader.h" #include "core/loader/cache/CachedResourceRequest.h" @@ -109,15 +108,4 @@ bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const return m_isLocal == other.m_isLocal && m_format == other.m_format && m_resource == other.m_resource; } -void CSSFontFaceSrcValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_resource, "resource"); - info.addMember(m_format, "format"); - // FIXME: add m_cachedFont when MemoryCache is instrumented. -#if ENABLE(SVG_FONTS) - info.addMember(m_svgFontFaceElement, "svgFontFaceElement"); -#endif -} - } diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h index 9f19c39..78fbe84 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h +++ b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h @@ -73,8 +73,6 @@ public: bool equals(const CSSFontFaceSrcValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSFontFaceSrcValue(const String& resource, bool local) : CSSValue(FontFaceSrcClass) diff --git a/third_party/WebKit/Source/core/css/CSSFunctionValue.cpp b/third_party/WebKit/Source/core/css/CSSFunctionValue.cpp index 176f856..aca6270 100644 --- a/third_party/WebKit/Source/core/css/CSSFunctionValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSFunctionValue.cpp @@ -28,7 +28,6 @@ #include "core/css/CSSParserValues.h" #include "core/css/CSSValueList.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -63,11 +62,4 @@ bool CSSFunctionValue::equals(const CSSFunctionValue& other) const return m_name == other.m_name && compareCSSValuePtr(m_args, other.m_args); } -void CSSFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_name, "name"); - info.addMember(m_args, "args"); -} - } diff --git a/third_party/WebKit/Source/core/css/CSSFunctionValue.h b/third_party/WebKit/Source/core/css/CSSFunctionValue.h index b86fbc5..7ece47a 100644 --- a/third_party/WebKit/Source/core/css/CSSFunctionValue.h +++ b/third_party/WebKit/Source/core/css/CSSFunctionValue.h @@ -49,8 +49,6 @@ public: bool equals(const CSSFunctionValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: explicit CSSFunctionValue(CSSParserFunction*); CSSFunctionValue(String, PassRefPtr<CSSValueList>); diff --git a/third_party/WebKit/Source/core/css/CSSGradientValue.cpp b/third_party/WebKit/Source/core/css/CSSGradientValue.cpp index 0469e76..7b4e753 100644 --- a/third_party/WebKit/Source/core/css/CSSGradientValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSGradientValue.cpp @@ -30,13 +30,11 @@ #include "core/css/CSSCalculationValue.h" #include "core/dom/NodeRenderStyle.h" #include "core/dom/TextLinkColors.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/platform/graphics/GeneratorGeneratedImage.h" #include "core/platform/graphics/Gradient.h" #include "core/platform/graphics/Image.h" #include "core/platform/graphics/IntSize.h" #include "core/rendering/RenderObject.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/text/StringBuilder.h" #include "wtf/text/WTFString.h" @@ -44,13 +42,6 @@ using namespace std; namespace WebCore { -void CSSGradientColorStop::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_position, "position"); - info.addMember(m_color, "color"); -} - PassRefPtr<Image> CSSGradientValue::image(RenderObject* renderer, const IntSize& size) { if (size.isEmpty()) @@ -472,17 +463,6 @@ bool CSSGradientValue::knownToBeOpaque(const RenderObject*) const return true; } -void CSSGradientValue::reportBaseClassMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSImageGeneratorValue::reportBaseClassMemoryUsage(memoryObjectInfo); - info.addMember(m_firstX, "firstX"); - info.addMember(m_firstY, "firstY"); - info.addMember(m_secondX, "secondX"); - info.addMember(m_secondY, "secondY"); - info.addMember(m_stops, "stops"); -} - String CSSLinearGradientValue::customCssText() const { StringBuilder result; @@ -758,13 +738,6 @@ bool CSSLinearGradientValue::equals(const CSSLinearGradientValue& other) const return equalXorY && m_stops == other.m_stops; } -void CSSLinearGradientValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSGradientValue::reportBaseClassMemoryUsage(memoryObjectInfo); - info.addMember(m_angle, "angle"); -} - String CSSRadialGradientValue::customCssText() const { StringBuilder result; @@ -1197,16 +1170,4 @@ bool CSSRadialGradientValue::equals(const CSSRadialGradientValue& other) const return equalShape && equalSizingBehavior && equalHorizontalAndVerticalSize && m_stops == other.m_stops; } -void CSSRadialGradientValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSGradientValue::reportBaseClassMemoryUsage(memoryObjectInfo); - info.addMember(m_firstRadius, "firstRadius"); - info.addMember(m_secondRadius, "secondRadius"); - info.addMember(m_shape, "shape"); - info.addMember(m_sizingBehavior, "sizingBehavior"); - info.addMember(m_endHorizontalSize, "endHorizontalSize"); - info.addMember(m_endVerticalSize, "endVerticalSize"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSGradientValue.h b/third_party/WebKit/Source/core/css/CSSGradientValue.h index a92da75..3393132 100644 --- a/third_party/WebKit/Source/core/css/CSSGradientValue.h +++ b/third_party/WebKit/Source/core/css/CSSGradientValue.h @@ -53,7 +53,6 @@ struct CSSGradientColorStop { RefPtr<CSSPrimitiveValue> m_color; Color m_resolvedColor; bool m_colorIsDerivedFromElement; - void reportMemoryUsage(MemoryObjectInfo*) const; bool operator==(const CSSGradientColorStop& other) const { return compareCSSValuePtr(m_color, other.m_color) @@ -121,8 +120,6 @@ protected: bool isCacheable() const; - void reportBaseClassMemoryUsage(MemoryObjectInfo*) const; - // Points. Some of these may be null. RefPtr<CSSPrimitiveValue> m_firstX; RefPtr<CSSPrimitiveValue> m_firstY; @@ -160,8 +157,6 @@ public: bool equals(const CSSLinearGradientValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSLinearGradientValue(CSSGradientRepeat repeat, CSSGradientType gradientType = CSSLinearGradient) : CSSGradientValue(LinearGradientClass, repeat, gradientType) @@ -205,8 +200,6 @@ public: bool equals(const CSSRadialGradientValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSRadialGradientValue(CSSGradientRepeat repeat, CSSGradientType gradientType = CSSRadialGradient) : CSSGradientValue(RadialGradientClass, repeat, gradientType) diff --git a/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp b/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp index a9453d0..f41c186 100644 --- a/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp @@ -37,8 +37,6 @@ #include "core/css/CSSStyleSheet.h" #include "core/css/StyleRule.h" #include "core/dom/ExceptionCode.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -160,13 +158,4 @@ void CSSGroupingRule::reattach(StyleRuleBase* rule) } } -void CSSGroupingRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSRule::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_groupRule, "groupRule"); - info.addMember(m_childRuleCSSOMWrappers, "childRuleCSSOMWrappers"); - info.addMember(m_ruleListCSSOMWrapper, "ruleListCSSOMWrapper"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSGroupingRule.h b/third_party/WebKit/Source/core/css/CSSGroupingRule.h index f495c7c..afc0b5a 100644 --- a/third_party/WebKit/Source/core/css/CSSGroupingRule.h +++ b/third_party/WebKit/Source/core/css/CSSGroupingRule.h @@ -36,7 +36,6 @@ public: virtual ~CSSGroupingRule(); virtual void reattach(StyleRuleBase*) OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; CSSRuleList* cssRules() const; diff --git a/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp b/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp index a850d34..a372595 100644 --- a/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp @@ -29,19 +29,7 @@ #include "core/css/CSSCanvasValue.h" #include "core/css/CSSCrossfadeValue.h" #include "core/css/CSSGradientValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/platform/graphics/Image.h" -#include "wtf/MemoryInstrumentationHashCountedSet.h" -#include "wtf/MemoryInstrumentationHashMap.h" - - -namespace WTF { - -template<> struct SequenceMemoryInstrumentationTraits<const WebCore::RenderObject*> { - template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&) { } -}; - -} namespace WebCore { @@ -118,14 +106,6 @@ void CSSImageGeneratorValue::putImage(const IntSize& size, PassRefPtr<Image> ima m_images.add(size, image); } -void CSSImageGeneratorValue::reportBaseClassMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_sizes, "sizes"); - info.addMember(m_clients, "clients"); - info.addMember(m_images, "images"); -} - PassRefPtr<Image> CSSImageGeneratorValue::image(RenderObject* renderer, const IntSize& size) { switch (classType()) { diff --git a/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.h b/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.h index 88a2fc5..13676cd 100644 --- a/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.h +++ b/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.h @@ -74,8 +74,6 @@ protected: void putImage(const IntSize&, PassRefPtr<Image>); const RenderObjectSizeCountMap& clients() const { return m_clients; } - void reportBaseClassMemoryUsage(MemoryObjectInfo*) const; - HashCountedSet<IntSize> m_sizes; // A count of how many times a given image size is in use. RenderObjectSizeCountMap m_clients; // A map from RenderObjects (with entry count) to image sizes. HashMap<IntSize, RefPtr<Image> > m_images; // A cache of Image objects by image size. diff --git a/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp b/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp index 35318e2b..f3f035a 100644 --- a/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp @@ -30,13 +30,12 @@ #include "core/css/CSSImageValue.h" #include "core/css/CSSPrimitiveValue.h" #include "core/dom/Document.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/cache/CachedImage.h" #include "core/loader/cache/CachedResourceLoader.h" #include "core/loader/cache/CachedResourceRequest.h" #include "core/rendering/style/StyleCachedImageSet.h" #include "core/rendering/style/StylePendingImage.h" -#include "wtf/MemoryInstrumentationVector.h" +#include "wtf/text/StringBuilder.h" namespace WebCore { @@ -183,17 +182,4 @@ PassRefPtr<CSSImageSetValue> CSSImageSetValue::cloneForCSSOM() const return adoptRef(new CSSImageSetValue(*this)); } -void CSSImageSetValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSValueList::reportDescendantMemoryUsage(memoryObjectInfo); - info.addMember(m_imagesInSet, "imagesInSet"); -} - -void CSSImageSetValue::ImageWithScale::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(imageURL, "imageURL"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSImageSetValue.h b/third_party/WebKit/Source/core/css/CSSImageSetValue.h index da81ad2..45b96b9 100644 --- a/third_party/WebKit/Source/core/css/CSSImageSetValue.h +++ b/third_party/WebKit/Source/core/css/CSSImageSetValue.h @@ -55,15 +55,12 @@ public: struct ImageWithScale { String imageURL; float scaleFactor; - void reportMemoryUsage(MemoryObjectInfo*) const; }; bool hasFailedOrCanceledSubresources() const; PassRefPtr<CSSImageSetValue> cloneForCSSOM() const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - protected: ImageWithScale bestImageForScaleFactor(); diff --git a/third_party/WebKit/Source/core/css/CSSImageValue.cpp b/third_party/WebKit/Source/core/css/CSSImageValue.cpp index 542be36..00ed6f5 100644 --- a/third_party/WebKit/Source/core/css/CSSImageValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSImageValue.cpp @@ -24,7 +24,6 @@ #include "CachedResourceInitiatorTypeNames.h" #include "core/css/CSSParser.h" #include "core/dom/Document.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/cache/CachedImage.h" #include "core/loader/cache/CachedResourceLoader.h" #include "core/loader/cache/CachedResourceRequest.h" @@ -103,13 +102,6 @@ PassRefPtr<CSSValue> CSSImageValue::cloneForCSSOM() const return uriValue.release(); } -void CSSImageValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_url, "url"); - // FIXME: report m_image. It has never been allocated from any of our rendering custom heaps. -} - bool CSSImageValue::knownToBeOpaque(const RenderObject* renderer) const { return m_image ? m_image->knownToBeOpaque(renderer) : false; diff --git a/third_party/WebKit/Source/core/css/CSSImageValue.h b/third_party/WebKit/Source/core/css/CSSImageValue.h index 125f6d2..a9a995a 100644 --- a/third_party/WebKit/Source/core/css/CSSImageValue.h +++ b/third_party/WebKit/Source/core/css/CSSImageValue.h @@ -53,8 +53,6 @@ public: bool equals(const CSSImageValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - bool knownToBeOpaque(const RenderObject*) const; void setInitiator(const AtomicString& name) { m_initiatorName = name; } diff --git a/third_party/WebKit/Source/core/css/CSSImportRule.cpp b/third_party/WebKit/Source/core/css/CSSImportRule.cpp index 02ffaba..8e552f0 100644 --- a/third_party/WebKit/Source/core/css/CSSImportRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSImportRule.cpp @@ -26,7 +26,6 @@ #include "core/css/MediaList.h" #include "core/css/StyleRuleImport.h" #include "core/css/StyleSheetContents.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -76,15 +75,6 @@ String CSSImportRule::cssText() const return result.toString(); } -void CSSImportRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSRule::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_importRule, "importRule"); - info.addMember(m_mediaCSSOMWrapper, "mediaCSSOMWrapper"); - info.addMember(m_styleSheetCSSOMWrapper, "styleSheetCSSOMWrapper"); -} - CSSStyleSheet* CSSImportRule::styleSheet() const { if (!m_importRule->styleSheet()) diff --git a/third_party/WebKit/Source/core/css/CSSImportRule.h b/third_party/WebKit/Source/core/css/CSSImportRule.h index 5c8c284..d169b61 100644 --- a/third_party/WebKit/Source/core/css/CSSImportRule.h +++ b/third_party/WebKit/Source/core/css/CSSImportRule.h @@ -40,7 +40,6 @@ public: virtual CSSRule::Type type() const OVERRIDE { return IMPORT_RULE; } virtual String cssText() const OVERRIDE; virtual void reattach(StyleRuleBase*) OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; String href() const; MediaList* media() const; diff --git a/third_party/WebKit/Source/core/css/CSSInheritedValue.cpp b/third_party/WebKit/Source/core/css/CSSInheritedValue.cpp index 82e5ebb..a239629 100644 --- a/third_party/WebKit/Source/core/css/CSSInheritedValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSInheritedValue.cpp @@ -21,7 +21,6 @@ #include "config.h" #include "core/css/CSSInheritedValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/WTFString.h" namespace WebCore { @@ -31,9 +30,4 @@ String CSSInheritedValue::customCssText() const return "inherit"; } -void CSSInheritedValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSInheritedValue.h b/third_party/WebKit/Source/core/css/CSSInheritedValue.h index d4957b7..3e346bf 100644 --- a/third_party/WebKit/Source/core/css/CSSInheritedValue.h +++ b/third_party/WebKit/Source/core/css/CSSInheritedValue.h @@ -37,8 +37,6 @@ public: bool equals(const CSSInheritedValue&) const { return true; } - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSInheritedValue() : CSSValue(InheritedClass) diff --git a/third_party/WebKit/Source/core/css/CSSInitialValue.cpp b/third_party/WebKit/Source/core/css/CSSInitialValue.cpp index 2a3a328..e9ec2c7 100644 --- a/third_party/WebKit/Source/core/css/CSSInitialValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSInitialValue.cpp @@ -21,7 +21,6 @@ #include "config.h" #include "core/css/CSSInitialValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/WTFString.h" namespace WebCore { @@ -31,9 +30,4 @@ String CSSInitialValue::customCssText() const return "initial"; } -void CSSInitialValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSInitialValue.h b/third_party/WebKit/Source/core/css/CSSInitialValue.h index fb7a91f..4a0f53f 100644 --- a/third_party/WebKit/Source/core/css/CSSInitialValue.h +++ b/third_party/WebKit/Source/core/css/CSSInitialValue.h @@ -43,8 +43,6 @@ public: bool equals(const CSSInitialValue&) const { return true; } - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSInitialValue(bool implicit) : CSSValue(InitialClass) diff --git a/third_party/WebKit/Source/core/css/CSSKeyframeRule.cpp b/third_party/WebKit/Source/core/css/CSSKeyframeRule.cpp index 12f8ec3..6024c87 100644 --- a/third_party/WebKit/Source/core/css/CSSKeyframeRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSKeyframeRule.cpp @@ -95,13 +95,6 @@ String StyleKeyframe::cssText() const return result.toString(); } -void StyleKeyframe::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_properties, "properties"); - info.addMember(m_key, "key"); -} - CSSKeyframeRule::CSSKeyframeRule(StyleKeyframe* keyframe, CSSKeyframesRule* parent) : CSSRule(0) , m_keyframe(keyframe) @@ -122,14 +115,6 @@ CSSStyleDeclaration* CSSKeyframeRule::style() const return m_propertiesCSSOMWrapper.get(); } -void CSSKeyframeRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSRule::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_keyframe, "keyframe"); - info.addMember(m_propertiesCSSOMWrapper, "propertiesCSSOMWrapper"); -} - void CSSKeyframeRule::reattach(StyleRuleBase*) { // No need to reattach, the underlying data is shareable on mutation. diff --git a/third_party/WebKit/Source/core/css/CSSKeyframeRule.h b/third_party/WebKit/Source/core/css/CSSKeyframeRule.h index c6639b0..17a4482 100644 --- a/third_party/WebKit/Source/core/css/CSSKeyframeRule.h +++ b/third_party/WebKit/Source/core/css/CSSKeyframeRule.h @@ -59,8 +59,6 @@ public: String cssText() const; - void reportMemoryUsage(MemoryObjectInfo*) const; - private: StyleKeyframe(); @@ -79,7 +77,6 @@ public: virtual CSSRule::Type type() const OVERRIDE { return WEBKIT_KEYFRAME_RULE; } virtual String cssText() const OVERRIDE { return m_keyframe->cssText(); } virtual void reattach(StyleRuleBase*) OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; String keyText() const { return m_keyframe->keyText(); } void setKeyText(const String& s) { m_keyframe->setKeyText(s); } diff --git a/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp b/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp index a7cd8cc..747592e 100644 --- a/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp @@ -30,7 +30,6 @@ #include "core/css/CSSParser.h" #include "core/css/CSSRuleList.h" #include "core/css/CSSStyleSheet.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -85,13 +84,6 @@ int StyleRuleKeyframes::findKeyframeIndex(const String& key) const return -1; } -void StyleRuleKeyframes::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_keyframes, "keyframes"); - info.addMember(m_name, "name"); -} - CSSKeyframesRule::CSSKeyframesRule(StyleRuleKeyframes* keyframesRule, CSSStyleSheet* parent) : CSSRule(parent) , m_keyframesRule(keyframesRule) @@ -205,13 +197,4 @@ void CSSKeyframesRule::reattach(StyleRuleBase* rule) m_keyframesRule = static_cast<StyleRuleKeyframes*>(rule); } -void CSSKeyframesRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSRule::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_keyframesRule, "keyframesRule"); - info.addMember(m_childRuleCSSOMWrappers, "childRuleCSSOMWrappers"); - info.addMember(m_ruleListCSSOMWrapper, "ruleListCSSOMWrapper"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSKeyframesRule.h b/third_party/WebKit/Source/core/css/CSSKeyframesRule.h index 90ce7b3..cae53c6 100644 --- a/third_party/WebKit/Source/core/css/CSSKeyframesRule.h +++ b/third_party/WebKit/Source/core/css/CSSKeyframesRule.h @@ -56,8 +56,6 @@ public: PassRefPtr<StyleRuleKeyframes> copy() const { return adoptRef(new StyleRuleKeyframes(*this)); } - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: StyleRuleKeyframes(); StyleRuleKeyframes(const StyleRuleKeyframes&); @@ -75,7 +73,6 @@ public: virtual CSSRule::Type type() const OVERRIDE { return WEBKIT_KEYFRAMES_RULE; } virtual String cssText() const OVERRIDE; virtual void reattach(StyleRuleBase*) OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; String name() const { return m_keyframesRule->name(); } void setName(const String&); diff --git a/third_party/WebKit/Source/core/css/CSSLineBoxContainValue.cpp b/third_party/WebKit/Source/core/css/CSSLineBoxContainValue.cpp index 2296160..c1ae2e5 100644 --- a/third_party/WebKit/Source/core/css/CSSLineBoxContainValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSLineBoxContainValue.cpp @@ -26,7 +26,6 @@ #include "config.h" #include "core/css/CSSLineBoxContainValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/StringBuilder.h" #include "wtf/text/WTFString.h" @@ -73,9 +72,4 @@ String CSSLineBoxContainValue::customCssText() const return text.toString(); } -void CSSLineBoxContainValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); -} - } diff --git a/third_party/WebKit/Source/core/css/CSSLineBoxContainValue.h b/third_party/WebKit/Source/core/css/CSSLineBoxContainValue.h index 5b68ba5..de63049 100644 --- a/third_party/WebKit/Source/core/css/CSSLineBoxContainValue.h +++ b/third_party/WebKit/Source/core/css/CSSLineBoxContainValue.h @@ -49,8 +49,6 @@ public: bool equals(const CSSLineBoxContainValue& other) const { return m_value == other.m_value; } LineBoxContain value() const { return m_value; } - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: LineBoxContain m_value; diff --git a/third_party/WebKit/Source/core/css/CSSMediaRule.cpp b/third_party/WebKit/Source/core/css/CSSMediaRule.cpp index b8f4ebb..ad60dc7 100644 --- a/third_party/WebKit/Source/core/css/CSSMediaRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSMediaRule.cpp @@ -24,7 +24,6 @@ #include "core/css/CSSMediaRule.h" #include "core/css/StyleRule.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -75,11 +74,4 @@ void CSSMediaRule::reattach(StyleRuleBase* rule) m_mediaCSSOMWrapper->reattach(mediaQueries()); } -void CSSMediaRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSGroupingRule::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_mediaCSSOMWrapper, "mediaCSSOMWrapper"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSMediaRule.h b/third_party/WebKit/Source/core/css/CSSMediaRule.h index 34c164d..0a876e5 100644 --- a/third_party/WebKit/Source/core/css/CSSMediaRule.h +++ b/third_party/WebKit/Source/core/css/CSSMediaRule.h @@ -38,7 +38,6 @@ public: virtual CSSRule::Type type() const OVERRIDE { return MEDIA_RULE; } virtual void reattach(StyleRuleBase*) OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; virtual String cssText() const OVERRIDE; MediaList* media() const; diff --git a/third_party/WebKit/Source/core/css/CSSMixFunctionValue.cpp b/third_party/WebKit/Source/core/css/CSSMixFunctionValue.cpp index f056a06..288a7c3 100644 --- a/third_party/WebKit/Source/core/css/CSSMixFunctionValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSMixFunctionValue.cpp @@ -30,8 +30,6 @@ #include "config.h" #include "core/css/CSSMixFunctionValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" - namespace WebCore { CSSMixFunctionValue::CSSMixFunctionValue() @@ -59,11 +57,5 @@ bool CSSMixFunctionValue::equals(const CSSMixFunctionValue& other) const return CSSValueList::equals(other); } -void CSSMixFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSValueList::reportDescendantMemoryUsage(memoryObjectInfo); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSMixFunctionValue.h b/third_party/WebKit/Source/core/css/CSSMixFunctionValue.h index b3b1489..e91542d 100644 --- a/third_party/WebKit/Source/core/css/CSSMixFunctionValue.h +++ b/third_party/WebKit/Source/core/css/CSSMixFunctionValue.h @@ -48,8 +48,6 @@ public: bool equals(const CSSMixFunctionValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSMixFunctionValue(); CSSMixFunctionValue(const CSSMixFunctionValue& cloneFrom); diff --git a/third_party/WebKit/Source/core/css/CSSPageRule.cpp b/third_party/WebKit/Source/core/css/CSSPageRule.cpp index d29dddb..5d08a3c 100644 --- a/third_party/WebKit/Source/core/css/CSSPageRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSPageRule.cpp @@ -101,12 +101,4 @@ void CSSPageRule::reattach(StyleRuleBase* rule) m_propertiesCSSOMWrapper->reattach(m_pageRule->mutableProperties()); } -void CSSPageRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSRule::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_pageRule, "pageRule"); - info.addMember(m_propertiesCSSOMWrapper, "propertiesCSSOMWrapper"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSPageRule.h b/third_party/WebKit/Source/core/css/CSSPageRule.h index 4cc37b9..d6a071f 100644 --- a/third_party/WebKit/Source/core/css/CSSPageRule.h +++ b/third_party/WebKit/Source/core/css/CSSPageRule.h @@ -40,7 +40,6 @@ public: virtual CSSRule::Type type() const OVERRIDE { return PAGE_RULE; } virtual String cssText() const OVERRIDE; virtual void reattach(StyleRuleBase*) OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; CSSStyleDeclaration* style() const; diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp index 8281371..1577839 100644 --- a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp @@ -34,7 +34,6 @@ #include "core/css/StyleSheetContents.h" #include "core/dom/ExceptionCode.h" #include "core/dom/Node.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/platform/LayoutUnit.h" #include "core/platform/graphics/Color.h" #include "core/rendering/style/RenderStyle.h" @@ -1304,41 +1303,4 @@ bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const return false; } -void CSSPrimitiveValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - switch (m_primitiveUnitType) { - case CSS_ATTR: - case CSS_COUNTER_NAME: - case CSS_PARSER_IDENTIFIER: - case CSS_PARSER_HEXCOLOR: - case CSS_STRING: - case CSS_URI: - case CSS_VARIABLE_NAME: - // FIXME: detect other cases when m_value is StringImpl* - info.addMember(m_value.string, "value.string"); - break; - case CSS_COUNTER: - info.addMember(m_value.counter, "value.counter"); - break; - case CSS_RECT: - info.addMember(m_value.rect, "value.rect"); - break; - case CSS_QUAD: - info.addMember(m_value.quad, "value.quad"); - break; - case CSS_PAIR: - info.addMember(m_value.pair, "value.pair"); - break; - case CSS_SHAPE: - info.addMember(m_value.shape, "value.shape"); - break; - case CSS_CALC: - info.addMember(m_value.calc, "value.calc"); - break; - default: - break; - } -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h index 3571cb0..39d9fc6 100644 --- a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h +++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h @@ -321,8 +321,6 @@ public: bool equals(const CSSPrimitiveValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - static UnitTypes canonicalUnitTypeForCategory(UnitCategory); static double conversionToCanonicalUnitsScaleFactor(unsigned short unitType); diff --git a/third_party/WebKit/Source/core/css/CSSProperty.cpp b/third_party/WebKit/Source/core/css/CSSProperty.cpp index 8f07ff8..65ed6d3 100644 --- a/third_party/WebKit/Source/core/css/CSSProperty.cpp +++ b/third_party/WebKit/Source/core/css/CSSProperty.cpp @@ -23,7 +23,6 @@ #include "core/css/CSSValueList.h" #include "core/css/StylePropertyShorthand.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/rendering/style/RenderStyleConstants.h" namespace WebCore { @@ -676,11 +675,4 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID) return false; } -void CSSProperty::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_value, "value"); - info.ignoreMember(m_metadata); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSProperty.h b/third_party/WebKit/Source/core/css/CSSProperty.h index 7b12f9b..f805d95 100644 --- a/third_party/WebKit/Source/core/css/CSSProperty.h +++ b/third_party/WebKit/Source/core/css/CSSProperty.h @@ -80,8 +80,6 @@ public: static CSSPropertyID resolveDirectionAwareProperty(CSSPropertyID, TextDirection, WritingMode); static bool isInheritedProperty(CSSPropertyID); - void reportMemoryUsage(MemoryObjectInfo*) const; - StylePropertyMetadata metadata() const { return m_metadata; } private: diff --git a/third_party/WebKit/Source/core/css/CSSReflectValue.cpp b/third_party/WebKit/Source/core/css/CSSReflectValue.cpp index 6a8d2c9..d73bae4 100644 --- a/third_party/WebKit/Source/core/css/CSSReflectValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSReflectValue.cpp @@ -27,7 +27,6 @@ #include "core/css/CSSReflectValue.h" #include "core/css/CSSPrimitiveValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" using namespace std; @@ -60,11 +59,4 @@ bool CSSReflectValue::equals(const CSSReflectValue& other) const && compareCSSValuePtr(m_mask, other.m_mask); } -void CSSReflectValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_offset, "offset"); - info.addMember(m_mask, "mask"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSReflectValue.h b/third_party/WebKit/Source/core/css/CSSReflectValue.h index 82b5ea8..91ca5cd 100644 --- a/third_party/WebKit/Source/core/css/CSSReflectValue.h +++ b/third_party/WebKit/Source/core/css/CSSReflectValue.h @@ -53,8 +53,6 @@ public: bool equals(const CSSReflectValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSReflectValue(PassRefPtr<CSSPrimitiveValue> direction, PassRefPtr<CSSPrimitiveValue> offset, PassRefPtr<CSSValue> mask) : CSSValue(ReflectClass) diff --git a/third_party/WebKit/Source/core/css/CSSRule.cpp b/third_party/WebKit/Source/core/css/CSSRule.cpp index 9896286..d71bee1 100644 --- a/third_party/WebKit/Source/core/css/CSSRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSRule.cpp @@ -46,15 +46,6 @@ void CSSRule::setCssText(const String&) notImplemented(); } -void CSSRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - if (m_parentIsRule) - info.addMember(m_parentRule, "parentRule"); - else - info.addMember(m_parentStyleSheet, "parentStyleSheet"); -} - const CSSParserContext& CSSRule::parserContext() const { CSSStyleSheet* styleSheet = parentStyleSheet(); diff --git a/third_party/WebKit/Source/core/css/CSSRule.h b/third_party/WebKit/Source/core/css/CSSRule.h index 8ccaa71..e1a0378 100644 --- a/third_party/WebKit/Source/core/css/CSSRule.h +++ b/third_party/WebKit/Source/core/css/CSSRule.h @@ -23,8 +23,8 @@ #ifndef CSSRule_h #define CSSRule_h -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/RefCounted.h" +#include "wtf/text/WTFString.h" namespace WebCore { @@ -60,7 +60,6 @@ public: virtual Type type() const = 0; virtual String cssText() const = 0; virtual void reattach(StyleRuleBase*) = 0; - virtual void reportMemoryUsage(MemoryObjectInfo*) const; void setParentStyleSheet(CSSStyleSheet* styleSheet) { diff --git a/third_party/WebKit/Source/core/css/CSSRuleList.cpp b/third_party/WebKit/Source/core/css/CSSRuleList.cpp index 3a21a47..51accdc 100644 --- a/third_party/WebKit/Source/core/css/CSSRuleList.cpp +++ b/third_party/WebKit/Source/core/css/CSSRuleList.cpp @@ -23,7 +23,6 @@ #include "core/css/CSSRuleList.h" #include "core/css/CSSRule.h" -#include "wtf/MemoryInstrumentationVector.h" namespace WebCore { @@ -51,10 +50,4 @@ void StaticCSSRuleList::deref() delete this; } -void StaticCSSRuleList::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_rules, "rules"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSRuleList.h b/third_party/WebKit/Source/core/css/CSSRuleList.h index f63c3cd..3023a5d 100644 --- a/third_party/WebKit/Source/core/css/CSSRuleList.h +++ b/third_party/WebKit/Source/core/css/CSSRuleList.h @@ -22,7 +22,6 @@ #ifndef CSSRuleList_h #define CSSRuleList_h -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/PassRefPtr.h" #include "wtf/RefPtr.h" #include "wtf/Vector.h" @@ -45,8 +44,6 @@ public: virtual CSSStyleSheet* styleSheet() const = 0; - virtual void reportMemoryUsage(MemoryObjectInfo*) const = 0; - protected: CSSRuleList(); }; @@ -62,8 +59,6 @@ public: virtual CSSStyleSheet* styleSheet() const { return 0; } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: StaticCSSRuleList(); ~StaticCSSRuleList(); @@ -84,12 +79,6 @@ public: virtual void ref() { m_rule->ref(); } virtual void deref() { m_rule->deref(); } - virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const OVERRIDE - { - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_rule, "rule"); - } - private: virtual unsigned length() const { return m_rule->length(); } virtual CSSRule* item(unsigned index) const { return m_rule->item(index); } diff --git a/third_party/WebKit/Source/core/css/CSSSVGDocumentValue.cpp b/third_party/WebKit/Source/core/css/CSSSVGDocumentValue.cpp index 3ee53a1..09143c17 100644 --- a/third_party/WebKit/Source/core/css/CSSSVGDocumentValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSSVGDocumentValue.cpp @@ -29,7 +29,6 @@ #include "CachedResourceInitiatorTypeNames.h" #include "core/css/CSSParser.h" #include "core/dom/Document.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/cache/CachedDocument.h" #include "core/loader/cache/CachedResourceLoader.h" #include "core/loader/cache/CachedResourceRequest.h" @@ -71,11 +70,4 @@ bool CSSSVGDocumentValue::equals(const CSSSVGDocumentValue& other) const return m_url == other.m_url; } -void CSSSVGDocumentValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_url, "url"); - // FIXME: add m_document when cached resources are instrumented. -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSSVGDocumentValue.h b/third_party/WebKit/Source/core/css/CSSSVGDocumentValue.h index fdb5631..479c2ce 100644 --- a/third_party/WebKit/Source/core/css/CSSSVGDocumentValue.h +++ b/third_party/WebKit/Source/core/css/CSSSVGDocumentValue.h @@ -46,8 +46,6 @@ public: bool loadRequested() const { return m_loadRequested; } bool equals(const CSSSVGDocumentValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSSVGDocumentValue(const String& url); diff --git a/third_party/WebKit/Source/core/css/CSSSelectorList.cpp b/third_party/WebKit/Source/core/css/CSSSelectorList.cpp index 16ee91c..f5125b7 100644 --- a/third_party/WebKit/Source/core/css/CSSSelectorList.cpp +++ b/third_party/WebKit/Source/core/css/CSSSelectorList.cpp @@ -28,7 +28,6 @@ #include "core/css/CSSSelectorList.h" #include "core/css/CSSParserValues.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -118,12 +117,6 @@ String CSSSelectorList::selectorsText() const return result.toString(); } -void CSSSelectorList::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addRawBuffer(m_selectorArray, length() * sizeof(CSSSelector), "CSSSelectors", "selectorArray"); -} - template <typename Functor> static bool forEachTagSelector(Functor& functor, const CSSSelector* selector) { diff --git a/third_party/WebKit/Source/core/css/CSSSelectorList.h b/third_party/WebKit/Source/core/css/CSSSelectorList.h index 7612248..29761bd 100644 --- a/third_party/WebKit/Source/core/css/CSSSelectorList.h +++ b/third_party/WebKit/Source/core/css/CSSSelectorList.h @@ -65,8 +65,6 @@ public: String selectorsText() const; - void reportMemoryUsage(MemoryObjectInfo*) const; - private: unsigned length() const; void deleteSelectors(); diff --git a/third_party/WebKit/Source/core/css/CSSShaderValue.cpp b/third_party/WebKit/Source/core/css/CSSShaderValue.cpp index 24ac777..bea49b6 100644 --- a/third_party/WebKit/Source/core/css/CSSShaderValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSShaderValue.cpp @@ -34,11 +34,11 @@ #include "CachedResourceInitiatorTypeNames.h" #include "core/css/CSSParser.h" #include "core/dom/Document.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/cache/CachedResourceLoader.h" #include "core/loader/cache/CachedResourceRequest.h" #include "core/rendering/style/StyleCachedShader.h" #include "core/rendering/style/StylePendingShader.h" +#include "wtf/text/StringBuilder.h" namespace WebCore { @@ -100,12 +100,5 @@ bool CSSShaderValue::equals(const CSSShaderValue& other) const return m_url == other.m_url; } -void CSSShaderValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_url, "url"); - info.addMember(m_format, "format"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSShaderValue.h b/third_party/WebKit/Source/core/css/CSSShaderValue.h index 07387cf..5586447 100644 --- a/third_party/WebKit/Source/core/css/CSSShaderValue.h +++ b/third_party/WebKit/Source/core/css/CSSShaderValue.h @@ -55,8 +55,6 @@ public: bool equals(const CSSShaderValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSShaderValue(const String& url); diff --git a/third_party/WebKit/Source/core/css/CSSStyleDeclaration.h b/third_party/WebKit/Source/core/css/CSSStyleDeclaration.h index ee81abd..d29c902 100644 --- a/third_party/WebKit/Source/core/css/CSSStyleDeclaration.h +++ b/third_party/WebKit/Source/core/css/CSSStyleDeclaration.h @@ -24,6 +24,7 @@ #include "CSSPropertyNames.h" #include "bindings/v8/ScriptWrappable.h" #include "wtf/Forward.h" +#include "wtf/Noncopyable.h" namespace WebCore { @@ -69,8 +70,6 @@ public: virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const = 0; virtual CSSStyleSheet* parentStyleSheet() const { return 0; } - virtual void reportMemoryUsage(MemoryObjectInfo*) const = 0; - protected: CSSStyleDeclaration() { diff --git a/third_party/WebKit/Source/core/css/CSSStyleRule.cpp b/third_party/WebKit/Source/core/css/CSSStyleRule.cpp index b48304f..35ea690 100644 --- a/third_party/WebKit/Source/core/css/CSSStyleRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSStyleRule.cpp @@ -28,7 +28,6 @@ #include "core/css/PropertySetCSSStyleDeclaration.h" #include "core/css/StylePropertySet.h" #include "core/css/StyleRule.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -130,12 +129,4 @@ void CSSStyleRule::reattach(StyleRuleBase* rule) m_propertiesCSSOMWrapper->reattach(m_styleRule->mutableProperties()); } -void CSSStyleRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSRule::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_styleRule, "styleRule"); - info.addMember(m_propertiesCSSOMWrapper, "propertiesCSSOMWrapper"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSStyleRule.h b/third_party/WebKit/Source/core/css/CSSStyleRule.h index 7c1f14f..0108862 100644 --- a/third_party/WebKit/Source/core/css/CSSStyleRule.h +++ b/third_party/WebKit/Source/core/css/CSSStyleRule.h @@ -39,7 +39,6 @@ public: virtual CSSRule::Type type() const { return STYLE_RULE; } virtual String cssText() const OVERRIDE; virtual void reattach(StyleRuleBase*) OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; String selectorText() const; void setSelectorText(const String&); diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp index 735485f..d069043 100644 --- a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp +++ b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp @@ -33,9 +33,7 @@ #include "core/dom/Document.h" #include "core/dom/ExceptionCode.h" #include "core/dom/Node.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "weborigin/SecurityOrigin.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -53,12 +51,6 @@ private: virtual CSSStyleSheet* styleSheet() const { return m_styleSheet; } - virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const OVERRIDE - { - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_styleSheet, "styleSheet"); - } - CSSStyleSheet* m_styleSheet; }; @@ -176,19 +168,6 @@ void CSSStyleSheet::reattachChildRuleCSSOMWrappers() } } -void CSSStyleSheet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_contents, "contents"); - info.addMember(m_title, "title"); - info.addMember(m_mediaQueries, "mediaQueries"); - info.addMember(m_ownerNode, "ownerNode"); - info.addMember(m_ownerRule, "ownerRule"); - info.addMember(m_mediaCSSOMWrapper, "mediaCSSOMWrapper"); - info.addMember(m_childRuleCSSOMWrappers, "childRuleCSSOMWrappers"); - info.addMember(m_ruleListCSSOMWrapper, "ruleListCSSOMWrapper"); -} - void CSSStyleSheet::setDisabled(bool disabled) { if (disabled == m_isDisabled) diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheet.h b/third_party/WebKit/Source/core/css/CSSStyleSheet.h index 9cdac7b..e57bc0d 100644 --- a/third_party/WebKit/Source/core/css/CSSStyleSheet.h +++ b/third_party/WebKit/Source/core/css/CSSStyleSheet.h @@ -106,8 +106,6 @@ public: bool isInline() const { return m_isInlineStylesheet; } TextPosition startPositionInSource() const { return m_startPosition; } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: CSSStyleSheet(PassRefPtr<StyleSheetContents>, CSSImportRule* ownerRule); CSSStyleSheet(PassRefPtr<StyleSheetContents>, Node* ownerNode, bool isInlineStylesheet, const TextPosition& startPosition); diff --git a/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.cpp b/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.cpp index 17ad224..60717d8 100644 --- a/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.cpp @@ -26,7 +26,6 @@ #include "config.h" #include "core/css/CSSTimingFunctionValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/WTFString.h" namespace WebCore { @@ -36,11 +35,6 @@ String CSSLinearTimingFunctionValue::customCssText() const return "linear"; } -void CSSLinearTimingFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); -} - String CSSCubicBezierTimingFunctionValue::customCssText() const { return "cubic-bezier(" @@ -55,12 +49,6 @@ bool CSSCubicBezierTimingFunctionValue::equals(const CSSCubicBezierTimingFunctio return m_x1 == other.m_x1 && m_x2 == other.m_x2 && m_y1 == other.m_y1 && m_y2 == other.m_y2; } - -void CSSCubicBezierTimingFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); -} - String CSSStepsTimingFunctionValue::customCssText() const { return "steps(" + String::number(m_steps) + ", " + (m_stepAtStart ? "start" : "end") + ')'; @@ -71,10 +59,4 @@ bool CSSStepsTimingFunctionValue::equals(const CSSStepsTimingFunctionValue& othe return m_steps == other.m_steps && m_stepAtStart == other.m_stepAtStart; } - -void CSSStepsTimingFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h b/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h index 6540dc3..0fc990f 100644 --- a/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h +++ b/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h @@ -42,8 +42,6 @@ public: bool equals(const CSSLinearTimingFunctionValue&) const { return true; } - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSLinearTimingFunctionValue() : CSSValue(LinearTimingFunctionClass) @@ -67,8 +65,6 @@ public: bool equals(const CSSCubicBezierTimingFunctionValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSCubicBezierTimingFunctionValue(double x1, double y1, double x2, double y2) : CSSValue(CubicBezierTimingFunctionClass) @@ -99,8 +95,6 @@ public: bool equals(const CSSStepsTimingFunctionValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSStepsTimingFunctionValue(int steps, bool stepAtStart) : CSSValue(StepsTimingFunctionClass) diff --git a/third_party/WebKit/Source/core/css/CSSTransformValue.cpp b/third_party/WebKit/Source/core/css/CSSTransformValue.cpp index 20f291d..3be0ec6 100644 --- a/third_party/WebKit/Source/core/css/CSSTransformValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSTransformValue.cpp @@ -27,7 +27,6 @@ #include "core/css/CSSTransformValue.h" #include "core/css/CSSValueList.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/PassRefPtr.h" #include "wtf/text/WTFString.h" @@ -95,10 +94,4 @@ PassRefPtr<CSSTransformValue> CSSTransformValue::cloneForCSSOM() const return adoptRef(new CSSTransformValue(*this)); } -void CSSTransformValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSValueList::reportDescendantMemoryUsage(memoryObjectInfo); -} - } diff --git a/third_party/WebKit/Source/core/css/CSSTransformValue.h b/third_party/WebKit/Source/core/css/CSSTransformValue.h index de0637a..68c83cb 100644 --- a/third_party/WebKit/Source/core/css/CSSTransformValue.h +++ b/third_party/WebKit/Source/core/css/CSSTransformValue.h @@ -72,8 +72,6 @@ public: PassRefPtr<CSSTransformValue> cloneForCSSOM() const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSTransformValue(TransformOperationType); CSSTransformValue(const CSSTransformValue& cloneFrom); diff --git a/third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.cpp b/third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.cpp index 2be7634..ab482a5 100644 --- a/third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.cpp @@ -26,7 +26,6 @@ #include "config.h" #include "core/css/CSSUnicodeRangeValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/WTFString.h" namespace WebCore { @@ -43,9 +42,4 @@ bool CSSUnicodeRangeValue::equals(const CSSUnicodeRangeValue& other) const return m_from == other.m_from && m_to == other.m_to; } -void CSSUnicodeRangeValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); -} - } diff --git a/third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.h b/third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.h index 3fa3647..91af8ec 100644 --- a/third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.h +++ b/third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.h @@ -45,8 +45,6 @@ public: bool equals(const CSSUnicodeRangeValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: CSSUnicodeRangeValue(UChar32 from, UChar32 to) : CSSValue(UnicodeRangeClass) diff --git a/third_party/WebKit/Source/core/css/CSSUnknownRule.h b/third_party/WebKit/Source/core/css/CSSUnknownRule.h index 06bb582..629aaea 100644 --- a/third_party/WebKit/Source/core/css/CSSUnknownRule.h +++ b/third_party/WebKit/Source/core/css/CSSUnknownRule.h @@ -23,7 +23,6 @@ #define CSSUnknownRule_h #include "core/css/CSSRule.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" namespace WebCore { @@ -35,11 +34,6 @@ public: virtual CSSRule::Type type() const OVERRIDE { return UNKNOWN_RULE; } virtual String cssText() const OVERRIDE { return String(); } virtual void reattach(StyleRuleBase*) OVERRIDE { } - virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const OVERRIDE - { - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSRule::reportMemoryUsage(memoryObjectInfo); - } }; } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSValue.cpp b/third_party/WebKit/Source/core/css/CSSValue.cpp index ed5befa..c9435ab 100644 --- a/third_party/WebKit/Source/core/css/CSSValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSValue.cpp @@ -56,7 +56,6 @@ #include "core/css/FontFeatureValue.h" #include "core/css/FontValue.h" #include "core/css/ShadowValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/svg/SVGColor.h" #include "core/svg/SVGPaint.h" @@ -74,12 +73,6 @@ public: String cssText() const { return m_cssText; } - void reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_cssText, "cssText"); - } - private: TextCloneCSSValue(ClassType classType, const String& text) : CSSValue(classType, /*isCSSOMSafe*/ true) @@ -143,122 +136,6 @@ bool CSSValue::hasFailedOrCanceledSubresources() const return false; } -void CSSValue::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - if (m_isTextClone) { - ASSERT(isCSSOMSafe()); - static_cast<const TextCloneCSSValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - } - - ASSERT(!isCSSOMSafe() || isSubtypeExposedToCSSOM()); - switch (classType()) { - case PrimitiveClass: - toCSSPrimitiveValue(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case ImageClass: - toCSSImageValue(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case CursorImageClass: - static_cast<const CSSCursorImageValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case CanvasClass: - static_cast<const CSSCanvasValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case CrossfadeClass: - static_cast<const CSSCrossfadeValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case LinearGradientClass: - static_cast<const CSSLinearGradientValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case RadialGradientClass: - static_cast<const CSSRadialGradientValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case CubicBezierTimingFunctionClass: - static_cast<const CSSCubicBezierTimingFunctionValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case LinearTimingFunctionClass: - static_cast<const CSSLinearTimingFunctionValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case StepsTimingFunctionClass: - static_cast<const CSSStepsTimingFunctionValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case AspectRatioClass: - static_cast<const CSSAspectRatioValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case BorderImageSliceClass: - static_cast<const CSSBorderImageSliceValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case FontFeatureClass: - static_cast<const FontFeatureValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case FontClass: - static_cast<const FontValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case FontFaceSrcClass: - static_cast<const CSSFontFaceSrcValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case FunctionClass: - static_cast<const CSSFunctionValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case InheritedClass: - static_cast<const CSSInheritedValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case InitialClass: - static_cast<const CSSInitialValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case ReflectClass: - static_cast<const CSSReflectValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case ShadowClass: - static_cast<const ShadowValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case UnicodeRangeClass: - static_cast<const CSSUnicodeRangeValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case LineBoxContainClass: - static_cast<const CSSLineBoxContainValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case CalculationClass: - static_cast<const CSSCalcValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case CSSArrayFunctionValueClass: - static_cast<const CSSArrayFunctionValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case CSSMixFunctionValueClass: - static_cast<const CSSMixFunctionValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case CSSShaderClass: - static_cast<const CSSShaderValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case VariableClass: - static_cast<const CSSVariableValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case SVGColorClass: - static_cast<const SVGColor*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case SVGPaintClass: - static_cast<const SVGPaint*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case CSSSVGDocumentClass: - static_cast<const CSSSVGDocumentValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case ValueListClass: - toCSSValueList(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case ImageSetClass: - static_cast<const CSSImageSetValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case CSSFilterClass: - static_cast<const CSSFilterValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case CSSTransformClass: - static_cast<const CSSTransformValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - } - ASSERT_NOT_REACHED(); -} - template<class ChildClassType> inline static bool compareCSSValues(const CSSValue& first, const CSSValue& second) { diff --git a/third_party/WebKit/Source/core/css/CSSValue.h b/third_party/WebKit/Source/core/css/CSSValue.h index 9fe4b609..2becdcf 100644 --- a/third_party/WebKit/Source/core/css/CSSValue.h +++ b/third_party/WebKit/Source/core/css/CSSValue.h @@ -109,8 +109,6 @@ public: bool hasFailedOrCanceledSubresources() const; - void reportMemoryUsage(MemoryObjectInfo*) const; - bool equals(const CSSValue&) const; protected: diff --git a/third_party/WebKit/Source/core/css/CSSValueList.cpp b/third_party/WebKit/Source/core/css/CSSValueList.cpp index 960ef32..26ab9c0 100644 --- a/third_party/WebKit/Source/core/css/CSSValueList.cpp +++ b/third_party/WebKit/Source/core/css/CSSValueList.cpp @@ -22,8 +22,6 @@ #include "core/css/CSSValueList.h" #include "core/css/CSSParserValues.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -199,10 +197,4 @@ PassRefPtr<CSSValueList> CSSValueList::cloneForCSSOM() const return adoptRef(new CSSValueList(*this)); } -void CSSValueList::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_values, "values"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSValueList.h b/third_party/WebKit/Source/core/css/CSSValueList.h index c6cd508..e375ceb 100644 --- a/third_party/WebKit/Source/core/css/CSSValueList.h +++ b/third_party/WebKit/Source/core/css/CSSValueList.h @@ -70,8 +70,6 @@ public: PassRefPtr<CSSValueList> cloneForCSSOM() const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - protected: CSSValueList(ClassType, ValueListSeparator); CSSValueList(const CSSValueList& cloneFrom); diff --git a/third_party/WebKit/Source/core/css/CSSVariableValue.h b/third_party/WebKit/Source/core/css/CSSVariableValue.h index e6841d0..8070222 100644 --- a/third_party/WebKit/Source/core/css/CSSVariableValue.h +++ b/third_party/WebKit/Source/core/css/CSSVariableValue.h @@ -32,7 +32,6 @@ #include "CSSPropertyNames.h" #include "core/css/CSSParserValues.h" #include "core/css/CSSValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" namespace WebCore { @@ -48,13 +47,6 @@ public: bool equals(const CSSVariableValue& other) const { return m_name == other.m_name && m_value == other.m_value; } - void reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_name, "name"); - info.addMember(m_value, "value"); - } - private: CSSVariableValue(const AtomicString& name, const String& value) : CSSValue(VariableClass) diff --git a/third_party/WebKit/Source/core/css/CSSViewportRule.cpp b/third_party/WebKit/Source/core/css/CSSViewportRule.cpp index 5510cff1..6f67338 100644 --- a/third_party/WebKit/Source/core/css/CSSViewportRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSViewportRule.cpp @@ -34,7 +34,6 @@ #include "core/css/PropertySetCSSStyleDeclaration.h" #include "core/css/StylePropertySet.h" #include "core/css/StyleRule.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -84,12 +83,4 @@ void CSSViewportRule::reattach(StyleRuleBase* rule) m_propertiesCSSOMWrapper->reattach(m_viewportRule->mutableProperties()); } -void CSSViewportRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSRule::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_viewportRule, "viewportRule"); - info.addMember(m_propertiesCSSOMWrapper, "propertiesCSSOMWrapper"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/CSSViewportRule.h b/third_party/WebKit/Source/core/css/CSSViewportRule.h index 71e8f8c..3cdd4dc 100644 --- a/third_party/WebKit/Source/core/css/CSSViewportRule.h +++ b/third_party/WebKit/Source/core/css/CSSViewportRule.h @@ -50,7 +50,6 @@ public: virtual CSSRule::Type type() const OVERRIDE { return VIEWPORT_RULE; } virtual String cssText() const OVERRIDE; virtual void reattach(StyleRuleBase*) OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; CSSStyleDeclaration* style() const; diff --git a/third_party/WebKit/Source/core/css/DocumentRuleSets.cpp b/third_party/WebKit/Source/core/css/DocumentRuleSets.cpp index 4e72f571..46405b2 100644 --- a/third_party/WebKit/Source/core/css/DocumentRuleSets.cpp +++ b/third_party/WebKit/Source/core/css/DocumentRuleSets.cpp @@ -34,8 +34,6 @@ #include "core/css/StyleSheetContents.h" #include "core/css/resolver/StyleResolver.h" #include "core/dom/DocumentStyleSheetCollection.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" -#include "wtf/MemoryInstrumentationHashMap.h" namespace WebCore { @@ -61,12 +59,6 @@ void ShadowDistributedRules::reset(const ContainerNode* scopingNode) m_shadowDistributedRuleSetMap.remove(scopingNode); } -void ShadowDistributedRules::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_shadowDistributedRuleSetMap, "shadowDistributedRuleSetMap"); -} - void ShadowDistributedRules::collectFeaturesTo(RuleFeatureSet& features) { for (ShadowDistributedRuleSetMap::iterator it = m_shadowDistributedRuleSetMap.begin(); it != m_shadowDistributedRuleSetMap.end(); ++it) @@ -122,11 +114,4 @@ void DocumentRuleSets::collectFeaturesTo(RuleFeatureSet& features, bool isViewSo m_shadowDistributedRules.collectFeaturesTo(features); } -void DocumentRuleSets::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_userStyle, "userStyle"); - info.addMember(m_shadowDistributedRules, "shadowDistributedRules"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/DocumentRuleSets.h b/third_party/WebKit/Source/core/css/DocumentRuleSets.h index c4a8eaa..97c546b 100644 --- a/third_party/WebKit/Source/core/css/DocumentRuleSets.h +++ b/third_party/WebKit/Source/core/css/DocumentRuleSets.h @@ -47,7 +47,6 @@ public: void clear() { m_shadowDistributedRuleSetMap.clear(); } void reset(const ContainerNode* scopingNode); bool isEmpty() const { return m_shadowDistributedRuleSetMap.isEmpty(); } - void reportMemoryUsage(MemoryObjectInfo*) const; void collectFeaturesTo(RuleFeatureSet&); private: @@ -65,7 +64,6 @@ public: void resetAuthorStyle(); void collectFeaturesTo(RuleFeatureSet&, bool isViewSource); - void reportMemoryUsage(MemoryObjectInfo*) const; ShadowDistributedRules& shadowDistributedRules() { return m_shadowDistributedRules; } private: diff --git a/third_party/WebKit/Source/core/css/FontFeatureValue.cpp b/third_party/WebKit/Source/core/css/FontFeatureValue.cpp index fad8a38..37c93da 100644 --- a/third_party/WebKit/Source/core/css/FontFeatureValue.cpp +++ b/third_party/WebKit/Source/core/css/FontFeatureValue.cpp @@ -26,7 +26,6 @@ #include "config.h" #include "core/css/FontFeatureValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -53,10 +52,4 @@ bool FontFeatureValue::equals(const FontFeatureValue& other) const return m_tag == other.m_tag && m_value == other.m_value; } -void FontFeatureValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_tag, "tag"); -} - } diff --git a/third_party/WebKit/Source/core/css/FontFeatureValue.h b/third_party/WebKit/Source/core/css/FontFeatureValue.h index 4e44ffc..4aa3345 100644 --- a/third_party/WebKit/Source/core/css/FontFeatureValue.h +++ b/third_party/WebKit/Source/core/css/FontFeatureValue.h @@ -44,8 +44,6 @@ public: bool equals(const FontFeatureValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: FontFeatureValue(const String&, int); diff --git a/third_party/WebKit/Source/core/css/FontValue.cpp b/third_party/WebKit/Source/core/css/FontValue.cpp index 507c887..5537183 100644 --- a/third_party/WebKit/Source/core/css/FontValue.cpp +++ b/third_party/WebKit/Source/core/css/FontValue.cpp @@ -22,7 +22,6 @@ #include "core/css/CSSPrimitiveValue.h" #include "core/css/CSSValueList.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -75,15 +74,4 @@ bool FontValue::equals(const FontValue& other) const && compareCSSValuePtr(family, other.family); } -void FontValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(style, "style"); - info.addMember(variant, "variant"); - info.addMember(weight, "weight"); - info.addMember(size, "size"); - info.addMember(lineHeight, "lineHeight"); - info.addMember(family, "family"); -} - } diff --git a/third_party/WebKit/Source/core/css/FontValue.h b/third_party/WebKit/Source/core/css/FontValue.h index bc222ee..df8f9a7 100644 --- a/third_party/WebKit/Source/core/css/FontValue.h +++ b/third_party/WebKit/Source/core/css/FontValue.h @@ -41,8 +41,6 @@ public: bool equals(const FontValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - RefPtr<CSSPrimitiveValue> style; RefPtr<CSSPrimitiveValue> variant; RefPtr<CSSPrimitiveValue> weight; diff --git a/third_party/WebKit/Source/core/css/InspectorCSSOMWrappers.cpp b/third_party/WebKit/Source/core/css/InspectorCSSOMWrappers.cpp index fb1d485..e13c30e 100644 --- a/third_party/WebKit/Source/core/css/InspectorCSSOMWrappers.cpp +++ b/third_party/WebKit/Source/core/css/InspectorCSSOMWrappers.cpp @@ -41,9 +41,6 @@ #include "core/css/StyleSheetContents.h" #include "core/dom/DocumentStyleSheetCollection.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationHashSet.h" - namespace WebCore { void InspectorCSSOMWrappers::collectFromStyleSheetIfNeeded(CSSStyleSheet* styleSheet) @@ -130,11 +127,4 @@ CSSStyleRule* InspectorCSSOMWrappers::getWrapperForRuleInSheets(StyleRule* rule, return m_styleRuleToCSSOMWrapperMap.get(rule); } -void InspectorCSSOMWrappers::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_styleRuleToCSSOMWrapperMap); - info.addMember(m_styleSheetCSSOMWrapperSet); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/InspectorCSSOMWrappers.h b/third_party/WebKit/Source/core/css/InspectorCSSOMWrappers.h index aca07f7..0806598 100644 --- a/third_party/WebKit/Source/core/css/InspectorCSSOMWrappers.h +++ b/third_party/WebKit/Source/core/css/InspectorCSSOMWrappers.h @@ -44,8 +44,6 @@ public: void collectFromStyleSheetIfNeeded(CSSStyleSheet*); void reset(); - void reportMemoryUsage(MemoryObjectInfo*) const; - private: template <class ListType> void collect(ListType*); diff --git a/third_party/WebKit/Source/core/css/MediaList.cpp b/third_party/WebKit/Source/core/css/MediaList.cpp index aba8d66..e512cc3 100644 --- a/third_party/WebKit/Source/core/css/MediaList.cpp +++ b/third_party/WebKit/Source/core/css/MediaList.cpp @@ -27,9 +27,7 @@ #include "core/css/MediaQueryExp.h" #include "core/dom/Document.h" #include "core/dom/ExceptionCode.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/page/DOMWindow.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -161,12 +159,6 @@ String MediaQuerySet::mediaText() const return text.toString(); } -void MediaQuerySet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_queries, "queries"); -} - MediaList::MediaList(MediaQuerySet* mediaQueries, CSSStyleSheet* parentSheet) : m_mediaQueries(mediaQueries) , m_parentStyleSheet(parentSheet) @@ -236,14 +228,6 @@ void MediaList::reattach(MediaQuerySet* mediaQueries) m_mediaQueries = mediaQueries; } -void MediaList::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_mediaQueries, "mediaQueries"); - info.addMember(m_parentStyleSheet, "parentStyleSheet"); - info.addMember(m_parentRule, "parentRule"); -} - static void addResolutionWarningMessageToConsole(Document* document, const String& serializedExpression, const CSSPrimitiveValue* value) { ASSERT(document); diff --git a/third_party/WebKit/Source/core/css/MediaList.h b/third_party/WebKit/Source/core/css/MediaList.h index 2702137..7bf87c2 100644 --- a/third_party/WebKit/Source/core/css/MediaList.h +++ b/third_party/WebKit/Source/core/css/MediaList.h @@ -57,8 +57,6 @@ public: PassRefPtr<MediaQuerySet> copy() const { return adoptRef(new MediaQuerySet(*this)); } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: MediaQuerySet(); MediaQuerySet(const MediaQuerySet&); @@ -96,8 +94,6 @@ public: void reattach(MediaQuerySet*); - void reportMemoryUsage(MemoryObjectInfo*) const; - private: MediaList(); MediaList(MediaQuerySet*, CSSStyleSheet* parentSheet); diff --git a/third_party/WebKit/Source/core/css/MediaQuery.cpp b/third_party/WebKit/Source/core/css/MediaQuery.cpp index d67ed4c..2cb9d83 100644 --- a/third_party/WebKit/Source/core/css/MediaQuery.cpp +++ b/third_party/WebKit/Source/core/css/MediaQuery.cpp @@ -30,8 +30,6 @@ #include "core/css/MediaQuery.h" #include "core/css/MediaQueryExp.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/NonCopyingSort.h" #include "wtf/text/StringBuilder.h" @@ -128,12 +126,4 @@ String MediaQuery::cssText() const return m_serializationCache; } -void MediaQuery::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_mediaType, "mediaType"); - info.addMember(m_expressions, "expressions"); - info.addMember(m_serializationCache, "serializationCache"); -} - } diff --git a/third_party/WebKit/Source/core/css/MediaQuery.h b/third_party/WebKit/Source/core/css/MediaQuery.h index 2ff8184..85c784a 100644 --- a/third_party/WebKit/Source/core/css/MediaQuery.h +++ b/third_party/WebKit/Source/core/css/MediaQuery.h @@ -57,8 +57,6 @@ public: PassOwnPtr<MediaQuery> copy() const { return adoptPtr(new MediaQuery(*this)); } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: MediaQuery(const MediaQuery&); diff --git a/third_party/WebKit/Source/core/css/MediaQueryExp.cpp b/third_party/WebKit/Source/core/css/MediaQueryExp.cpp index 03a29f7..d2ccd17 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryExp.cpp +++ b/third_party/WebKit/Source/core/css/MediaQueryExp.cpp @@ -34,7 +34,6 @@ #include "core/css/CSSAspectRatioValue.h" #include "core/css/CSSParser.h" #include "core/css/CSSPrimitiveValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/StringBuilder.h" namespace WebCore { @@ -290,11 +289,4 @@ String MediaQueryExp::serialize() const return result.toString(); } -void MediaQueryExp::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_mediaFeature, "mediaFeature"); - info.addMember(m_value, "value"); -} - } // namespace diff --git a/third_party/WebKit/Source/core/css/MediaQueryExp.h b/third_party/WebKit/Source/core/css/MediaQueryExp.h index 9166e65..0586b0a 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryExp.h +++ b/third_party/WebKit/Source/core/css/MediaQueryExp.h @@ -61,8 +61,6 @@ public: PassOwnPtr<MediaQueryExp> copy() const { return adoptPtr(new MediaQueryExp(*this)); } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: MediaQueryExp(const AtomicString& mediaFeature, PassRefPtr<CSSValue>); diff --git a/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp b/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp index d54fab4..a78d436 100644 --- a/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp +++ b/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp @@ -29,9 +29,7 @@ #include "core/dom/Element.h" #include "core/dom/MutationObserverInterestGroup.h" #include "core/dom/MutationRecord.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/inspector/InspectorInstrumentation.h" -#include "wtf/MemoryInstrumentationHashMap.h" using namespace std; @@ -132,13 +130,6 @@ void PropertySetCSSStyleDeclaration::deref() m_propertySet->deref(); } -void PropertySetCSSStyleDeclaration::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_propertySet, "propertySet"); - info.addMember(m_cssomCSSValueClones, "cssomCSSValueClones"); -} - unsigned PropertySetCSSStyleDeclaration::length() const { return m_propertySet->propertyCount(); @@ -366,20 +357,6 @@ void StyleRuleCSSStyleDeclaration::reattach(MutableStylePropertySet* propertySet m_propertySet->ref(); } -void StyleRuleCSSStyleDeclaration::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - PropertySetCSSStyleDeclaration::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_parentRule, "parentRule"); -} - -void InlineCSSStyleDeclaration::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - PropertySetCSSStyleDeclaration::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_parentElement, "parentElement"); -} - void InlineCSSStyleDeclaration::didMutate(MutationType type) { if (type == NoChanges) diff --git a/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.h b/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.h index 9803653..1341c13 100644 --- a/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.h +++ b/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.h @@ -28,6 +28,7 @@ #include "core/css/CSSStyleDeclaration.h" #include "wtf/HashMap.h" +#include "wtf/OwnPtr.h" namespace WebCore { @@ -49,8 +50,6 @@ public: virtual void ref() OVERRIDE; virtual void deref() OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: virtual CSSRule* parentRule() const OVERRIDE { return 0; }; virtual unsigned length() const OVERRIDE; @@ -97,8 +96,6 @@ public: void reattach(MutableStylePropertySet*); - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: StyleRuleCSSStyleDeclaration(MutableStylePropertySet*, CSSRule*); virtual ~StyleRuleCSSStyleDeclaration(); @@ -123,8 +120,6 @@ public: { } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: virtual CSSStyleSheet* parentStyleSheet() const OVERRIDE; virtual Element* parentElement() const OVERRIDE { return m_parentElement; } diff --git a/third_party/WebKit/Source/core/css/RuleFeature.cpp b/third_party/WebKit/Source/core/css/RuleFeature.cpp index 29d233d..c47e143 100644 --- a/third_party/WebKit/Source/core/css/RuleFeature.cpp +++ b/third_party/WebKit/Source/core/css/RuleFeature.cpp @@ -30,9 +30,6 @@ #include "core/css/RuleFeature.h" #include "core/css/CSSSelector.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" -#include "wtf/MemoryInstrumentationHashSet.h" -#include "wtf/MemoryInstrumentationVector.h" namespace WebCore { @@ -85,14 +82,4 @@ void RuleFeatureSet::clear() usesBeforeAfterRules = false; } -void RuleFeatureSet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(idsInRules, "idsInRules"); - info.addMember(classesInRules, "classesInRules"); - info.addMember(attrsInRules, "attrsInRules"); - info.addMember(siblingRules, "siblingRules"); - info.addMember(uncommonAttributeRules, "uncommonAttributeRules"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/RuleFeature.h b/third_party/WebKit/Source/core/css/RuleFeature.h index 1fd7a7c..57fe288 100644 --- a/third_party/WebKit/Source/core/css/RuleFeature.h +++ b/third_party/WebKit/Source/core/css/RuleFeature.h @@ -54,8 +54,6 @@ struct RuleFeatureSet { void collectFeaturesFromSelector(const CSSSelector*); - void reportMemoryUsage(MemoryObjectInfo*) const; - HashSet<AtomicStringImpl*> idsInRules; HashSet<AtomicStringImpl*> classesInRules; HashSet<AtomicStringImpl*> attrsInRules; diff --git a/third_party/WebKit/Source/core/css/RuleSet.cpp b/third_party/WebKit/Source/core/css/RuleSet.cpp index a871822..85b4302 100644 --- a/third_party/WebKit/Source/core/css/RuleSet.cpp +++ b/third_party/WebKit/Source/core/css/RuleSet.cpp @@ -43,11 +43,8 @@ #include "core/css/StyleRuleImport.h" #include "core/css/StyleSheetContents.h" #include "core/css/resolver/StyleResolver.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/html/track/TextTrackCue.h" #include "weborigin/SecurityOrigin.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationVector.h" namespace WebCore { @@ -223,36 +220,6 @@ RuleData::RuleData(StyleRule* rule, unsigned selectorIndex, unsigned position, A ASSERT(m_selectorIndex == selectorIndex); } -void RuleData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_rule, "rule"); -} - -void RuleSet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_idRules, "idRules"); - info.addMember(m_classRules, "classRules"); - info.addMember(m_tagRules, "tagRules"); - info.addMember(m_shadowPseudoElementRules, "shadowPseudoElementRules"); - info.addMember(m_linkPseudoClassRules, "linkPseudoClassRules"); - info.addMember(m_cuePseudoRules, "cuePseudoRules"); - info.addMember(m_focusPseudoClassRules, "focusPseudoClassRules"); - info.addMember(m_universalRules, "universalRules"); - info.addMember(m_pageRules, "pageRules"); - info.addMember(m_viewportRules, "viewportRules"); - info.addMember(m_regionSelectorsAndRuleSets, "regionSelectorsAndRuleSets"); - info.addMember(m_features, "features"); -} - -void RuleSet::RuleSetSelectorPair::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(ruleSet, "ruleSet"); - info.addMember(selector, "selector"); -} - static void collectFeaturesFromRuleData(RuleFeatureSet& features, const RuleData& ruleData) { bool foundSiblingSelector = false; diff --git a/third_party/WebKit/Source/core/css/RuleSet.h b/third_party/WebKit/Source/core/css/RuleSet.h index 1fe6455..75bc421 100644 --- a/third_party/WebKit/Source/core/css/RuleSet.h +++ b/third_party/WebKit/Source/core/css/RuleSet.h @@ -72,8 +72,6 @@ public: bool hasDocumentSecurityOrigin() const { return m_hasDocumentSecurityOrigin; } PropertyWhitelistType propertyWhitelistType(bool isMatchingUARules = false) const { return isMatchingUARules ? PropertyWhitelistNone : static_cast<PropertyWhitelistType>(m_propertyWhitelistType); } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: StyleRule* m_rule; unsigned m_selectorIndex : 12; @@ -130,12 +128,9 @@ public: compactRules(); } - void reportMemoryUsage(MemoryObjectInfo*) const; - struct RuleSetSelectorPair { RuleSetSelectorPair(const CSSSelector* selector, PassOwnPtr<RuleSet> ruleSet) : selector(selector), ruleSet(ruleSet) { } RuleSetSelectorPair(const RuleSetSelectorPair& rs) : selector(rs.selector), ruleSet(const_cast<RuleSetSelectorPair*>(&rs)->ruleSet.release()) { } - void reportMemoryUsage(MemoryObjectInfo*) const; const CSSSelector* selector; OwnPtr<RuleSet> ruleSet; diff --git a/third_party/WebKit/Source/core/css/ShadowValue.cpp b/third_party/WebKit/Source/core/css/ShadowValue.cpp index bf51a89..1ee8b1d 100644 --- a/third_party/WebKit/Source/core/css/ShadowValue.cpp +++ b/third_party/WebKit/Source/core/css/ShadowValue.cpp @@ -21,7 +21,6 @@ #include "core/css/ShadowValue.h" #include "core/css/CSSPrimitiveValue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/StringBuilder.h" #include "wtf/text/WTFString.h" @@ -89,15 +88,4 @@ bool ShadowValue::equals(const ShadowValue& other) const && compareCSSValuePtr(style, other.style); } -void ShadowValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(x, "x"); - info.addMember(y, "y"); - info.addMember(blur, "blur"); - info.addMember(spread, "spread"); - info.addMember(style, "style"); - info.addMember(color, "color"); -} - } diff --git a/third_party/WebKit/Source/core/css/ShadowValue.h b/third_party/WebKit/Source/core/css/ShadowValue.h index 5645881..6e0192e 100644 --- a/third_party/WebKit/Source/core/css/ShadowValue.h +++ b/third_party/WebKit/Source/core/css/ShadowValue.h @@ -46,8 +46,6 @@ public: bool equals(const ShadowValue&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - RefPtr<CSSPrimitiveValue> x; RefPtr<CSSPrimitiveValue> y; RefPtr<CSSPrimitiveValue> blur; diff --git a/third_party/WebKit/Source/core/css/StylePropertySet.cpp b/third_party/WebKit/Source/core/css/StylePropertySet.cpp index 491dee8..9a06b9f 100644 --- a/third_party/WebKit/Source/core/css/StylePropertySet.cpp +++ b/third_party/WebKit/Source/core/css/StylePropertySet.cpp @@ -30,7 +30,6 @@ #include "core/css/StylePropertyShorthand.h" #include "core/css/StyleSheetContents.h" #include "core/page/RuntimeCSSEnabled.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/text/StringBuilder.h" #ifndef NDEBUG @@ -539,18 +538,6 @@ unsigned StylePropertySet::averageSizeInBytes() return sizeForImmutableStylePropertySetWithPropertyCount(4); } -void StylePropertySet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - size_t actualSize = m_isMutable ? sizeof(StylePropertySet) : sizeForImmutableStylePropertySetWithPropertyCount(m_arraySize); - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS, actualSize); - if (m_isMutable) - info.addMember(static_cast<const MutableStylePropertySet*>(this)->m_propertyVector, "m_propertyVector"); - else { - for (unsigned i = 0; i < propertyCount(); ++i) - info.addMember(propertyAt(i).value(), "value"); - } -} - // See the function above if you need to update this. struct SameSizeAsStylePropertySet : public RefCounted<SameSizeAsStylePropertySet> { unsigned bitfield; diff --git a/third_party/WebKit/Source/core/css/StylePropertySet.h b/third_party/WebKit/Source/core/css/StylePropertySet.h index 3f0e3f8..e8d76a7 100644 --- a/third_party/WebKit/Source/core/css/StylePropertySet.h +++ b/third_party/WebKit/Source/core/css/StylePropertySet.h @@ -111,7 +111,6 @@ public: bool hasFailedOrCanceledSubresources() const; static unsigned averageSizeInBytes(); - void reportMemoryUsage(MemoryObjectInfo*) const; #ifndef NDEBUG void showStyle(); diff --git a/third_party/WebKit/Source/core/css/StyleRule.cpp b/third_party/WebKit/Source/core/css/StyleRule.cpp index 3b16271..82ac896 100644 --- a/third_party/WebKit/Source/core/css/StyleRule.cpp +++ b/third_party/WebKit/Source/core/css/StyleRule.cpp @@ -36,7 +36,6 @@ #include "core/css/CSSViewportRule.h" #include "core/css/StylePropertySet.h" #include "core/css/StyleRuleImport.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" namespace WebCore { @@ -56,49 +55,6 @@ PassRefPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSRule* parentRule) const return createCSSOMWrapper(0, parentRule); } -void StyleRuleBase::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - switch (type()) { - case Style: - static_cast<const StyleRule*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case Page: - static_cast<const StyleRulePage*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case FontFace: - static_cast<const StyleRuleFontFace*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case Media: - static_cast<const StyleRuleMedia*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case Region: - static_cast<const StyleRuleRegion*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case Import: - static_cast<const StyleRuleImport*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case Keyframes: - static_cast<const StyleRuleKeyframes*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case Supports: - case HostInternal: - static_cast<const StyleRuleHost*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case Viewport: - static_cast<const StyleRuleViewport*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case Filter: - static_cast<const StyleRuleFilter*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); - return; - case Unknown: - case Charset: - case Keyframe: - ASSERT_NOT_REACHED(); - return; - } - ASSERT_NOT_REACHED(); -} - void StyleRuleBase::destroy() { switch (type()) { @@ -235,13 +191,6 @@ unsigned StyleRule::averageSizeInBytes() return sizeof(StyleRule) + sizeof(CSSSelector) + StylePropertySet::averageSizeInBytes(); } -void StyleRule::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_properties, "properties"); - info.addMember(m_selectorList, "selectorList"); -} - StyleRule::StyleRule(int sourceLine) : StyleRuleBase(Style, sourceLine) { @@ -298,13 +247,6 @@ void StyleRulePage::setProperties(PassRefPtr<StylePropertySet> properties) m_properties = properties; } -void StyleRulePage::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_properties, "properties"); - info.addMember(m_selectorList, "selectorList"); -} - StyleRuleFontFace::StyleRuleFontFace() : StyleRuleBase(FontFace, 0) { @@ -332,13 +274,6 @@ void StyleRuleFontFace::setProperties(PassRefPtr<StylePropertySet> properties) m_properties = properties; } -void StyleRuleFontFace::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_properties, "properties"); -} - - StyleRuleGroup::StyleRuleGroup(Type type, Vector<RefPtr<StyleRuleBase> >& adoptRule) : StyleRuleBase(type, 0) { @@ -363,12 +298,6 @@ void StyleRuleGroup::wrapperRemoveRule(unsigned index) m_childRules.remove(index); } -void StyleRuleGroup::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_childRules, "childRules"); -} - StyleRuleMedia::StyleRuleMedia(PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRuleGroup(Media, adoptRules) , m_mediaQueries(media) @@ -382,13 +311,6 @@ StyleRuleMedia::StyleRuleMedia(const StyleRuleMedia& o) m_mediaQueries = o.m_mediaQueries->copy(); } -void StyleRuleMedia::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_mediaQueries, "mediaQueries"); -} - - StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRuleGroup(Supports, adoptRules) , m_conditionText(conditionText) @@ -417,12 +339,6 @@ StyleRuleRegion::StyleRuleRegion(const StyleRuleRegion& o) ASSERT(RuntimeEnabledFeatures::cssRegionsEnabled()); } -void StyleRuleRegion::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_selectorList, "selectorList"); -} - StyleRuleViewport::StyleRuleViewport() : StyleRuleBase(Viewport, 0) { @@ -452,12 +368,6 @@ void StyleRuleViewport::setProperties(PassRefPtr<StylePropertySet> properties) m_properties = properties; } -void StyleRuleViewport::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_properties, "properties"); -} - StyleRuleFilter::StyleRuleFilter(const String& filterName) : StyleRuleBase(Filter, 0) , m_filterName(filterName) @@ -487,11 +397,4 @@ void StyleRuleFilter::setProperties(PassRefPtr<StylePropertySet> properties) m_properties = properties; } -void StyleRuleFilter::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_filterName); - info.addMember(m_properties); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/StyleRule.h b/third_party/WebKit/Source/core/css/StyleRule.h index a4ac186..2bffe36 100644 --- a/third_party/WebKit/Source/core/css/StyleRule.h +++ b/third_party/WebKit/Source/core/css/StyleRule.h @@ -83,8 +83,6 @@ public: PassRefPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet = 0) const; PassRefPtr<CSSRule> createCSSOMWrapper(CSSRule* parentRule) const; - void reportMemoryUsage(MemoryObjectInfo*) const; - protected: StyleRuleBase(Type type, signed sourceLine = 0) : m_type(type), m_sourceLine(sourceLine) { } StyleRuleBase(const StyleRuleBase& o) : WTF::RefCountedBase(), m_type(o.m_type), m_sourceLine(o.m_sourceLine) { } @@ -118,7 +116,6 @@ public: PassRefPtr<StyleRule> copy() const { return adoptRef(new StyleRule(*this)); } static unsigned averageSizeInBytes(); - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; private: StyleRule(int sourceLine); @@ -147,8 +144,6 @@ public: PassRefPtr<StyleRuleFontFace> copy() const { return adoptRef(new StyleRuleFontFace(*this)); } - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: StyleRuleFontFace(); StyleRuleFontFace(const StyleRuleFontFace&); @@ -172,8 +167,6 @@ public: PassRefPtr<StyleRulePage> copy() const { return adoptRef(new StyleRulePage(*this)); } - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: StyleRulePage(); StyleRulePage(const StyleRulePage&); @@ -189,8 +182,6 @@ public: void wrapperInsertRule(unsigned, PassRefPtr<StyleRuleBase>); void wrapperRemoveRule(unsigned); - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - protected: StyleRuleGroup(Type, Vector<RefPtr<StyleRuleBase> >& adoptRule); StyleRuleGroup(const StyleRuleGroup&); @@ -210,8 +201,6 @@ public: PassRefPtr<StyleRuleMedia> copy() const { return adoptRef(new StyleRuleMedia(*this)); } - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: StyleRuleMedia(PassRefPtr<MediaQuerySet>, Vector<RefPtr<StyleRuleBase> >& adoptRules); StyleRuleMedia(const StyleRuleMedia&); @@ -249,8 +238,6 @@ public: PassRefPtr<StyleRuleRegion> copy() const { return adoptRef(new StyleRuleRegion(*this)); } - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: StyleRuleRegion(Vector<OwnPtr<CSSParserSelector> >*, Vector<RefPtr<StyleRuleBase> >& adoptRules); StyleRuleRegion(const StyleRuleRegion&); @@ -285,8 +272,6 @@ public: PassRefPtr<StyleRuleViewport> copy() const { return adoptRef(new StyleRuleViewport(*this)); } - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: StyleRuleViewport(); StyleRuleViewport(const StyleRuleViewport&); @@ -327,8 +312,6 @@ public: PassRefPtr<StyleRuleFilter> copy() const { return adoptRef(new StyleRuleFilter(*this)); } - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: StyleRuleFilter(const String&); StyleRuleFilter(const StyleRuleFilter&); diff --git a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp index e207dd2..c0b111d 100644 --- a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp +++ b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp @@ -130,12 +130,4 @@ void StyleRuleImport::requestStyleSheet() } } -void StyleRuleImport::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_strHref, "strHref"); - info.addMember(m_mediaQueries, "mediaQueries"); - info.addMember(m_styleSheet, "styleSheet"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/StyleRuleImport.h b/third_party/WebKit/Source/core/css/StyleRuleImport.h index 5bedd4d..cc0d9b5 100644 --- a/third_party/WebKit/Source/core/css/StyleRuleImport.h +++ b/third_party/WebKit/Source/core/css/StyleRuleImport.h @@ -51,8 +51,6 @@ public: void requestStyleSheet(); - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: // NOTE: We put the CachedStyleSheetClient in a member instead of inheriting from it // to avoid adding a vptr to StyleRuleImport. diff --git a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp index e585dfd..03c10d8 100644 --- a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp +++ b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp @@ -28,12 +28,9 @@ #include "core/css/StyleRule.h" #include "core/css/StyleRuleImport.h" #include "core/dom/Node.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/cache/CachedCSSStyleSheet.h" #include "weborigin/SecurityOrigin.h" #include "wtf/Deque.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationVector.h" namespace WebCore { @@ -509,17 +506,4 @@ void StyleSheetContents::shrinkToFit() m_childRules.shrinkToFit(); } -void StyleSheetContents::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_ownerRule, "ownerRule"); - info.addMember(m_originalURL, "originalURL"); - info.addMember(m_encodingFromCharsetRule, "encodingFromCharsetRule"); - info.addMember(m_importRules, "importRules"); - info.addMember(m_childRules, "childRules"); - info.addMember(m_namespaces, "namespaces"); - info.addMember(m_parserContext, "parserContext"); - info.addMember(m_clients, "clients"); -} - } diff --git a/third_party/WebKit/Source/core/css/StyleSheetContents.h b/third_party/WebKit/Source/core/css/StyleSheetContents.h index b5be40a..0362f95 100644 --- a/third_party/WebKit/Source/core/css/StyleSheetContents.h +++ b/third_party/WebKit/Source/core/css/StyleSheetContents.h @@ -139,8 +139,6 @@ public: void addedToMemoryCache(); void removedFromMemoryCache(); - void reportMemoryUsage(MemoryObjectInfo*) const; - void shrinkToFit(); private: diff --git a/third_party/WebKit/Source/core/css/resolver/MatchResult.cpp b/third_party/WebKit/Source/core/css/resolver/MatchResult.cpp index 128f073..1419f59 100644 --- a/third_party/WebKit/Source/core/css/resolver/MatchResult.cpp +++ b/third_party/WebKit/Source/core/css/resolver/MatchResult.cpp @@ -31,9 +31,6 @@ #include "core/css/StylePropertySet.h" #include "core/css/StyleRule.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationVector.h" namespace WebCore { @@ -46,12 +43,6 @@ MatchedProperties::~MatchedProperties() { } -void MatchedProperties::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(properties, "properties"); -} - void MatchResult::addMatchedProperties(const StylePropertySet* properties, StyleRule* rule, unsigned linkMatchType, PropertyWhitelistType propertyWhitelistType) { matchedProperties.grow(matchedProperties.size() + 1); diff --git a/third_party/WebKit/Source/core/css/resolver/MatchResult.h b/third_party/WebKit/Source/core/css/resolver/MatchResult.h index 220a43e..bbcae30 100644 --- a/third_party/WebKit/Source/core/css/resolver/MatchResult.h +++ b/third_party/WebKit/Source/core/css/resolver/MatchResult.h @@ -25,7 +25,6 @@ #include "core/css/RuleSet.h" #include "core/css/SelectorChecker.h" -#include "wtf/MemoryObjectInfo.h" #include "wtf/RefPtr.h" #include "wtf/Vector.h" @@ -56,7 +55,6 @@ struct MatchRanges { struct MatchedProperties { MatchedProperties(); ~MatchedProperties(); - void reportMemoryUsage(WTF::MemoryObjectInfo*) const; RefPtr<StylePropertySet> properties; union { diff --git a/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp b/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp index 90c78ec..d39d131 100644 --- a/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp +++ b/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp @@ -32,8 +32,6 @@ #include "core/css/StylePropertySet.h" #include "core/css/resolver/StyleResolverState.h" #include "core/rendering/style/RenderStyle.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationVector.h" namespace WebCore { @@ -135,13 +133,4 @@ bool MatchedPropertiesCache::isCacheable(const Element* element, const RenderSty return true; } -void CachedMatchedProperties::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(matchedProperties, "matchedProperties"); - info.addMember(ranges, "ranges"); - info.addMember(renderStyle, "renderStyle"); - info.addMember(parentRenderStyle, "parentRenderStyle"); -} - } diff --git a/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.h b/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.h index ffc453d..9f732c5 100644 --- a/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.h +++ b/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.h @@ -36,7 +36,6 @@ class RenderStyle; class StyleResolverState; struct CachedMatchedProperties { - void reportMemoryUsage(MemoryObjectInfo*) const; Vector<MatchedProperties> matchedProperties; MatchRanges ranges; RefPtr<RenderStyle> renderStyle; diff --git a/third_party/WebKit/Source/core/css/resolver/MediaQueryResult.cpp b/third_party/WebKit/Source/core/css/resolver/MediaQueryResult.cpp deleted file mode 100644 index 85fed65..0000000 --- a/third_party/WebKit/Source/core/css/resolver/MediaQueryResult.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) - * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) - * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. - * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> - * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> - * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) - * Copyright (c) 2011, Code Aurora Forum. All rights reserved. - * Copyright (C) Research In Motion Limited 2011. All rights reserved. - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" -#include "core/css/resolver/MediaQueryResult.h" - -#include "core/dom/WebCoreMemoryInstrumentation.h" - -namespace WebCore { - -void MediaQueryResult::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_expression, "expression"); -} - -} diff --git a/third_party/WebKit/Source/core/css/resolver/MediaQueryResult.h b/third_party/WebKit/Source/core/css/resolver/MediaQueryResult.h index d8dff68..e18cbcf 100644 --- a/third_party/WebKit/Source/core/css/resolver/MediaQueryResult.h +++ b/third_party/WebKit/Source/core/css/resolver/MediaQueryResult.h @@ -36,7 +36,6 @@ public: , m_result(result) { } - void reportMemoryUsage(MemoryObjectInfo*) const; MediaQueryExp m_expression; bool m_result; diff --git a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp index 9a7c6ec..40a437a 100644 --- a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp @@ -36,12 +36,10 @@ #include "core/css/StyleRule.h" #include "core/css/resolver/StyleResolver.h" // For MatchRequest. #include "core/dom/Document.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/dom/shadow/ContentDistributor.h" #include "core/dom/shadow/ElementShadow.h" #include "core/dom/shadow/ShadowRoot.h" #include "core/html/HTMLStyleElement.h" -#include "wtf/MemoryInstrumentationHashMap.h" namespace WebCore { @@ -212,12 +210,6 @@ void ScopedStyleTree::remove(const ContainerNode* scopingNode) m_authorStyles.remove(scopingNode); } -void ScopedStyleTree::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_authorStyles, "authorStyles"); -} - const ContainerNode* ScopedStyleResolver::scopingNodeFor(const CSSStyleSheet* sheet) { ASSERT(sheet); @@ -402,11 +394,4 @@ void ScopedStyleResolver::collectViewportRulesTo(StyleResolver* resolver) const resolver->collectViewportRules(m_authorStyle.get()); } -void ScopedStyleResolver::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_authorStyle, "authorStyle"); - info.addMember(m_atHostRules, "atHostRules"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.h b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.h index 469ecd4..7a28798 100644 --- a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.h +++ b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.h @@ -76,8 +76,6 @@ public: void resetAtHostRules(const ShadowRoot*); void collectViewportRulesTo(StyleResolver*) const; - void reportMemoryUsage(MemoryObjectInfo*) const; - private: ScopedStyleResolver() : m_scopingNode(0), m_parent(0) { } ScopedStyleResolver(const ContainerNode* scopingNode) : m_scopingNode(scopingNode), m_parent(0) { } @@ -122,7 +120,6 @@ public: void setBuildInDocumentOrder(bool enabled) { m_buildInDocumentOrder = enabled; } bool buildInDocumentOrder() const { return m_buildInDocumentOrder; } - void reportMemoryUsage(MemoryObjectInfo*) const; private: void setupScopedStylesTree(ScopedStyleResolver* target); diff --git a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp index 2ecdf7f..c376ba5 100644 --- a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp +++ b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp @@ -67,7 +67,6 @@ #include "core/dom/NodeRenderStyle.h" #include "core/dom/NodeRenderingContext.h" #include "core/dom/Text.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/dom/shadow/ShadowRoot.h" #include "core/html/HTMLIFrameElement.h" #include "core/html/HTMLInputElement.h" @@ -95,8 +94,6 @@ #include "core/svg/SVGDocumentExtensions.h" #include "core/svg/SVGElement.h" #include "core/svg/SVGFontFaceElement.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/StdLibExtras.h" #include "wtf/Vector.h" diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp index 2d5c0a0..96c05c7 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp @@ -77,7 +77,6 @@ #include "core/dom/NodeRenderStyle.h" #include "core/dom/NodeRenderingContext.h" #include "core/dom/Text.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/dom/shadow/ShadowRoot.h" #include "core/html/HTMLHtmlElement.h" #include "core/html/HTMLIFrameElement.h" @@ -96,21 +95,11 @@ #include "core/svg/SVGDocumentExtensions.h" #include "core/svg/SVGElement.h" #include "core/svg/SVGFontFaceElement.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/StdLibExtras.h" #include "wtf/Vector.h" using namespace std; -namespace WTF { - -template<> struct SequenceMemoryInstrumentationTraits<const WebCore::RuleData*> { - template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&) { } -}; - -} - namespace WebCore { using namespace HTMLNames; @@ -1492,28 +1481,4 @@ bool StyleResolver::affectedByViewportChange() const return false; } -void StyleResolver::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_ruleSets, "ruleSets"); - info.addMember(m_matchedPropertiesCache, "matchedPropertiesCache"); - - info.addMember(m_medium, "medium"); - info.addMember(m_rootDefaultStyle, "rootDefaultStyle"); - info.addMember(m_document, "document"); - - info.addMember(m_fontSelector, "fontSelector"); - info.addMember(m_viewportDependentMediaQueryResults, "viewportDependentMediaQueryResults"); - info.addMember(m_inspectorCSSOMWrappers); - - info.addMember(m_styleTree, "scopedStyleTree"); - info.addMember(m_state, "state"); - - // FIXME: move this to a place where it would be called only once? - info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); - info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyle"); - info.addMember(CSSDefaultStyleSheets::defaultPrintStyle, "defaultPrintStyle"); - info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSourceStyle"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.h b/third_party/WebKit/Source/core/css/resolver/StyleResolver.h index eaafb13..1cf4420 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.h +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.h @@ -229,8 +229,6 @@ public: InspectorCSSOMWrappers& inspectorCSSOMWrappers() { return m_inspectorCSSOMWrappers; } - void reportMemoryUsage(MemoryObjectInfo*) const; - void collectViewportRules(RuleSet*); private: diff --git a/third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp b/third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp index c2008aa..15c43f3 100644 --- a/third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp +++ b/third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp @@ -28,7 +28,6 @@ #include "core/dom/ActiveDOMObject.h" #include "core/dom/ScriptExecutionContext.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" namespace WebCore { @@ -95,10 +94,4 @@ void ActiveDOMObject::stop() { } -void ActiveDOMObject::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); -} - - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/dom/ActiveDOMObject.h b/third_party/WebKit/Source/core/dom/ActiveDOMObject.h index f047cea..23244ef 100644 --- a/third_party/WebKit/Source/core/dom/ActiveDOMObject.h +++ b/third_party/WebKit/Source/core/dom/ActiveDOMObject.h @@ -76,8 +76,6 @@ public: thisObject->deref(); } - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - protected: virtual ~ActiveDOMObject(); diff --git a/third_party/WebKit/Source/core/dom/Attribute.h b/third_party/WebKit/Source/core/dom/Attribute.h index 3dece08..37fe145 100644 --- a/third_party/WebKit/Source/core/dom/Attribute.h +++ b/third_party/WebKit/Source/core/dom/Attribute.h @@ -26,7 +26,6 @@ #define Attribute_h #include "core/dom/QualifiedName.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" namespace WebCore { @@ -62,13 +61,6 @@ public: // elements may have placed the Attribute in a hash by name. void parserSetName(const QualifiedName& name) { m_name = name; } - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_name, "name"); - info.addMember(m_value, "value"); - } - #if COMPILER(MSVC) // NOTE: This constructor is not actually implemented, it's just defined so MSVC // will let us use a zero-length array of Attributes. diff --git a/third_party/WebKit/Source/core/dom/CharacterData.cpp b/third_party/WebKit/Source/core/dom/CharacterData.cpp index 1a25e91..bc86e80 100644 --- a/third_party/WebKit/Source/core/dom/CharacterData.cpp +++ b/third_party/WebKit/Source/core/dom/CharacterData.cpp @@ -29,7 +29,6 @@ #include "core/dom/MutationObserverInterestGroup.h" #include "core/dom/MutationRecord.h" #include "core/dom/Text.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/editing/FrameSelection.h" #include "core/inspector/InspectorInstrumentation.h" #include "core/platform/text/TextBreakIterator.h" @@ -107,13 +106,6 @@ unsigned CharacterData::parserAppendData(const String& string, unsigned offset, return characterLengthLimit; } -void CharacterData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - Node::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_data, "data"); -} - void CharacterData::appendData(const String& data) { String newStr = m_data; diff --git a/third_party/WebKit/Source/core/dom/CharacterData.h b/third_party/WebKit/Source/core/dom/CharacterData.h index a985c81..07b08fa 100644 --- a/third_party/WebKit/Source/core/dom/CharacterData.h +++ b/third_party/WebKit/Source/core/dom/CharacterData.h @@ -48,8 +48,6 @@ public: // Returns how much could be added before length limit was met. unsigned parserAppendData(const String& string, unsigned offset, unsigned lengthLimit); - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - protected: CharacterData(TreeScope* treeScope, const String& text, ConstructionType type) : Node(treeScope, type) diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp index 9983a2a..d58f2247 100644 --- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp +++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp @@ -973,20 +973,6 @@ Node *ContainerNode::childNode(unsigned index) const return n; } -void ContainerNode::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - Node::reportMemoryUsage(memoryObjectInfo); - info.ignoreMember(m_firstChild); - info.ignoreMember(m_lastChild); - - // Report child nodes as direct members to make them look like a tree in the snapshot. - NodeVector children; - getChildNodes(const_cast<ContainerNode*>(this), children); - for (size_t i = 0; i < children.size(); ++i) - info.addMember(children[i], "child"); -} - static void dispatchChildInsertionEvents(Node* child) { if (child->isInShadowTree()) diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.h b/third_party/WebKit/Source/core/dom/ContainerNode.h index 377cff5..f7ea2e8 100644 --- a/third_party/WebKit/Source/core/dom/ContainerNode.h +++ b/third_party/WebKit/Source/core/dom/ContainerNode.h @@ -130,8 +130,6 @@ public: virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const { return true; } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - protected: ContainerNode(TreeScope*, ConstructionType = CreateContainer); diff --git a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp index 1c1b72f..6c77804 100644 --- a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp +++ b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp @@ -28,7 +28,6 @@ #include "config.h" #include "core/dom/ContextLifecycleNotifier.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/TemporaryChange.h" namespace WebCore { @@ -131,13 +130,5 @@ bool ContextLifecycleNotifier::hasPendingActivity() const return false; } -void ContextLifecycleNotifier::reportMemoryUsage(WTF::MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - ActiveDOMObjectSet::iterator activeObjectsEnd = m_activeDOMObjects.end(); - for (ActiveDOMObjectSet::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) - info.addMember(*iter, "activeDOMObject", WTF::RetainingPointer); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h index 4929ade..d442add 100644 --- a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h +++ b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h @@ -31,10 +31,6 @@ #include "wtf/HashSet.h" #include "wtf/PassOwnPtr.h" -namespace WTF { -class MemoryObjectInfo; -} - namespace WebCore { class ActiveDOMObject; @@ -63,8 +59,6 @@ public: bool canSuspendActiveDOMObjects(); bool hasPendingActivity() const; - void reportMemoryUsage(WTF::MemoryObjectInfo*) const; - protected: explicit ContextLifecycleNotifier(ScriptExecutionContext*); diff --git a/third_party/WebKit/Source/core/dom/DOMException.h b/third_party/WebKit/Source/core/dom/DOMException.h index 06e4cbd..fb1163f 100644 --- a/third_party/WebKit/Source/core/dom/DOMException.h +++ b/third_party/WebKit/Source/core/dom/DOMException.h @@ -32,6 +32,7 @@ #include "bindings/v8/ScriptWrappable.h" #include "wtf/PassRefPtr.h" #include "wtf/RefCounted.h" +#include "wtf/text/WTFString.h" namespace WebCore { diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index 6955ac1..7db8f47 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp @@ -91,7 +91,6 @@ #include "core/dom/TreeWalker.h" #include "core/dom/UserActionElementSet.h" #include "core/dom/VisitedLinkState.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/dom/shadow/ElementShadow.h" #include "core/dom/shadow/ShadowRoot.h" #include "core/editing/Editor.h" @@ -168,10 +167,6 @@ #include "wtf/CurrentTime.h" #include "wtf/HashFunctions.h" #include "wtf/MainThread.h" -#include "wtf/MemoryInstrumentationHashCountedSet.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationHashSet.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/PassRefPtr.h" #include "wtf/StdLibExtras.h" #include "wtf/UnusedParam.h" @@ -5012,86 +5007,6 @@ void Document::updateHoverActiveState(const HitTestRequest& request, Element* in updateStyleIfNeeded(); } -void Document::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - ContainerNode::reportMemoryUsage(memoryObjectInfo); - TreeScope::reportMemoryUsage(memoryObjectInfo); - ScriptExecutionContext::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_styleResolver, "styleResolver"); - info.addMember(m_url, "url"); - info.addMember(m_baseURL, "baseURL"); - info.addMember(m_baseURLOverride, "baseURLOverride"); - info.addMember(m_baseElementURL, "baseElementURL"); - info.addMember(m_cookieURL, "cookieURL"); - info.addMember(m_firstPartyForCookies, "firstPartyForCookies"); - info.addMember(m_documentURI, "documentURI"); - info.addMember(m_baseTarget, "baseTarget"); - info.addMember(m_docType, "docType"); - info.addMember(m_implementation, "implementation"); - info.addMember(m_elemSheet, "elemSheet"); - info.addMember(m_frame, "frame"); - info.addMember(m_cachedResourceLoader, "cachedResourceLoader"); - info.addMember(m_styleSheetCollection, "styleSheetCollection"); - info.addMember(m_styleSheetList, "styleSheetList"); - info.addMember(m_formController, "formController"); - info.addMember(m_nodeIterators, "nodeIterators"); - info.addMember(m_ranges, "ranges"); - info.addMember(m_title.string(), "title.string()"); - info.addMember(m_rawTitle.string(), "rawTitle.string()"); - info.addMember(m_xmlEncoding, "xmlEncoding"); - info.addMember(m_xmlVersion, "xmlVersion"); - info.addMember(m_contentLanguage, "contentLanguage"); - info.addMember(m_annotatedRegions, "annotatedRegions"); - info.addMember(m_cssCanvasElements, "cssCanvasElements"); - info.addMember(m_iconURLs, "iconURLs"); - info.addMember(m_eventQueue, "eventQueue"); - info.addMember(m_pendingTasks, "pendingTasks"); - info.addMember(m_prerenderer, "prerenderer"); - info.addMember(m_listsInvalidatedAtDocument, "listsInvalidatedAtDocument"); - info.addMember(m_styleResolverThrowawayTimer, "styleResolverThrowawayTimer"); - info.addMember(m_parser, "parser"); - info.addMember(m_contextFeatures, "contextFeatures"); - info.addMember(m_focusedNode, "focusedNode"); - info.addMember(m_hoverNode, "hoverNode"); - info.addMember(m_documentElement, "documentElement"); - info.addMember(m_visitedLinkState, "visitedLinkState"); - info.addMember(m_styleRecalcTimer, "styleRecalcTimer"); - info.addMember(m_titleElement, "titleElement"); - info.ignoreMember(m_renderArena); - info.addMember(m_axObjectCache, "axObjectCache"); - info.addMember(m_markers, "markers"); - info.addMember(m_cssTarget, "cssTarget"); - info.addMember(m_updateFocusAppearanceTimer, "updateFocusAppearanceTimer"); - info.addMember(m_pendingStateObject, "pendingStateObject"); - info.addMember(m_scriptRunner, "scriptRunner"); - info.addMember(m_transformSource, "transformSource"); - info.addMember(m_transformSourceDocument, "transformSourceDocument"); - info.addMember(m_decoder, "decoder"); - info.addMember(m_svgExtensions, "svgExtensions"); - info.addMember(m_selectorQueryCache, "selectorQueryCache"); - info.addMember(m_renderer, "renderer"); - info.addMember(m_weakFactory, "weakFactory"); - info.addMember(m_idAttributeName, "idAttributeName"); - info.addMember(m_topLayerElements, "topLayerElements"); - info.addMember(m_loadEventDelayTimer, "loadEventDelayTimer"); - info.addMember(m_viewportArguments, "viewportArguments"); - info.addMember(m_documentTiming, "documentTiming"); - info.addMember(m_mediaQueryMatcher, "mediaQueryMatcher"); - info.addMember(m_touchEventTargets, "touchEventTargets"); - info.addMember(m_scriptedAnimationController, "scriptedAnimationController"); - info.addMember(m_pendingTasksTimer, "pendingTasksTimer"); - info.addMember(m_textAutosizer, "textAutosizer"); - info.addMember(m_namedFlows, "namedFlows"); - info.addMember(m_domSecurityPolicy, "domSecurityPolicy"); - info.addMember(m_sharedObjectPoolClearTimer, "sharedObjectPoolClearTimer"); - info.addMember(m_sharedObjectPool, "sharedObjectPool"); - info.addMember(m_localeCache, "localeCache"); - info.addMember(m_templateDocument, "templateDocument"); - info.addMember(m_templateDocumentHost, "templateDocumentHost"); - info.addMember(m_activeElement, "activeElement"); -} - bool Document::haveStylesheetsLoaded() const { return !m_styleSheetCollection->hasPendingSheets() || m_ignorePendingStylesheets; diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h index 3299ae2..3728b71 100644 --- a/third_party/WebKit/Source/core/dom/Document.h +++ b/third_party/WebKit/Source/core/dom/Document.h @@ -1012,8 +1012,6 @@ public: void setContextFeatures(PassRefPtr<ContextFeatures>); ContextFeatures* contextFeatures() { return m_contextFeatures.get(); } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - DocumentSharedObjectPool* sharedObjectPool() { return m_sharedObjectPool.get(); } void didRemoveAllPendingStylesheet(); diff --git a/third_party/WebKit/Source/core/dom/DocumentEventQueue.cpp b/third_party/WebKit/Source/core/dom/DocumentEventQueue.cpp index b32cb00..61c5bb5 100644 --- a/third_party/WebKit/Source/core/dom/DocumentEventQueue.cpp +++ b/third_party/WebKit/Source/core/dom/DocumentEventQueue.cpp @@ -30,11 +30,8 @@ #include "core/dom/Document.h" #include "core/dom/Event.h" #include "core/dom/EventNames.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/page/DOMWindow.h" #include "core/page/SuspendableTimer.h" -#include "wtf/MemoryInstrumentationHashSet.h" -#include "wtf/MemoryInstrumentationListHashSet.h" namespace WebCore { @@ -45,13 +42,6 @@ public: : SuspendableTimer(context) , m_eventQueue(eventQueue) { } - virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const OVERRIDE - { - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - SuspendableTimer::reportMemoryUsage(memoryObjectInfo); - info.addWeakPointer(m_eventQueue); - } - private: virtual void fired() { m_eventQueue->pendingEventTimerFired(); } DocumentEventQueue* m_eventQueue; @@ -104,14 +94,6 @@ void DocumentEventQueue::enqueueOrDispatchScrollEvent(PassRefPtr<Node> target, S enqueueEvent(scrollEvent.release()); } -void DocumentEventQueue::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_pendingEventTimer, "pendingEventTimer"); - info.addMember(m_queuedEvents, "queuedEvents"); - info.addMember(m_nodesWithQueuedScrollEvents, "nodesWithQueuedScrollEvents"); -} - bool DocumentEventQueue::cancelEvent(Event* event) { ListHashSet<RefPtr<Event>, 16>::iterator it = m_queuedEvents.find(event); diff --git a/third_party/WebKit/Source/core/dom/DocumentEventQueue.h b/third_party/WebKit/Source/core/dom/DocumentEventQueue.h index d877833..84d663e 100644 --- a/third_party/WebKit/Source/core/dom/DocumentEventQueue.h +++ b/third_party/WebKit/Source/core/dom/DocumentEventQueue.h @@ -58,8 +58,6 @@ public: void enqueueOrDispatchScrollEvent(PassRefPtr<Node>, ScrollEventTargetType); - void reportMemoryUsage(MemoryObjectInfo*) const; - private: explicit DocumentEventQueue(ScriptExecutionContext*); diff --git a/third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp b/third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp index 980917f..9f62cdb 100644 --- a/third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp +++ b/third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp @@ -35,11 +35,8 @@ #include "core/dom/Element.h" #include "core/dom/NodeTraversal.h" #include "core/dom/TreeScope.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/html/HTMLLabelElement.h" #include "core/html/HTMLMapElement.h" -#include "wtf/MemoryInstrumentationHashCountedSet.h" -#include "wtf/MemoryInstrumentationHashMap.h" namespace WebCore { @@ -161,11 +158,4 @@ Element* DocumentOrderedMap::getElementByLabelForAttribute(AtomicStringImpl* key return get<keyMatchesLabelForAttribute>(key, scope); } -void DocumentOrderedMap::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_map, "map"); - info.addMember(m_duplicateCounts, "duplicateCounts"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/dom/DocumentOrderedMap.h b/third_party/WebKit/Source/core/dom/DocumentOrderedMap.h index 78ccd90..9fe076a 100644 --- a/third_party/WebKit/Source/core/dom/DocumentOrderedMap.h +++ b/third_party/WebKit/Source/core/dom/DocumentOrderedMap.h @@ -56,8 +56,6 @@ public: void checkConsistency() const; - void reportMemoryUsage(MemoryObjectInfo*) const; - private: template<bool keyMatches(AtomicStringImpl*, Element*)> Element* get(AtomicStringImpl*, const TreeScope*) const; diff --git a/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp b/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp index 8bb4caf..34b0816 100644 --- a/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp +++ b/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp @@ -37,7 +37,6 @@ #include "core/dom/Document.h" #include "core/dom/Element.h" #include "core/dom/ProcessingInstruction.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/html/HTMLIFrameElement.h" #include "core/html/HTMLLinkElement.h" #include "core/html/HTMLStyleElement.h" @@ -46,8 +45,6 @@ #include "core/page/Settings.h" #include "core/page/UserContentURLPattern.h" #include "core/svg/SVGStyleElement.h" -#include "wtf/MemoryInstrumentationListHashSet.h" -#include "wtf/MemoryInstrumentationVector.h" namespace WebCore { @@ -280,18 +277,4 @@ bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleResolverUpdateMo return requiresFullStyleRecalc; } -void DocumentStyleSheetCollection::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_pageUserSheet, "pageUserSheet"); - info.addMember(m_injectedUserStyleSheets, "injectedUserStyleSheets"); - info.addMember(m_injectedAuthorStyleSheets, "injectedAuthorStyleSheets"); - info.addMember(m_userStyleSheets, "userStyleSheets"); - info.addMember(m_authorStyleSheets, "authorStyleSheets"); - info.addMember(m_collectionForDocument, "styleSheetCollectionForDocument"); - info.addMember(m_preferredStylesheetSetName, "preferredStylesheetSetName"); - info.addMember(m_selectedStylesheetSetName, "selectedStylesheetSetName"); - info.addMember(m_document, "document"); -} - } diff --git a/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.h b/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.h index 7b4cc03..c0e0327 100644 --- a/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.h +++ b/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.h @@ -103,8 +103,6 @@ public: void combineCSSFeatureFlags(); void resetCSSFeatureFlags(); - void reportMemoryUsage(MemoryObjectInfo*) const; - private: DocumentStyleSheetCollection(Document*); diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp index 2b05306..5aa5f57 100644 --- a/third_party/WebKit/Source/core/dom/Element.cpp +++ b/third_party/WebKit/Source/core/dom/Element.cpp @@ -58,7 +58,6 @@ #include "core/dom/ScriptableDocumentParser.h" #include "core/dom/SelectorQuery.h" #include "core/dom/Text.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/dom/shadow/InsertionPoint.h" #include "core/dom/shadow/ShadowRoot.h" #include "core/editing/FrameSelection.h" @@ -88,7 +87,6 @@ #include "core/svg/SVGElement.h" #include "wtf/BitVector.h" #include "wtf/HashFunctions.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/text/CString.h" #include "wtf/text/TextPosition.h" @@ -3070,14 +3068,6 @@ void Element::createUniqueElementData() } } -void Element::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - ContainerNode::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_tagName, "tagName"); - info.addMember(m_elementData, "elementData"); -} - InputMethodContext* Element::getInputContext() { return ensureElementRareData()->ensureInputMethodContext(toHTMLElement(this)); @@ -3595,22 +3585,6 @@ bool ElementData::isEquivalent(const ElementData* other) const return true; } -void ElementData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - size_t actualSize = m_isUnique ? sizeof(ElementData) : sizeForShareableElementDataWithAttributeCount(m_arraySize); - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM, actualSize); - info.addMember(m_inlineStyle, "inlineStyle"); - info.addMember(m_classNames, "classNames"); - info.addMember(m_idForStyleResolution, "idForStyleResolution"); - if (m_isUnique) { - const UniqueElementData* uniqueThis = static_cast<const UniqueElementData*>(this); - info.addMember(uniqueThis->m_presentationAttributeStyle, "presentationAttributeStyle"); - info.addMember(uniqueThis->m_attributeVector, "attributeVector"); - } - for (unsigned i = 0, len = length(); i < len; i++) - info.addMember(*attributeItem(i), "*attributeItem"); -} - size_t ElementData::getAttrIndex(Attr* attr) const { // This relies on the fact that Attr's QualifiedName == the Attribute's name. diff --git a/third_party/WebKit/Source/core/dom/Element.h b/third_party/WebKit/Source/core/dom/Element.h index 4f71560..8575c9f 100644 --- a/third_party/WebKit/Source/core/dom/Element.h +++ b/third_party/WebKit/Source/core/dom/Element.h @@ -93,8 +93,6 @@ public: bool isEquivalent(const ElementData* other) const; - void reportMemoryUsage(MemoryObjectInfo*) const; - bool isUnique() const { return m_isUnique; } protected: @@ -623,8 +621,6 @@ public: IntSize savedLayerScrollOffset() const; void setSavedLayerScrollOffset(const IntSize&); - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - void addActiveAnimation(Animation*); void removeActiveAnimation(Animation*); bool hasActiveAnimations() const; diff --git a/third_party/WebKit/Source/core/dom/ElementRareData.cpp b/third_party/WebKit/Source/core/dom/ElementRareData.cpp index c6510d5..ef6d2c2 100644 --- a/third_party/WebKit/Source/core/dom/ElementRareData.cpp +++ b/third_party/WebKit/Source/core/dom/ElementRareData.cpp @@ -31,7 +31,6 @@ #include "config.h" #include "core/dom/ElementRareData.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/rendering/RegionOversetState.h" #include "core/rendering/style/RenderStyle.h" @@ -48,18 +47,4 @@ struct SameSizeAsElementRareData : NodeRareData { COMPILE_ASSERT(sizeof(ElementRareData) == sizeof(SameSizeAsElementRareData), ElementRareDataShouldStaySmall); -void ElementRareData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - NodeRareData::reportMemoryUsage(memoryObjectInfo); - - info.addMember(m_computedStyle, "computedStyle"); - info.addMember(m_dataset, "dataset"); - info.addMember(m_classList, "classList"); - info.addMember(m_shadow, "shadow"); - info.addMember(m_attributeMap, "attributeMap"); - info.addMember(m_generatedBefore, "generatedBefore"); - info.addMember(m_generatedAfter, "generatedAfter"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/dom/ElementRareData.h b/third_party/WebKit/Source/core/dom/ElementRareData.h index 77244da..4b86859 100644 --- a/third_party/WebKit/Source/core/dom/ElementRareData.h +++ b/third_party/WebKit/Source/core/dom/ElementRareData.h @@ -95,9 +95,6 @@ public: unsigned childIndex() const { return m_childIndex; } void setChildIndex(unsigned index) { m_childIndex = index; } - // Manually called by Node::reportMemoryUsage. - void reportMemoryUsage(MemoryObjectInfo*) const; - void clearShadow() { m_shadow = nullptr; } ElementShadow* shadow() const { return m_shadow.get(); } ElementShadow* ensureShadow() diff --git a/third_party/WebKit/Source/core/dom/Event.cpp b/third_party/WebKit/Source/core/dom/Event.cpp index 74a795f..1b714f7 100644 --- a/third_party/WebKit/Source/core/dom/Event.cpp +++ b/third_party/WebKit/Source/core/dom/Event.cpp @@ -26,7 +26,6 @@ #include "core/dom/EventNames.h" #include "core/dom/EventTarget.h" #include "core/dom/StaticNodeList.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/CurrentTime.h" #include "wtf/text/AtomicString.h" @@ -163,15 +162,6 @@ void Event::storeResult(const String&) { } -void Event::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_type, "type"); - info.addMember(m_currentTarget, "currentTarget"); - info.addMember(m_target, "target"); - info.addMember(m_underlyingEvent, "underlyingEvent"); -} - void Event::setTarget(PassRefPtr<EventTarget> target) { if (m_target == target) diff --git a/third_party/WebKit/Source/core/dom/Event.h b/third_party/WebKit/Source/core/dom/Event.h index 60a60fa..82e402d 100644 --- a/third_party/WebKit/Source/core/dom/Event.h +++ b/third_party/WebKit/Source/core/dom/Event.h @@ -164,8 +164,6 @@ public: bool isBeingDispatched() const { return eventPhase(); } - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - protected: Event(); Event(const AtomicString& type, bool canBubble, bool cancelable); diff --git a/third_party/WebKit/Source/core/dom/LiveNodeList.cpp b/third_party/WebKit/Source/core/dom/LiveNodeList.cpp index 8344556..33f04cd 100644 --- a/third_party/WebKit/Source/core/dom/LiveNodeList.cpp +++ b/third_party/WebKit/Source/core/dom/LiveNodeList.cpp @@ -25,7 +25,6 @@ #include "core/dom/Document.h" #include "core/dom/Element.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/html/HTMLCollection.h" namespace WebCore { @@ -69,14 +68,6 @@ void LiveNodeListBase::invalidateIdNameCacheMaps() const cacheBase->m_nameCache.clear(); } -void LiveNodeListBase::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - NodeList::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_ownerNode, "ownerNode"); - info.addWeakPointer(m_cachedItem); -} - Node* LiveNodeList::namedItem(const AtomicString& elementId) const { Node* rootNode = this->rootNode(); diff --git a/third_party/WebKit/Source/core/dom/LiveNodeList.h b/third_party/WebKit/Source/core/dom/LiveNodeList.h index c4aa5cb..06e6d8f 100644 --- a/third_party/WebKit/Source/core/dom/LiveNodeList.h +++ b/third_party/WebKit/Source/core/dom/LiveNodeList.h @@ -77,8 +77,6 @@ public: document()->unregisterNodeList(this); } - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - // DOM API virtual unsigned length() const OVERRIDE; virtual Node* item(unsigned offset) const OVERRIDE; diff --git a/third_party/WebKit/Source/core/dom/MutationObserver.h b/third_party/WebKit/Source/core/dom/MutationObserver.h index eb0da18..2a78bbf 100644 --- a/third_party/WebKit/Source/core/dom/MutationObserver.h +++ b/third_party/WebKit/Source/core/dom/MutationObserver.h @@ -36,6 +36,7 @@ #include "wtf/PassRefPtr.h" #include "wtf/RefCounted.h" #include "wtf/RefPtr.h" +#include "wtf/Vector.h" namespace WebCore { diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp index 567f730..8860aee 100644 --- a/third_party/WebKit/Source/core/dom/Node.cpp +++ b/third_party/WebKit/Source/core/dom/Node.cpp @@ -67,7 +67,6 @@ #include "core/dom/TreeScopeAdopter.h" #include "core/dom/UIEvent.h" #include "core/dom/UserActionElementSet.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/dom/WheelEvent.h" #include "core/dom/shadow/ElementShadow.h" #include "core/dom/shadow/ShadowRoot.h" @@ -2573,23 +2572,6 @@ void Node::removedLastRef() delete this; } -void Node::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - ScriptWrappable::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_parentOrShadowHostNode, "parentOrShadowHostNode"); - info.addMember(m_treeScope, "treeScope"); - info.ignoreMember(m_next); - info.ignoreMember(m_previous); - info.addMember(this->renderer(), "renderer"); - if (hasRareData()) { - if (isElementNode()) - info.addMember(static_cast<ElementRareData*>(rareData()), "elementRareData"); - else - info.addMember(rareData(), "rareData"); - } -} - void Node::textRects(Vector<IntRect>& rects) const { RefPtr<Range> range = Range::create(document()); diff --git a/third_party/WebKit/Source/core/dom/Node.h b/third_party/WebKit/Source/core/dom/Node.h index 9d9ac54..8567496 100644 --- a/third_party/WebKit/Source/core/dom/Node.h +++ b/third_party/WebKit/Source/core/dom/Node.h @@ -702,8 +702,6 @@ public: virtual void unregisterScopedHTMLStyleChild(); size_t numberOfScopedHTMLStyleChildren() const; - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - void textRects(Vector<IntRect>&) const; unsigned connectedSubframeCount() const; diff --git a/third_party/WebKit/Source/core/dom/NodeRareData.cpp b/third_party/WebKit/Source/core/dom/NodeRareData.cpp index e11eb42..bbd863e 100644 --- a/third_party/WebKit/Source/core/dom/NodeRareData.cpp +++ b/third_party/WebKit/Source/core/dom/NodeRareData.cpp @@ -31,9 +31,6 @@ #include "config.h" #include "core/dom/NodeRareData.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" -#include "wtf/MemoryInstrumentationHashMap.h" - namespace WebCore { struct SameSizeAsNodeRareData { @@ -43,20 +40,4 @@ struct SameSizeAsNodeRareData { COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareDataShouldStaySmall); -void NodeListsNodeData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_childNodeList, "childNodeList"); - info.addMember(m_atomicNameCaches, "atomicNameCaches"); - info.addMember(m_nameCaches, "nameCaches"); - info.addMember(m_tagNodeListCacheNS, "tagNodeListCacheNS"); -} - -void NodeRareData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_nodeLists, "nodeLists"); - info.addMember(m_mutationObserverData, "mutationObserverData"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/dom/NodeRareData.h b/third_party/WebKit/Source/core/dom/NodeRareData.h index 7da5008..120a15b 100644 --- a/third_party/WebKit/Source/core/dom/NodeRareData.h +++ b/third_party/WebKit/Source/core/dom/NodeRareData.h @@ -205,8 +205,6 @@ public: } } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: NodeListsNodeData() : m_childNodeList(0) @@ -278,9 +276,6 @@ public: m_connectedFrameCount -= amount; } - // This member function is intentionally not virtual to avoid adding a vtable pointer. - void reportMemoryUsage(MemoryObjectInfo*) const; - protected: NodeRareData(RenderObject* renderer) : NodeRareDataBase(renderer) diff --git a/third_party/WebKit/Source/core/dom/QualifiedName.cpp b/third_party/WebKit/Source/core/dom/QualifiedName.cpp index 79fad2d..14035fb 100644 --- a/third_party/WebKit/Source/core/dom/QualifiedName.cpp +++ b/third_party/WebKit/Source/core/dom/QualifiedName.cpp @@ -31,7 +31,6 @@ #include "XMLNSNames.h" #include "XMLNames.h" #include "core/dom/QualifiedName.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/Assertions.h" #include "wtf/HashSet.h" #include "wtf/StaticConstructors.h" @@ -132,22 +131,6 @@ const AtomicString& QualifiedName::localNameUpper() const return m_impl->m_localNameUpper; } -void QualifiedName::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_impl, "impl"); -} - - -void QualifiedName::QualifiedNameImpl::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_prefix, "prefix"); - info.addMember(m_localName, "localName"); - info.addMember(m_namespace, "namespace"); - info.addMember(m_localNameUpper, "localNameUpper"); -} - unsigned QualifiedName::QualifiedNameImpl::computeHash() const { QualifiedNameComponents components = { m_prefix.impl(), m_localName.impl(), m_namespace.impl() }; diff --git a/third_party/WebKit/Source/core/dom/QualifiedName.h b/third_party/WebKit/Source/core/dom/QualifiedName.h index 5933fe7..14f1ac3 100644 --- a/third_party/WebKit/Source/core/dom/QualifiedName.h +++ b/third_party/WebKit/Source/core/dom/QualifiedName.h @@ -54,8 +54,6 @@ public: const AtomicString m_namespace; mutable AtomicString m_localNameUpper; - void reportMemoryUsage(MemoryObjectInfo*) const; - private: QualifiedNameImpl(const AtomicString& prefix, const AtomicString& localName, const AtomicString& namespaceURI) : m_existingHash(0) @@ -100,8 +98,6 @@ public: // Init routine for globals static void init(); - void reportMemoryUsage(MemoryObjectInfo*) const; - private: void ref() const { m_impl->ref(); } void deref(); diff --git a/third_party/WebKit/Source/core/dom/ScriptExecutionContext.cpp b/third_party/WebKit/Source/core/dom/ScriptExecutionContext.cpp index 63180d9..db37a90 100644 --- a/third_party/WebKit/Source/core/dom/ScriptExecutionContext.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptExecutionContext.cpp @@ -32,7 +32,6 @@ #include "core/dom/ErrorEvent.h" #include "core/dom/EventTarget.h" #include "core/dom/MessagePort.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/html/PublicURLManager.h" #include "core/inspector/InspectorInstrumentation.h" #include "core/inspector/ScriptCallStack.h" @@ -42,17 +41,7 @@ #include "core/workers/WorkerThread.h" #include "modules/webdatabase/DatabaseContext.h" #include "wtf/MainThread.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationHashSet.h" -#include "wtf/MemoryInstrumentationVector.h" -namespace WTF { - -template<> struct SequenceMemoryInstrumentationTraits<WebCore::ContextLifecycleObserver*> { - template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&) { } -}; - -} namespace WebCore { class ProcessMessagesSoonTask : public ScriptExecutionContext::Task { @@ -334,17 +323,6 @@ PassOwnPtr<ContextLifecycleNotifier> ScriptExecutionContext::createLifecycleNoti return ContextLifecycleNotifier::create(this); } -void ScriptExecutionContext::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - SecurityContext::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_messagePorts, "messagePorts"); - info.addMember(m_lifecycleNotifier, "lifecycleObserver"); - info.addMember(m_timeouts, "timeouts"); - info.addMember(m_pendingExceptions, "pendingExceptions"); - info.addMember(m_publicURLManager, "publicURLManager"); -} - ScriptExecutionContext::Task::~Task() { } diff --git a/third_party/WebKit/Source/core/dom/ScriptExecutionContext.h b/third_party/WebKit/Source/core/dom/ScriptExecutionContext.h index 020aa20..60a05a7 100644 --- a/third_party/WebKit/Source/core/dom/ScriptExecutionContext.h +++ b/third_party/WebKit/Source/core/dom/ScriptExecutionContext.h @@ -130,8 +130,6 @@ public: virtual EventQueue* eventQueue() const = 0; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - void setDatabaseContext(DatabaseContext*); protected: diff --git a/third_party/WebKit/Source/core/dom/SecurityContext.cpp b/third_party/WebKit/Source/core/dom/SecurityContext.cpp index c40d60c..f1375e0 100644 --- a/third_party/WebKit/Source/core/dom/SecurityContext.cpp +++ b/third_party/WebKit/Source/core/dom/SecurityContext.cpp @@ -27,7 +27,6 @@ #include "config.h" #include "core/dom/SecurityContext.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/html/parser/HTMLParserIdioms.h" #include "core/page/ContentSecurityPolicy.h" #include "weborigin/SecurityOrigin.h" @@ -142,11 +141,4 @@ SandboxFlags SecurityContext::parseSandboxPolicy(const String& policy, String& i return flags; } -void SecurityContext::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_securityOrigin, "securityOrigin"); - info.addMember(m_contentSecurityPolicy, "contentSecurityPolicy"); -} - } diff --git a/third_party/WebKit/Source/core/dom/SecurityContext.h b/third_party/WebKit/Source/core/dom/SecurityContext.h index 9685aea..0674b93 100644 --- a/third_party/WebKit/Source/core/dom/SecurityContext.h +++ b/third_party/WebKit/Source/core/dom/SecurityContext.h @@ -73,8 +73,6 @@ public: static SandboxFlags parseSandboxPolicy(const String& policy, String& invalidTokensErrorMessage); - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - protected: SecurityContext(); virtual ~SecurityContext(); diff --git a/third_party/WebKit/Source/core/dom/StyleSheetCollection.cpp b/third_party/WebKit/Source/core/dom/StyleSheetCollection.cpp index 2f3c5b7..5164c84 100644 --- a/third_party/WebKit/Source/core/dom/StyleSheetCollection.cpp +++ b/third_party/WebKit/Source/core/dom/StyleSheetCollection.cpp @@ -38,7 +38,6 @@ #include "core/dom/DocumentStyleSheetCollection.h" #include "core/dom/Element.h" #include "core/dom/ProcessingInstruction.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/html/HTMLIFrameElement.h" #include "core/html/HTMLLinkElement.h" #include "core/html/HTMLStyleElement.h" @@ -47,8 +46,6 @@ #include "core/page/Settings.h" #include "core/page/UserContentURLPattern.h" #include "core/svg/SVGStyleElement.h" -#include "wtf/MemoryInstrumentationListHashSet.h" -#include "wtf/MemoryInstrumentationVector.h" namespace WebCore { @@ -281,13 +278,4 @@ bool StyleSheetCollection::updateActiveStyleSheets(DocumentStyleSheetCollection* return requiresFullStyleRecalc; } -void StyleSheetCollection::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_activeAuthorStyleSheets, "activeAuthorStyleSheets"); - info.addMember(m_styleSheetsForStyleSheetList, "styleSheetsForStyleSheetList"); - info.addMember(m_styleSheetCandidateNodes, "styleSheetCandidateNodes"); - info.addMember(m_treeScope, "treeScope"); -} - } diff --git a/third_party/WebKit/Source/core/dom/StyleSheetCollection.h b/third_party/WebKit/Source/core/dom/StyleSheetCollection.h index fd0d176..e14a7ac 100644 --- a/third_party/WebKit/Source/core/dom/StyleSheetCollection.h +++ b/third_party/WebKit/Source/core/dom/StyleSheetCollection.h @@ -68,8 +68,6 @@ public: }; bool updateActiveStyleSheets(DocumentStyleSheetCollection*, StyleResolverUpdateMode, StyleResolverUpdateType&); - void reportMemoryUsage(MemoryObjectInfo*) const; - private: Document* document() { return m_treeScope->documentScope(); } diff --git a/third_party/WebKit/Source/core/dom/TreeScope.cpp b/third_party/WebKit/Source/core/dom/TreeScope.cpp index 1d778d9..df9209c 100644 --- a/third_party/WebKit/Source/core/dom/TreeScope.cpp +++ b/third_party/WebKit/Source/core/dom/TreeScope.cpp @@ -418,20 +418,6 @@ unsigned short TreeScope::comparePosition(const TreeScope* otherScope) const Node::DOCUMENT_POSITION_PRECEDING | Node::DOCUMENT_POSITION_CONTAINS; } -void TreeScope::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_rootNode, "rootNode"); - info.addMember(m_parentTreeScope, "parentTreeScope"); - info.addMember(m_elementsById, "elementsById"); - info.addMember(m_imageMapsByName, "imageMapsByName"); - info.addMember(m_labelsByForAttribute, "labelsByForAttribute"); - info.addMember(m_idTargetObserverRegistry, "idTargetObserverRegistry"); - info.addMember(m_selection, "selection"); - info.addMember(m_documentScope, "documentScope"); - -} - static void listTreeScopes(Node* node, Vector<TreeScope*, 5>& treeScopes) { while (true) { diff --git a/third_party/WebKit/Source/core/dom/TreeScope.h b/third_party/WebKit/Source/core/dom/TreeScope.h index 989638c..6f4b3ee 100644 --- a/third_party/WebKit/Source/core/dom/TreeScope.h +++ b/third_party/WebKit/Source/core/dom/TreeScope.h @@ -96,8 +96,6 @@ public: IdTargetObserverRegistry& idTargetObserverRegistry() const { return *m_idTargetObserverRegistry.get(); } - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - static TreeScope* noDocumentInstance() { DEFINE_STATIC_LOCAL(TreeScope, instance, ()); diff --git a/third_party/WebKit/Source/core/dom/WebCoreMemoryInstrumentation.cpp b/third_party/WebKit/Source/core/dom/WebCoreMemoryInstrumentation.cpp deleted file mode 100644 index f390792..0000000 --- a/third_party/WebKit/Source/core/dom/WebCoreMemoryInstrumentation.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" - -#include "core/rendering/RenderBlock.h" -#include "core/rendering/RenderBox.h" - -namespace WebCore { - -MemoryObjectType WebCoreMemoryTypes::Page = "DOM"; -MemoryObjectType WebCoreMemoryTypes::DOM = "DOM"; -MemoryObjectType WebCoreMemoryTypes::CSS = "CSS"; -MemoryObjectType WebCoreMemoryTypes::Binding = "DOM"; -MemoryObjectType WebCoreMemoryTypes::RenderingStructures = "Rendering"; - -MemoryObjectType WebCoreMemoryTypes::MemoryCacheStructures = "Resources"; -MemoryObjectType WebCoreMemoryTypes::CachedResource = "Resources"; -MemoryObjectType WebCoreMemoryTypes::CachedResourceRaw = "Resources"; -MemoryObjectType WebCoreMemoryTypes::CachedResourceCSS = "Resources"; -MemoryObjectType WebCoreMemoryTypes::CachedResourceFont = "Resources"; -MemoryObjectType WebCoreMemoryTypes::CachedResourceImage = "Resources"; -MemoryObjectType WebCoreMemoryTypes::CachedResourceScript = "Resources"; -MemoryObjectType WebCoreMemoryTypes::CachedResourceSVG = "Resources"; -MemoryObjectType WebCoreMemoryTypes::CachedResourceShader = "Resources"; -MemoryObjectType WebCoreMemoryTypes::CachedResourceXSLT = "Resources"; - -MemoryObjectType WebCoreMemoryTypes::ExternalStrings = "JSExternalResources"; -MemoryObjectType WebCoreMemoryTypes::ExternalArrays = "JSExternalResources"; - -MemoryObjectType WebCoreMemoryTypes::Inspector = "WebInspector"; -MemoryObjectType WebCoreMemoryTypes::InspectorController = "WebInspector"; -MemoryObjectType WebCoreMemoryTypes::InspectorMemoryAgent = "WebInspector"; -MemoryObjectType WebCoreMemoryTypes::InspectorDOMStorageAgent = "WebInspector"; -MemoryObjectType WebCoreMemoryTypes::InspectorOverlay = "WebInspector"; -MemoryObjectType WebCoreMemoryTypes::InspectorProfilerAgent = "WebInspector"; -MemoryObjectType WebCoreMemoryTypes::InspectorDebuggerAgent = "WebInspector"; -MemoryObjectType WebCoreMemoryTypes::InspectorResourceAgent = "WebInspector"; - -MemoryObjectType WebCoreMemoryTypes::JSHeapUsed = "JSHeap.Used"; -MemoryObjectType WebCoreMemoryTypes::JSHeapUnused = "JSHeap.Unused"; - -MemoryObjectType WebCoreMemoryTypes::DOMStorageCache = "DOMStorageCache"; - -MemoryObjectType WebCoreMemoryTypes::RenderTreeUsed = "RenderTree"; -MemoryObjectType WebCoreMemoryTypes::RenderTreeUnused = "RenderTree"; - -MemoryObjectType WebCoreMemoryTypes::ProcessPrivateMemory = "ProcessPrivateMemory"; - - -void WebCoreMemoryInstrumentation::reportStaticMembersMemoryUsage(WTF::MemoryInstrumentation* memoryInstrumentation) -{ - RenderBlock::reportStaticMembersMemoryUsage(memoryInstrumentation); - RenderBox::reportStaticMembersMemoryUsage(memoryInstrumentation); -} - -} // namespace WebCore diff --git a/third_party/WebKit/Source/core/dom/WebCoreMemoryInstrumentation.h b/third_party/WebKit/Source/core/dom/WebCoreMemoryInstrumentation.h deleted file mode 100644 index dc0e49e..0000000 --- a/third_party/WebKit/Source/core/dom/WebCoreMemoryInstrumentation.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef WebCoreMemoryInstrumentation_h -#define WebCoreMemoryInstrumentation_h - -#include "core/platform/PlatformMemoryInstrumentation.h" -#include "wtf/MemoryInstrumentationString.h" - -namespace WebCore { - -using WTF::MemoryClassInfo; -using WTF::MemoryObjectType; - -class WebCoreMemoryTypes : public PlatformMemoryTypes { -public: - static MemoryObjectType Page; - static MemoryObjectType DOM; - static MemoryObjectType CSS; - static MemoryObjectType Binding; - static MemoryObjectType RenderingStructures; - - static MemoryObjectType MemoryCacheStructures; - static MemoryObjectType CachedResource; - static MemoryObjectType CachedResourceRaw; - static MemoryObjectType CachedResourceCSS; - static MemoryObjectType CachedResourceFont; - static MemoryObjectType CachedResourceImage; - static MemoryObjectType CachedResourceScript; - static MemoryObjectType CachedResourceSVG; - static MemoryObjectType CachedResourceShader; - static MemoryObjectType CachedResourceXSLT; - - static MemoryObjectType ExternalStrings; - static MemoryObjectType ExternalArrays; - - static MemoryObjectType Inspector; - static MemoryObjectType InspectorController; - static MemoryObjectType InspectorMemoryAgent; - static MemoryObjectType InspectorDOMStorageAgent; - static MemoryObjectType InspectorOverlay; - static MemoryObjectType InspectorProfilerAgent; - static MemoryObjectType InspectorDebuggerAgent; - static MemoryObjectType InspectorResourceAgent; - - static MemoryObjectType JSHeapUsed; - static MemoryObjectType JSHeapUnused; - - static MemoryObjectType DOMStorageCache; - - static MemoryObjectType RenderTreeUsed; - static MemoryObjectType RenderTreeUnused; - - static MemoryObjectType ProcessPrivateMemory; -}; - -class WebCoreMemoryInstrumentation { -public: - static void reportStaticMembersMemoryUsage(WTF::MemoryInstrumentation*); -}; - - -} // namespace WebCore - -#endif // !defined(WebCoreMemoryInstrumentation_h) diff --git a/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp b/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp index 2e988ee..4518e29 100644 --- a/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp +++ b/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp @@ -130,16 +130,4 @@ void ElementShadow::removeAllEventListeners() } } -void ElementShadow::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_shadowRoots, "shadowRoots"); - ShadowRoot* shadowRoot = m_shadowRoots.head(); - while (shadowRoot) { - info.addMember(shadowRoot, "shadowRoot"); - shadowRoot = shadowRoot->next(); - } - info.addMember(m_distributor, "distributor"); -} - } // namespace diff --git a/third_party/WebKit/Source/core/dom/shadow/ElementShadow.h b/third_party/WebKit/Source/core/dom/shadow/ElementShadow.h index a3ce07e..a1f645d 100644 --- a/third_party/WebKit/Source/core/dom/shadow/ElementShadow.h +++ b/third_party/WebKit/Source/core/dom/shadow/ElementShadow.h @@ -71,8 +71,6 @@ public: ContentDistributor& distributor() { return m_distributor; } const ContentDistributor& distributor() const { return m_distributor; } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: ElementShadow() { } diff --git a/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp b/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp index 42152f7..2fc2f26 100644 --- a/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp +++ b/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp @@ -302,14 +302,4 @@ ScopeContentDistribution* ShadowRoot::ensureScopeDistribution() return m_scopeDistribution.get(); } -void ShadowRoot::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - DocumentFragment::reportMemoryUsage(memoryObjectInfo); - TreeScope::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_prev, "prev"); - info.addMember(m_next, "next"); - info.addMember(m_scopeDistribution, "scopeDistribution"); -} - } diff --git a/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h b/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h index 9d17cad..4e9c5e5 100644 --- a/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h +++ b/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h @@ -98,8 +98,6 @@ public: PassRefPtr<Node> cloneNode(bool, ExceptionCode&); PassRefPtr<Node> cloneNode(ExceptionCode& ec) { return cloneNode(true, ec); } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: ShadowRoot(Document*, ShadowRootType); virtual ~ShadowRoot(); diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp index ddbe25a..898ccd6 100644 --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp @@ -33,7 +33,6 @@ #include "bindings/v8/ScriptController.h" #include "core/dom/Document.h" #include "core/dom/ExceptionCode.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/html/ImageData.h" #include "core/html/canvas/Canvas2DContextAttributes.h" #include "core/html/canvas/CanvasRenderingContext2D.h" @@ -44,7 +43,6 @@ #include "core/platform/graphics/GraphicsContextStateSaver.h" #include "core/platform/graphics/ImageBuffer.h" #include "core/rendering/RenderHTMLCanvas.h" -#include "wtf/MemoryInstrumentationHashSet.h" #include "core/html/canvas/WebGLContextAttributes.h" #include "core/html/canvas/WebGLRenderingContext.h" @@ -567,16 +565,4 @@ AffineTransform HTMLCanvasElement::baseTransform() const return m_imageBuffer->baseTransform() * transform; } -void HTMLCanvasElement::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - HTMLElement::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_observers, "observers"); - info.addMember(m_context, "context"); - info.addMember(m_imageBuffer, "imageBuffer"); - info.addMember(m_contextStateSaver, "contextStateSaver"); - info.addMember(m_presentedImage, "presentedImage"); - info.addMember(m_copiedImage, "copiedImage"); -} - } diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.h b/third_party/WebKit/Source/core/html/HTMLCanvasElement.h index 5d5557b..386dc77 100644 --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.h +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.h @@ -133,8 +133,6 @@ public: float deviceScaleFactor() const { return m_deviceScaleFactor; } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: HTMLCanvasElement(const QualifiedName&, Document*); diff --git a/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp b/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp index 0e79cdd..a94e8f2 100644 --- a/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp @@ -494,11 +494,4 @@ HTMLFormControlElement* HTMLFormControlElement::enclosingFormControlElement(Node return 0; } -void HTMLFormControlElement::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - LabelableElement::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_validationMessage, "validationMessage"); -} - } // namespace Webcore diff --git a/third_party/WebKit/Source/core/html/HTMLFormControlElement.h b/third_party/WebKit/Source/core/html/HTMLFormControlElement.h index 6d0a644..9db6fe9 100644 --- a/third_party/WebKit/Source/core/html/HTMLFormControlElement.h +++ b/third_party/WebKit/Source/core/html/HTMLFormControlElement.h @@ -105,8 +105,6 @@ public: using Node::ref; using Node::deref; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - protected: HTMLFormControlElement(const QualifiedName& tagName, Document*, HTMLFormElement*); diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp index 90c15f7..14763c6 100644 --- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp @@ -357,12 +357,4 @@ bool HTMLImageElement::isServerMap() const return document()->completeURL(stripLeadingAndTrailingHTMLSpaces(usemap)).isEmpty(); } -void HTMLImageElement::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - HTMLElement::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_imageLoader, "imageLoader"); - info.addMember(m_form, "form"); -} - } diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.h b/third_party/WebKit/Source/core/html/HTMLImageElement.h index 590029b..c4f9e31 100644 --- a/third_party/WebKit/Source/core/html/HTMLImageElement.h +++ b/third_party/WebKit/Source/core/html/HTMLImageElement.h @@ -76,8 +76,6 @@ public: virtual bool canContainRangeEndPoint() const { return false; } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - protected: HTMLImageElement(const QualifiedName&, Document*, HTMLFormElement* = 0); diff --git a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp index 23d0b8b..245d2ac 100644 --- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp @@ -1896,17 +1896,6 @@ bool HTMLInputElement::setupDateTimeChooserParameters(DateTimeChooserParameters& return true; } -void HTMLInputElement::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - HTMLTextFormControlElement::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_name, "name"); - info.addMember(m_valueIfDirty, "valueIfDirty"); - info.addMember(m_suggestedValue, "suggestedValue"); - info.addMember(m_inputType, "inputType"); - info.addMember(m_listAttributeTargetObserver, "listAttributeTargetObserver"); -} - bool HTMLInputElement::supportsInputModeAttribute() const { return m_inputType->supportsInputModeAttribute(); diff --git a/third_party/WebKit/Source/core/html/HTMLInputElement.h b/third_party/WebKit/Source/core/html/HTMLInputElement.h index e790c4b..b45046d 100644 --- a/third_party/WebKit/Source/core/html/HTMLInputElement.h +++ b/third_party/WebKit/Source/core/html/HTMLInputElement.h @@ -289,7 +289,6 @@ public: HTMLImageLoader* imageLoader(); bool setupDateTimeChooserParameters(DateTimeChooserParameters&); - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; bool supportsInputModeAttribute() const; diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp index 378f218..41cbee8 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp @@ -39,7 +39,6 @@ #include "core/dom/ExceptionCodePlaceholder.h" #include "core/dom/FullscreenController.h" #include "core/dom/NodeRenderingContext.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/dom/shadow/ShadowRoot.h" #include "core/html/HTMLMediaSource.h" #include "core/html/HTMLSourceElement.h" @@ -73,7 +72,6 @@ #include "weborigin/SecurityOrigin.h" #include "wtf/CurrentTime.h" #include "wtf/MathExtras.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/NonCopyingSort.h" #include "wtf/Uint8Array.h" #include "wtf/text/CString.h" @@ -3958,33 +3956,4 @@ void HTMLMediaElement::mediaPlayerScheduleLayerUpdate() scheduleLayerUpdate(); } -void HTMLMediaElement::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - HTMLElement::reportMemoryUsage(memoryObjectInfo); - ActiveDOMObject::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_loadTimer, "loadTimer"); - info.addMember(m_progressEventTimer, "progressEventTimer"); - info.addMember(m_playbackProgressTimer, "playbackProgressTimer"); - info.addMember(m_playedTimeRanges, "playedTimeRanges"); - info.addMember(m_asyncEventQueue, "asyncEventQueue"); - info.addMember(m_currentSrc, "currentSrc"); - info.addMember(m_error, "error"); - info.addMember(m_currentSourceNode, "currentSourceNode"); - info.addMember(m_nextChildNodeToConsider, "nextChildNodeToConsider"); - info.addMember(m_player, "player"); - info.addMember(m_mediaSource, "mediaSource"); - info.addMember(m_textTracks, "textTracks"); - info.addMember(m_textTracksWhenResourceSelectionBegan, "textTracksWhenResourceSelectionBegan"); - info.addMember(m_cueTree, "cueTree"); - info.addMember(m_currentlyActiveCues, "currentlyActiveCues"); - info.addMember(m_mediaGroup, "mediaGroup"); - info.addMember(m_mediaController, "mediaController"); - -#if ENABLE(WEB_AUDIO) - info.addMember(m_audioSourceNode, "audioSourceNode"); -#endif - -} - } diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.h b/third_party/WebKit/Source/core/html/HTMLMediaElement.h index 1f7819e..a9c707e 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.h +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.h @@ -285,8 +285,6 @@ public: virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - protected: HTMLMediaElement(const QualifiedName&, Document*, bool); virtual ~HTMLMediaElement(); diff --git a/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp b/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp index 7d1ce1b..5d12522 100644 --- a/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp @@ -670,11 +670,4 @@ String HTMLTextFormControlElement::directionForFormData() const return "ltr"; } -void HTMLTextFormControlElement::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - HTMLFormControlElementWithState::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_textAsOfLastFormControlChangeEvent, "textAsOfLastFormControlChangeEvent"); -} - } // namespace Webcore diff --git a/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.h b/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.h index 09007ea..79f60a8 100644 --- a/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.h +++ b/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.h @@ -88,8 +88,6 @@ public: void setTextAsOfLastFormControlChangeEvent(const String& text) { m_textAsOfLastFormControlChangeEvent = text; } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - protected: HTMLTextFormControlElement(const QualifiedName&, Document*, HTMLFormElement*); bool isPlaceholderEmpty() const; diff --git a/third_party/WebKit/Source/core/html/parser/HTMLToken.h b/third_party/WebKit/Source/core/html/parser/HTMLToken.h index 7b91fb5..a15b6a9 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLToken.h +++ b/third_party/WebKit/Source/core/html/parser/HTMLToken.h @@ -28,6 +28,7 @@ #include "core/dom/Attribute.h" #include "core/html/parser/HTMLToken.h" +#include "wtf/PassOwnPtr.h" #include "wtf/RefCounted.h" #include "wtf/RefPtr.h" diff --git a/third_party/WebKit/Source/core/html/shadow/DateTimeNumericFieldElement.h b/third_party/WebKit/Source/core/html/shadow/DateTimeNumericFieldElement.h index 80390ee..220efed 100644 --- a/third_party/WebKit/Source/core/html/shadow/DateTimeNumericFieldElement.h +++ b/third_party/WebKit/Source/core/html/shadow/DateTimeNumericFieldElement.h @@ -29,6 +29,9 @@ #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) #include "core/html/shadow/DateTimeFieldElement.h" +#include "wtf/text/StringBuilder.h" +#include "wtf/text/WTFString.h" + namespace WebCore { // DateTimeNumericFieldElement represents numeric field of date time format, diff --git a/third_party/WebKit/Source/core/inspector/HeapGraphSerializer.cpp b/third_party/WebKit/Source/core/inspector/HeapGraphSerializer.cpp deleted file mode 100644 index f159e05..0000000 --- a/third_party/WebKit/Source/core/inspector/HeapGraphSerializer.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" - - -#include "core/inspector/HeapGraphSerializer.h" - -#include "core/dom/WebCoreMemoryInstrumentation.h" -#include "core/inspector/JSONParser.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationVector.h" -#include "wtf/MemoryObjectInfo.h" -#include "wtf/text/WTFString.h" - -namespace WebCore { - -HeapGraphSerializer::HeapGraphSerializer(Client* client) - : m_client(client) - , m_strings(Strings::create()) - , m_edges(Edges::create()) - , m_nodeEdgesCount(0) - , m_nodes(Nodes::create()) - , m_baseToRealNodeIdMap(BaseToRealNodeIdMap::create()) - , m_typeStrings(JSONObject::create()) - , m_leafCount(0) -{ - ASSERT(m_client); - m_strings->addItem(String()); // An empty string with 0 index. - - memset(m_edgeTypes, 0, sizeof(m_edgeTypes)); - - m_edgeTypes[WTF::PointerMember] = registerTypeString("weak"); - m_edgeTypes[WTF::RetainingPointer] = registerTypeString("property"); - - // FIXME: It is used as a magic constant for 'object' node type. - registerTypeString("object"); - - m_unknownClassNameId = registerString("unknown"); -} - -HeapGraphSerializer::~HeapGraphSerializer() -{ -} - -void HeapGraphSerializer::pushUpdateIfNeeded() -{ - static const size_t chunkSize = 10000; - static const size_t averageEdgesPerNode = 5; - - if (m_strings->length() <= chunkSize - && m_nodes->length() <= chunkSize * s_nodeFieldsCount - && m_edges->length() <= chunkSize * averageEdgesPerNode * s_edgeFieldsCount - && m_baseToRealNodeIdMap->length() <= chunkSize * s_idMapEntryFieldCount) - return; - - pushUpdate(); -} - -void HeapGraphSerializer::pushUpdate() -{ - typedef TypeBuilder::Memory::HeapSnapshotChunk HeapSnapshotChunk; - - RefPtr<HeapSnapshotChunk> chunk = HeapSnapshotChunk::create() - .setStrings(m_strings.release()) - .setNodes(m_nodes.release()) - .setEdges(m_edges.release()) - .setBaseToRealNodeId(m_baseToRealNodeIdMap.release()); - - m_client->addNativeSnapshotChunk(chunk.release()); - - m_strings = Strings::create(); - m_edges = Edges::create(); - m_nodes = Nodes::create(); - m_baseToRealNodeIdMap = BaseToRealNodeIdMap::create(); -} - -void HeapGraphSerializer::reportNode(const WTF::MemoryObjectInfo& info) -{ - ASSERT(info.reportedPointer()); - reportNodeImpl(info, m_nodeEdgesCount); - m_nodeEdgesCount = 0; - if (info.isRoot()) - m_roots.append(info.reportedPointer()); - pushUpdateIfNeeded(); -} - -int HeapGraphSerializer::reportNodeImpl(const WTF::MemoryObjectInfo& info, int edgesCount) -{ - int nodeId = toNodeId(info.reportedPointer()); - int classNameId = info.classNameId(); - m_nodes->addItem(classNameId ? classNameId : m_unknownClassNameId); - m_nodes->addItem(info.nameId()); - m_nodes->addItem(nodeId); - m_nodes->addItem(info.objectSize()); - m_nodes->addItem(edgesCount); - - return nodeId; -} - -void HeapGraphSerializer::reportEdge(const void* to, const char* name, WTF::MemberType memberType) -{ - ASSERT(to); - reportEdgeImpl(toNodeId(to), name, m_edgeTypes[memberType]); - pushUpdateIfNeeded(); -} - -void HeapGraphSerializer::reportEdgeImpl(const int toNodeId, const char* name, int memberType) -{ - ASSERT(memberType >= 0); - ASSERT(memberType < WTF::LastMemberTypeEntry); - - m_edges->addItem(memberType); - m_edges->addItem(registerString(name)); - m_edges->addItem(toNodeId); - - ++m_nodeEdgesCount; -} - -void HeapGraphSerializer::reportLeaf(const WTF::MemoryObjectInfo& info, const char* edgeName) -{ - int nodeId = reportNodeImpl(info, 0); - reportEdgeImpl(nodeId, edgeName, m_edgeTypes[WTF::RetainingPointer]); - pushUpdateIfNeeded(); -} - -void HeapGraphSerializer::reportBaseAddress(const void* base, const void* real) -{ - m_baseToRealNodeIdMap->addItem(toNodeId(base)); - m_baseToRealNodeIdMap->addItem(toNodeId(real)); -} - -PassRefPtr<JSONObject> HeapGraphSerializer::finish() -{ - addRootNode(); - pushUpdate(); - String metaString = - "{" - "\"node_fields\":[" - "\"type\"," - "\"name\"," - "\"id\"," - "\"self_size\"," - "\"edge_count\"" - "]," - "\"node_types\":[" - "[]," // FIXME: It is a fallback for Heap Snapshot parser. In case of Native Heap Snapshot it is a plain string id. - "\"string\"," - "\"number\"," - "\"number\"," - "\"number\"" - "]," - "\"edge_fields\":[" - "\"type\"," - "\"name_or_index\"," - "\"to_node\"" - "]," - "\"edge_types\":[" - "[]," - "\"string_or_number\"," - "\"node\"" - "]" - "}"; - - RefPtr<JSONValue> metaValue = parseJSON(metaString); - RefPtr<JSONObject> meta; - metaValue->asObject(&meta); - ASSERT(meta); - meta->setObject("type_strings", m_typeStrings); - return meta.release(); -} - -void HeapGraphSerializer::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Inspector); - info.ignoreMember(m_stringToIndex); - info.ignoreMember(m_strings); - info.ignoreMember(m_edges); - info.ignoreMember(m_nodes); - info.ignoreMember(m_baseToRealNodeIdMap); - info.ignoreMember(m_roots); -} - -int HeapGraphSerializer::registerString(const char* string) -{ - if (!string) - return 0; - int length = strlen(string); - if (length > 256) - length = 256; - StringMap::AddResult result = m_stringToIndex.add(String(string, length), m_stringToIndex.size() + 1); - if (result.isNewEntry) - m_strings->addItem(string); - return result.iterator->value; -} - -int HeapGraphSerializer::registerTypeString(const char* string) -{ - int stringId = registerString(string); - m_typeStrings->setNumber(string, stringId); - return stringId; -} - -int HeapGraphSerializer::toNodeId(const void* to) -{ - if (!to) - return s_firstNodeId + m_address2NodeIdMap.size() + m_leafCount++; - - Address2NodeId::AddResult result = m_address2NodeIdMap.add(to, s_firstNodeId + m_leafCount + m_address2NodeIdMap.size()); - return result.iterator->value; -} - -void HeapGraphSerializer::addRootNode() -{ - for (size_t i = 0; i < m_roots.size(); i++) - reportEdgeImpl(toNodeId(m_roots[i]), 0, m_edgeTypes[WTF::PointerMember]); - - m_nodes->addItem(registerString("Root")); - m_nodes->addItem(0); - m_nodes->addItem(s_firstNodeId + m_address2NodeIdMap.size() + m_leafCount); - m_nodes->addItem(0); - m_nodes->addItem(m_roots.size()); -} - -} // namespace WebCore - diff --git a/third_party/WebKit/Source/core/inspector/HeapGraphSerializer.h b/third_party/WebKit/Source/core/inspector/HeapGraphSerializer.h deleted file mode 100644 index 862dbfd..0000000 --- a/third_party/WebKit/Source/core/inspector/HeapGraphSerializer.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef HeapGraphSerializer_h -#define HeapGraphSerializer_h - -#include "InspectorFrontend.h" -#include "wtf/Forward.h" -#include "wtf/HashMap.h" -#include "wtf/MemoryInstrumentation.h" -#include "wtf/Noncopyable.h" -#include "wtf/Vector.h" -#include "wtf/text/StringHash.h" - -namespace WebCore { - -class HeapGraphSerializer { - WTF_MAKE_NONCOPYABLE(HeapGraphSerializer); -public: - - class Client { - public: - virtual ~Client() { } - virtual void addNativeSnapshotChunk(PassRefPtr<TypeBuilder::Memory::HeapSnapshotChunk>) = 0; - }; - - explicit HeapGraphSerializer(Client*); - ~HeapGraphSerializer(); - void reportNode(const WTF::MemoryObjectInfo&); - void reportEdge(const void*, const char*, WTF::MemberType); - void reportLeaf(const WTF::MemoryObjectInfo&, const char*); - void reportBaseAddress(const void*, const void*); - int registerString(const char*); - - PassRefPtr<JSONObject> finish(); - - void reportMemoryUsage(MemoryObjectInfo*) const; - -private: - void pushUpdateIfNeeded(); - void pushUpdate(); - - int toNodeId(const void*); - - void addRootNode(); - int registerTypeString(const char*); - - void reportEdgeImpl(const int toNodeId, const char* name, int memberType); - int reportNodeImpl(const WTF::MemoryObjectInfo&, int edgesCount); - - Client* m_client; - - typedef HashMap<String, int> StringMap; - StringMap m_stringToIndex; - typedef TypeBuilder::Array<String> Strings; - RefPtr<Strings> m_strings; - - typedef TypeBuilder::Array<int> Edges; - RefPtr<Edges> m_edges; - int m_nodeEdgesCount; - static const size_t s_edgeFieldsCount = 3; - - typedef TypeBuilder::Array<int> Nodes; - RefPtr<Nodes> m_nodes; - static const size_t s_nodeFieldsCount = 5; - - typedef TypeBuilder::Array<int> BaseToRealNodeIdMap; - RefPtr<BaseToRealNodeIdMap> m_baseToRealNodeIdMap; - static const size_t s_idMapEntryFieldCount = 2; - - typedef HashMap<const void*, int> Address2NodeId; - Address2NodeId m_address2NodeIdMap; - - Vector<const void*> m_roots; - RefPtr<JSONObject> m_typeStrings; - - size_t m_edgeTypes[WTF::LastMemberTypeEntry]; - int m_unknownClassNameId; - int m_leafCount; - - static const int s_firstNodeId = 1; -}; - -} // namespace WebCore - -#endif // !defined(HeapGraphSerializer_h) diff --git a/third_party/WebKit/Source/core/inspector/InspectorAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorAgent.cpp index e6933cb..faedf80 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorAgent.cpp @@ -45,6 +45,7 @@ #include "core/page/Page.h" #include "core/platform/JSONValues.h" #include "weborigin/SecurityOrigin.h" +#include "wtf/text/StringBuilder.h" using namespace std; diff --git a/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.cpp index c999790..dd63adb 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.cpp @@ -31,9 +31,8 @@ #include "config.h" #include "core/inspector/InspectorBaseAgent.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/inspector/InspectorState.h" -#include "wtf/MemoryInstrumentationVector.h" +#include "wtf/PassOwnPtr.h" namespace WebCore { @@ -48,14 +47,6 @@ InspectorBaseAgentInterface::~InspectorBaseAgentInterface() { } -void InspectorBaseAgentInterface::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Inspector); - info.addMember(m_name, "name"); - info.addWeakPointer(m_instrumentingAgents); - info.addWeakPointer(m_state); -} - void InspectorAgentRegistry::append(PassOwnPtr<InspectorBaseAgentInterface> agent) { m_agents.append(agent); @@ -91,11 +82,5 @@ void InspectorAgentRegistry::discardAgents() m_agents[i]->discardAgent(); } -void InspectorAgentRegistry::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Inspector); - info.addMember(&m_agents, "agents"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h b/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h index c88ac92..0369e09 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h @@ -56,8 +56,6 @@ public: String name() { return m_name; } - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - protected: InstrumentingAgents* m_instrumentingAgents; InspectorState* m_state; @@ -76,8 +74,6 @@ public: void registerInDispatcher(InspectorBackendDispatcher*); void discardAgents(); - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - private: Vector<OwnPtr<InspectorBaseAgentInterface> > m_agents; }; diff --git a/third_party/WebKit/Source/core/inspector/InspectorController.cpp b/third_party/WebKit/Source/core/inspector/InspectorController.cpp index d5def10..f25334c 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorController.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorController.cpp @@ -34,7 +34,6 @@ #include "InspectorBackendDispatcher.h" #include "InspectorFrontend.h" #include "bindings/v8/DOMWrapperWorld.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/inspector/IdentifiersFactory.h" #include "core/inspector/InjectedScriptHost.h" #include "core/inspector/InjectedScriptManager.h" @@ -70,7 +69,6 @@ #include "core/inspector/PageRuntimeAgent.h" #include "core/page/Page.h" #include "core/platform/PlatformMouseEvent.h" -#include "wtf/MemoryInstrumentationVector.h" namespace WebCore { @@ -364,22 +362,6 @@ void InspectorController::setResourcesDataSizeLimitsFromInternals(int maximumRes resourceAgent->setResourcesDataSizeLimitsFromInternals(maximumResourcesContentSize, maximumSingleResourceContentSize); } -void InspectorController::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorController); - info.addMember(m_instrumentingAgents, "instrumentingAgents"); - info.addMember(m_injectedScriptManager, "injectedScriptManager"); - info.addMember(m_state, "state"); - info.addMember(m_overlay, "overlay"); - - info.addMember(m_inspectorBackendDispatcher, "inspectorBackendDispatcher"); - info.addMember(m_inspectorFrontendClient, "inspectorFrontendClient"); - info.addMember(m_inspectorFrontend, "inspectorFrontend"); - info.addMember(m_page, "page"); - info.addWeakPointer(m_inspectorClient); - info.addMember(m_agents, "agents"); -} - void InspectorController::willProcessTask() { if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspectorTimelineAgent()) @@ -424,11 +406,4 @@ void InspectorController::didComposite() timelineAgent->didComposite(); } -HashMap<String, size_t> InspectorController::processMemoryDistribution() const -{ - HashMap<String, size_t> memoryInfo; - m_memoryAgent->getProcessMemoryDistributionMap(&memoryInfo); - return memoryInfo; -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/inspector/InspectorController.h b/third_party/WebKit/Source/core/inspector/InspectorController.h index ae84e37..42f224a 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorController.h +++ b/third_party/WebKit/Source/core/inspector/InspectorController.h @@ -106,8 +106,6 @@ public: InspectorClient* inspectorClient() const { return m_inspectorClient; } - void reportMemoryUsage(MemoryObjectInfo*) const; - void willProcessTask(); void didProcessTask(); @@ -116,8 +114,6 @@ public: void willComposite(); void didComposite(); - HashMap<String, size_t> processMemoryDistribution() const; - private: InspectorController(Page*, InspectorClient*); diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMStorageAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMStorageAgent.cpp index 2fae759..8656ada 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMStorageAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMStorageAgent.cpp @@ -34,7 +34,6 @@ #include "core/dom/DOMException.h" #include "core/dom/Document.h" #include "core/dom/ExceptionCode.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/inspector/InspectorPageAgent.h" #include "core/inspector/InspectorState.h" #include "core/inspector/InstrumentingAgents.h" @@ -47,7 +46,6 @@ #include "core/storage/StorageArea.h" #include "core/storage/StorageNamespace.h" #include "weborigin/SecurityOrigin.h" -#include "wtf/MemoryInstrumentationHashMap.h" namespace WebCore { @@ -230,12 +228,5 @@ PassOwnPtr<StorageArea> InspectorDOMStorageAgent::findStorageArea(ErrorString* e return m_pageAgent->page()->sessionStorage()->storageArea(frame->document()->securityOrigin()); } -void InspectorDOMStorageAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorDOMStorageAgent); - InspectorBaseAgent<InspectorDOMStorageAgent>::reportMemoryUsage(memoryObjectInfo); - info.addWeakPointer(m_frontend); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMStorageAgent.h b/third_party/WebKit/Source/core/inspector/InspectorDOMStorageAgent.h index ba2fb1c..5a9a872 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMStorageAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMStorageAgent.h @@ -73,8 +73,6 @@ public: // Called from InspectorInstrumentation void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*); - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: InspectorDOMStorageAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorCompositeState*); diff --git a/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.cpp index 3b63ded..16ae1ee 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.cpp @@ -45,8 +45,6 @@ #include "core/loader/cache/CachedResource.h" #include "core/platform/JSONValues.h" #include "core/platform/text/RegularExpression.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/text/WTFString.h" using WebCore::TypeBuilder::Array; @@ -887,29 +885,6 @@ void InspectorDebuggerAgent::clearBreakDetails() m_breakAuxData = 0; } -void InspectorDebuggerAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorDebuggerAgent); - InspectorBaseAgent<InspectorDebuggerAgent>::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_injectedScriptManager, "injectedScriptManager"); - info.addWeakPointer(m_frontend); - info.addMember(m_pausedScriptState, "pausedScriptState"); - info.addMember(m_currentCallStack, "currentCallStack"); - info.addMember(m_scripts, "scripts"); - info.addMember(m_breakpointIdToDebugServerBreakpointIds, "breakpointIdToDebugServerBreakpointIds"); - info.addMember(m_continueToLocationBreakpointId, "continueToLocationBreakpointId"); - info.addMember(m_breakAuxData, "breakAuxData"); - info.addWeakPointer(m_listener); -} - -void ScriptDebugListener::Script::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorDebuggerAgent); - info.addMember(url, "url"); - info.addMember(source, "source"); - info.addMember(sourceMappingURL, "sourceMappingURL"); -} - void InspectorDebuggerAgent::setBreakpoint(const String& scriptId, int lineNumber, int columnNumber, BreakpointSource source, const String& condition) { String breakpointId = generateBreakpointId(scriptId, lineNumber, columnNumber, source); diff --git a/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.h b/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.h index 082d040..c3f5159b 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.h @@ -137,8 +137,6 @@ public: virtual ScriptDebugServer& scriptDebugServer() = 0; - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - void setBreakpoint(const String& scriptId, int lineNumber, int columnNumber, BreakpointSource, const String& condition = String()); void removeBreakpoint(const String& scriptId, int lineNumber, int columnNumber, BreakpointSource); diff --git a/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.cpp index 4418eaf..d85ed88 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.cpp @@ -32,13 +32,11 @@ #include "core/inspector/InspectorHeapProfilerAgent.h" #include "bindings/v8/ScriptProfiler.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/inspector/InjectedScript.h" #include "core/inspector/InjectedScriptHost.h" #include "core/inspector/InspectorState.h" #include "core/platform/Timer.h" #include "wtf/CurrentTime.h" -#include "wtf/MemoryInstrumentationHashMap.h" namespace WebCore { @@ -316,14 +314,5 @@ void InspectorHeapProfilerAgent::getHeapObjectId(ErrorString* errorString, const *heapSnapshotObjectId = String::number(id); } -void InspectorHeapProfilerAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorProfilerAgent); - InspectorBaseAgent<InspectorHeapProfilerAgent>::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_injectedScriptManager, "injectedScriptManager"); - info.addWeakPointer(m_frontend); - info.addMember(m_snapshots, "snapshots"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.h b/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.h index b613a23..9a522e1 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.h @@ -74,9 +74,6 @@ public: virtual void getObjectByHeapObjectId(ErrorString*, const String& heapSnapshotObjectId, const String* objectGroup, RefPtr<TypeBuilder::Runtime::RemoteObject>& result); virtual void getHeapObjectId(ErrorString*, const String& objectId, String* heapSnapshotObjectId); - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - - private: class HeapStatsStream; class HeapStatsUpdateTask; diff --git a/third_party/WebKit/Source/core/inspector/InspectorMemoryAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorMemoryAgent.cpp index 7c576db..b89cee7 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorMemoryAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorMemoryAgent.cpp @@ -37,17 +37,13 @@ #include "core/dom/Document.h" #include "core/dom/Node.h" #include "core/inspector/BindingVisitors.h" -#include "core/inspector/HeapGraphSerializer.h" #include "core/inspector/InspectorClient.h" #include "core/inspector/InspectorDOMStorageAgent.h" -#include "core/inspector/MemoryInstrumentationImpl.h" #include "core/loader/cache/MemoryCache.h" #include "core/page/Frame.h" #include "core/page/Page.h" #include "core/platform/JSONValues.h" -#include "core/platform/MemoryUsageSupport.h" #include "wtf/ArrayBufferView.h" -#include "wtf/MemoryInstrumentationArrayBufferView.h" #include "wtf/NonCopyingSort.h" #include "wtf/OwnPtr.h" #include "wtf/PassOwnPtr.h" @@ -55,130 +51,8 @@ #include "wtf/text/StringImpl.h" #include "wtf/text/WTFString.h" -// Use a type alias instead of 'using' here which would cause a conflict on Mac. -typedef WebCore::TypeBuilder::Memory::MemoryBlock InspectorMemoryBlock; -typedef WebCore::TypeBuilder::Array<InspectorMemoryBlock> InspectorMemoryBlocks; - namespace WebCore { -namespace { - -class MemoryUsageStatsGenerator { -public: - MemoryUsageStatsGenerator() { } - - void dump(const TypeNameToSizeMap& sizesMap, InspectorMemoryBlocks* children) - { - m_sizesMap = sizesMap; - - // FIXME: We filter out Rendering type because the coverage is not good enough at the moment - // and report RenderArena size instead. - for (TypeNameToSizeMap::iterator i = m_sizesMap.begin(); i != m_sizesMap.end(); ++i) { - if (i->key == PlatformMemoryTypes::Rendering) { - m_sizesMap.remove(i); - break; - } - } - Vector<String> objectTypes; - objectTypes.appendRange(m_sizesMap.keys().begin(), m_sizesMap.keys().end()); - - for (Vector<String>::const_iterator i = objectTypes.begin(); i != objectTypes.end(); ++i) - updateParentSizes(*i, m_sizesMap.get(*i)); - - objectTypes.clear(); - objectTypes.appendRange(m_sizesMap.keys().begin(), m_sizesMap.keys().end()); - nonCopyingSort(objectTypes.begin(), objectTypes.end(), stringCompare); - - size_t index = 0; - while (index < objectTypes.size()) - index = buildObjectForIndex(index, objectTypes, children); - - } - -private: - static bool stringCompare(const String& a, const String& b) { return WTF::codePointCompare(a, b) < 0; } - - void updateParentSizes(String objectType, const size_t size) - { - for (size_t dotPosition = objectType.reverseFind('.'); dotPosition != notFound; dotPosition = objectType.reverseFind('.', dotPosition)) { - objectType = objectType.substring(0, dotPosition); - TypeNameToSizeMap::AddResult result = m_sizesMap.add(objectType, size); - if (!result.isNewEntry) - result.iterator->value += size; - } - } - - size_t buildObjectForIndex(size_t index, const Vector<String>& objectTypes, InspectorMemoryBlocks* array) - { - String typeName = objectTypes[index]; - size_t dotPosition = typeName.reverseFind('.'); - String blockName = (dotPosition == notFound) ? typeName : typeName.substring(dotPosition + 1); - RefPtr<InspectorMemoryBlock> block = InspectorMemoryBlock::create().setName(blockName); - block->setSize(m_sizesMap.get(typeName)); - String prefix = typeName; - prefix.append('.'); - array->addItem(block); - ++index; - RefPtr<InspectorMemoryBlocks> children; - while (index < objectTypes.size() && objectTypes[index].startsWith(prefix)) { - if (!children) - children = InspectorMemoryBlocks::create(); - index = buildObjectForIndex(index, objectTypes, children.get()); - } - if (children) - block->setChildren(children.release()); - return index; - } - - TypeNameToSizeMap m_sizesMap; -}; - -class ExternalStringsRoot : public ExternalStringVisitor { -public: - ExternalStringsRoot() : m_memoryClassInfo(0) { } - - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::ExternalStrings); - m_memoryClassInfo = &info; - ScriptProfiler::visitExternalStrings(const_cast<ExternalStringsRoot*>(this)); - m_memoryClassInfo = 0; - info.ignoreMember(m_memoryClassInfo); - } - -private: - virtual void visitJSExternalString(StringImpl* string) - { - m_memoryClassInfo->addMember(string, "externalString", WTF::RetainingPointer); - } - - mutable MemoryClassInfo* m_memoryClassInfo; -}; - -class ExternalArraysRoot : public ExternalArrayVisitor { -public: - ExternalArraysRoot() : m_memoryClassInfo(0) { } - - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::ExternalArrays); - m_memoryClassInfo = &info; - ScriptProfiler::visitExternalArrays(const_cast<ExternalArraysRoot*>(this)); - m_memoryClassInfo = 0; - info.ignoreMember(m_memoryClassInfo); - } - -private: - virtual void visitJSExternalArray(ArrayBufferView* arrayBufferView) - { - m_memoryClassInfo->addMember(arrayBufferView, "externalArray", WTF::RetainingPointer); - } - - mutable MemoryClassInfo* m_memoryClassInfo; -}; - -} // namespace - InspectorMemoryAgent::~InspectorMemoryAgent() { } @@ -190,192 +64,6 @@ void InspectorMemoryAgent::getDOMCounters(ErrorString*, int* documents, int* nod *jsEventListeners = ThreadLocalInspectorCounters::current().counterValue(ThreadLocalInspectorCounters::JSEventListenerCounter); } -static void reportJSHeapInfo(WTF::MemoryInstrumentationClient& memoryInstrumentationClient) -{ - HeapInfo info; - ScriptGCEvent::getHeapSize(info); - - memoryInstrumentationClient.countObjectSize(0, WebCoreMemoryTypes::JSHeapUsed, info.usedJSHeapSize); - memoryInstrumentationClient.countObjectSize(0, WebCoreMemoryTypes::JSHeapUnused, info.totalJSHeapSize - info.usedJSHeapSize); -} - -static void reportRenderTreeInfo(WTF::MemoryInstrumentationClient& memoryInstrumentationClient, Page* page) -{ - ArenaSize arenaSize = page->renderTreeSize(); - - memoryInstrumentationClient.countObjectSize(0, WebCoreMemoryTypes::RenderTreeUsed, arenaSize.treeSize); - memoryInstrumentationClient.countObjectSize(0, WebCoreMemoryTypes::RenderTreeUnused, arenaSize.allocated - arenaSize.treeSize); -} - -namespace { - -class DOMTreesIterator : public WrappedNodeVisitor { -public: - DOMTreesIterator(MemoryInstrumentationImpl& memoryInstrumentation, Page* page) - : m_page(page) - , m_memoryInstrumentation(memoryInstrumentation) - { - } - - virtual void visitNode(Node* node) OVERRIDE - { - if (node->document() && node->document()->frame() && m_page != node->document()->frame()->page()) - return; - - while (Node* parentNode = node->parentNode()) - node = parentNode; - - m_memoryInstrumentation.addRootObject(node); - } - - void visitFrame(Frame* frame) - { - m_memoryInstrumentation.addRootObject(frame); - } - - void visitBindings() - { - ScriptProfiler::collectBindingMemoryInfo(&m_memoryInstrumentation); - } - - void visitMemoryCache() - { - m_memoryInstrumentation.addRootObject(memoryCache()); - } - - -private: - Page* m_page; - MemoryInstrumentationImpl& m_memoryInstrumentation; -}; - -} - -static void collectDomTreeInfo(MemoryInstrumentationImpl& memoryInstrumentation, Page* page) -{ - ExternalStringsRoot stringsRoot; - memoryInstrumentation.addRootObject(stringsRoot); - - ExternalArraysRoot arraysRoot; - memoryInstrumentation.addRootObject(arraysRoot); - - DOMTreesIterator domTreesIterator(memoryInstrumentation, page); - - ScriptProfiler::visitNodeWrappers(&domTreesIterator); - - // Make sure all documents reachable from the main frame are accounted. - for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) { - if (Document* doc = frame->document()) { - domTreesIterator.visitNode(doc); - domTreesIterator.visitFrame(frame); - } - } - - domTreesIterator.visitBindings(); - domTreesIterator.visitMemoryCache(); -} - -static void addPlatformComponentsInfo(TypeNameToSizeMap* memoryInfo) -{ - Vector<MemoryUsageSupport::ComponentInfo> components; - MemoryUsageSupport::memoryUsageByComponents(components); - for (Vector<MemoryUsageSupport::ComponentInfo>::iterator it = components.begin(); it != components.end(); ++it) - memoryInfo->add(it->m_name, it->m_sizeInBytes); -} - -static void addMemoryInstrumentationDebugData(MemoryInstrumentationClientImpl* client, TypeNameToSizeMap* memoryInfo) -{ - if (client->checkInstrumentedObjects()) { - memoryInfo->add("InstrumentedObjectsCount", client->totalCountedObjects()); - memoryInfo->add("InstrumentedButNotAllocatedObjectsCount", client->totalObjectsNotInAllocatedSet()); - } -} - -void InspectorMemoryAgent::getProcessMemoryDistributionMap(TypeNameToSizeMap* memoryInfo) -{ - getProcessMemoryDistributionImpl(false, memoryInfo); -} - -void InspectorMemoryAgent::getProcessMemoryDistribution(ErrorString*, const bool* reportGraph, RefPtr<InspectorMemoryBlock>& processMemory, RefPtr<JSONObject>& graphMetaInformation) -{ - TypeNameToSizeMap memoryInfo; - graphMetaInformation = getProcessMemoryDistributionImpl(reportGraph && *reportGraph, &memoryInfo); - - MemoryUsageStatsGenerator statsGenerator; - RefPtr<InspectorMemoryBlocks> children = InspectorMemoryBlocks::create(); - statsGenerator.dump(memoryInfo, children.get()); - - processMemory = InspectorMemoryBlock::create().setName(WebCoreMemoryTypes::ProcessPrivateMemory); - processMemory->setChildren(children); - - size_t privateBytes = 0; - size_t sharedBytes = 0; - MemoryUsageSupport::processMemorySizesInBytes(&privateBytes, &sharedBytes); - processMemory->setSize(privateBytes); -} - -void InspectorMemoryAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Inspector); - InspectorBaseAgent<InspectorMemoryAgent>::reportMemoryUsage(memoryObjectInfo); - info.addWeakPointer(m_inspectorClient); - info.addMember(m_page, "page"); -} - -namespace { - -class FrontendWrapper : public HeapGraphSerializer::Client { -public: - explicit FrontendWrapper(InspectorFrontend::Memory* frontend) : m_frontend(frontend) { } - virtual void addNativeSnapshotChunk(PassRefPtr<TypeBuilder::Memory::HeapSnapshotChunk> heapSnapshotChunk) OVERRIDE - { - m_frontend->addNativeSnapshotChunk(heapSnapshotChunk); - } -private: - InspectorFrontend::Memory* m_frontend; -}; - -} - -PassRefPtr<JSONObject> InspectorMemoryAgent::getProcessMemoryDistributionImpl(bool reportGraph, TypeNameToSizeMap* memoryInfo) -{ - RefPtr<JSONObject> meta; - OwnPtr<HeapGraphSerializer> graphSerializer; - OwnPtr<FrontendWrapper> frontendWrapper; - - if (reportGraph) { - frontendWrapper = adoptPtr(new FrontendWrapper(m_frontend)); - graphSerializer = adoptPtr(new HeapGraphSerializer(frontendWrapper.get())); - } - - MemoryInstrumentationClientImpl memoryInstrumentationClient(graphSerializer.get()); - m_inspectorClient->getAllocatedObjects(memoryInstrumentationClient.allocatedObjects()); - MemoryInstrumentationImpl memoryInstrumentation(&memoryInstrumentationClient); - - reportJSHeapInfo(memoryInstrumentationClient); - reportRenderTreeInfo(memoryInstrumentationClient, m_page); - collectDomTreeInfo(memoryInstrumentation, m_page); // FIXME: collect for all pages? - - WebCoreMemoryInstrumentation::reportStaticMembersMemoryUsage(&memoryInstrumentation); - - memoryInstrumentation.addRootObject(this); - memoryInstrumentation.addRootObject(memoryInstrumentation); - memoryInstrumentation.addRootObject(memoryInstrumentationClient); - if (graphSerializer) { - memoryInstrumentation.addRootObject(graphSerializer.get()); - meta = graphSerializer->finish(); - graphSerializer.release(); // Release it earlier than frontendWrapper - frontendWrapper.release(); - } - - m_inspectorClient->dumpUncountedAllocatedObjects(memoryInstrumentationClient.countedObjects()); - - *memoryInfo = memoryInstrumentationClient.sizesMap(); - addPlatformComponentsInfo(memoryInfo); - addMemoryInstrumentationDebugData(&memoryInstrumentationClient, memoryInfo); - return meta.release(); -} - InspectorMemoryAgent::InspectorMemoryAgent(InstrumentingAgents* instrumentingAgents, InspectorClient* client, InspectorCompositeState* state, Page* page) : InspectorBaseAgent<InspectorMemoryAgent>("Memory", instrumentingAgents, state) , m_inspectorClient(client) diff --git a/third_party/WebKit/Source/core/inspector/InspectorMemoryAgent.h b/third_party/WebKit/Source/core/inspector/InspectorMemoryAgent.h index 5be09e0..19a7ee3 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorMemoryAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorMemoryAgent.h @@ -58,9 +58,6 @@ public: virtual ~InspectorMemoryAgent(); virtual void getDOMCounters(ErrorString*, int* documents, int* nodes, int* jsEventListeners); - virtual void getProcessMemoryDistribution(ErrorString*, const bool* reportGraph, RefPtr<TypeBuilder::Memory::MemoryBlock>& out_processMemory, RefPtr<JSONObject>& graphMetaInformation); - - virtual void reportMemoryUsage(MemoryObjectInfo*) const; void getProcessMemoryDistributionMap(HashMap<String, size_t>* memoryInfo); diff --git a/third_party/WebKit/Source/core/inspector/InspectorOverlay.cpp b/third_party/WebKit/Source/core/inspector/InspectorOverlay.cpp index 5964d555..d3c997a 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorOverlay.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorOverlay.cpp @@ -35,7 +35,6 @@ #include "bindings/v8/ScriptSourceCode.h" #include "core/dom/Element.h" #include "core/dom/Node.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/inspector/InspectorClient.h" #include "core/inspector/InspectorOverlayHost.h" #include "core/loader/DocumentLoader.h" @@ -659,20 +658,6 @@ void InspectorOverlay::onTimer(Timer<InspectorOverlay>*) update(); } -void InspectorOverlay::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorOverlay); - info.addMember(m_page, "page"); - info.addWeakPointer(m_client); - info.addMember(m_pausedInDebuggerMessage, "pausedInDebuggerMessage"); - info.addMember(m_highlightNode, "highlightNode"); - info.addMember(m_nodeHighlightConfig, "nodeHighlightConfig"); - info.addMember(m_highlightQuad, "highlightQuad"); - info.addMember(m_overlayPage, "overlayPage"); - info.addMember(m_quadHighlightConfig, "quadHighlightConfig"); - info.addMember(m_size, "size"); -} - void InspectorOverlay::freePage() { m_overlayPage.clear(); diff --git a/third_party/WebKit/Source/core/inspector/InspectorOverlay.h b/third_party/WebKit/Source/core/inspector/InspectorOverlay.h index ca1f411..b1e4ad0 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorOverlay.h +++ b/third_party/WebKit/Source/core/inspector/InspectorOverlay.h @@ -142,8 +142,6 @@ public: Node* highlightedNode() const; - void reportMemoryUsage(MemoryObjectInfo*) const; - void freePage(); InspectorOverlayHost* overlayHost() const { return m_overlayHost.get(); } diff --git a/third_party/WebKit/Source/core/inspector/InspectorProfilerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorProfilerAgent.cpp index dc2f7e6..4e1bdef 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorProfilerAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorProfilerAgent.cpp @@ -32,7 +32,6 @@ #include "InspectorFrontend.h" #include "bindings/v8/ScriptProfiler.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/inspector/ConsoleAPITypes.h" #include "core/inspector/InjectedScript.h" #include "core/inspector/InjectedScriptHost.h" @@ -43,7 +42,6 @@ #include "core/inspector/ScriptProfile.h" #include "core/page/ConsoleTypes.h" #include "wtf/CurrentTime.h" -#include "wtf/MemoryInstrumentationHashMap.h" #include "wtf/text/StringConcatenate.h" namespace WebCore { @@ -266,17 +264,6 @@ void InspectorProfilerAgent::toggleRecordButton(bool isProfiling) m_frontend->setRecordingProfile(isProfiling); } -void InspectorProfilerAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorProfilerAgent); - InspectorBaseAgent<InspectorProfilerAgent>::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_consoleAgent, "consoleAgent"); - info.addMember(m_injectedScriptManager, "injectedScriptManager"); - info.addWeakPointer(m_frontend); - info.addMember(m_profiles, "profiles"); - info.addMember(m_profileNameIdleTimeMap, "profileNameIdleTimeMap"); -} - void InspectorProfilerAgent::willProcessTask() { if (!m_profileNameIdleTimeMap || !m_profileNameIdleTimeMap->size()) diff --git a/third_party/WebKit/Source/core/inspector/InspectorProfilerAgent.h b/third_party/WebKit/Source/core/inspector/InspectorProfilerAgent.h index a04b432..03c6024 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorProfilerAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorProfilerAgent.h @@ -80,8 +80,6 @@ public: void toggleRecordButton(bool isProfiling); - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - void willProcessTask(); void didProcessTask(); diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp index e0459b4..68a55e4 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp @@ -66,7 +66,6 @@ #include "modules/websockets/WebSocketHandshakeResponse.h" #include "weborigin/KURL.h" #include "wtf/CurrentTime.h" -#include "wtf/MemoryInstrumentationHashMap.h" #include "wtf/RefPtr.h" typedef WebCore::InspectorBackendDispatcher::NetworkCommandHandler::LoadResourceForFrontendCallback LoadResourceForFrontendCallback; @@ -765,19 +764,6 @@ void InspectorResourceAgent::didCommitLoad(Frame* frame, DocumentLoader* loader) m_resourcesData->clear(m_pageAgent->loaderId(loader)); } -void InspectorResourceAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorResourceAgent); - InspectorBaseAgent<InspectorResourceAgent>::reportMemoryUsage(memoryObjectInfo); - info.addWeakPointer(m_pageAgent); - info.addWeakPointer(m_client); - info.addWeakPointer(m_frontend); - info.addMember(m_userAgentOverride, "userAgentOverride"); - info.addMember(m_resourcesData, "resourcesData"); - info.addMember(m_pendingXHRReplayData, "pendingXHRReplayData"); - info.addMember(m_styleRecalculationInitiator, "styleRecalculationInitiator"); -} - InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorClient* client, InspectorCompositeState* state, InspectorOverlay* overlay) : InspectorBaseAgent<InspectorResourceAgent>("Network", instrumentingAgents, state) , m_pageAgent(pageAgent) diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.h b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.h index ec3771a..f504ed6 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.h @@ -148,8 +148,6 @@ public: virtual void loadResourceForFrontend(ErrorString*, const String& frameId, const String& url, const RefPtr<JSONObject>* requestHeaders, PassRefPtr<LoadResourceForFrontendCallback>); - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: InspectorResourceAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorClient*, InspectorCompositeState*, InspectorOverlay*); diff --git a/third_party/WebKit/Source/core/inspector/InspectorTimelineAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorTimelineAgent.cpp index e8f6a3e..5996e685 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorTimelineAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorTimelineAgent.cpp @@ -645,7 +645,6 @@ void InspectorTimelineAgent::innerAddRecordToTimeline(PassRefPtr<JSONObject> prp RefPtr<TypeBuilder::Timeline::TimelineEvent> record = TypeBuilder::Timeline::TimelineEvent::runtimeCast(prpRecord); if (m_recordStack.isEmpty()) { - setNativeHeapStatistics(record.get()); sendEvent(record.release()); } else { setDOMCounters(record.get()); @@ -681,24 +680,6 @@ void InspectorTimelineAgent::setDOMCounters(TypeBuilder::Timeline::TimelineEvent } } -void InspectorTimelineAgent::setNativeHeapStatistics(TypeBuilder::Timeline::TimelineEvent* record) -{ - if (!m_memoryAgent) - return; - if (!m_state->getBoolean(TimelineAgentState::includeNativeMemoryStatistics)) - return; - HashMap<String, size_t> map; - m_memoryAgent->getProcessMemoryDistributionMap(&map); - RefPtr<JSONObject> stats = JSONObject::create(); - for (HashMap<String, size_t>::iterator it = map.begin(); it != map.end(); ++it) - stats->setNumber(it->key, it->value); - size_t privateBytes = 0; - size_t sharedBytes = 0; - MemoryUsageSupport::processMemorySizesInBytes(&privateBytes, &sharedBytes); - stats->setNumber("PrivateBytes", privateBytes); - record->setNativeHeapStatistics(stats.release()); -} - void InspectorTimelineAgent::setFrameIdentifier(JSONObject* record, Frame* frame) { if (!frame || !m_pageAgent) diff --git a/third_party/WebKit/Source/core/inspector/MemoryInstrumentationImpl.cpp b/third_party/WebKit/Source/core/inspector/MemoryInstrumentationImpl.cpp deleted file mode 100644 index 467d2f4..0000000 --- a/third_party/WebKit/Source/core/inspector/MemoryInstrumentationImpl.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "core/inspector/MemoryInstrumentationImpl.h" - -#include "core/dom/WebCoreMemoryInstrumentation.h" -#include "core/inspector/HeapGraphSerializer.h" -#include "wtf/Assertions.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationHashSet.h" -#include "wtf/MemoryInstrumentationVector.h" -#include "wtf/text/StringHash.h" - -namespace WebCore { - -TypeNameToSizeMap MemoryInstrumentationClientImpl::sizesMap() const -{ - // TypeToSizeMap uses const char* as the key. - // Thus it could happen that we have two different keys with equal string. - TypeNameToSizeMap sizesMap; - for (TypeToSizeMap::const_iterator i = m_totalSizes.begin(); i != m_totalSizes.end(); ++i) { - String objectType(i->key); - TypeNameToSizeMap::AddResult result = sizesMap.add(objectType, i->value); - if (!result.isNewEntry) - result.iterator->value += i->value; - } - - return sizesMap; -} - -void MemoryInstrumentationClientImpl::countObjectSize(const void* object, MemoryObjectType objectType, size_t size) -{ - ASSERT(objectType); - - TypeToSizeMap::AddResult result = m_totalSizes.add(objectType, size); - if (!result.isNewEntry) - result.iterator->value += size; - ++m_totalCountedObjects; - - if (!checkInstrumentedObjects()) - return; - - if (object) - m_countedObjects.add(object, size); -} - -bool MemoryInstrumentationClientImpl::visited(const void* object) -{ - return !m_visitedObjects.add(object).isNewEntry; -} - -bool MemoryInstrumentationClientImpl::checkCountedObject(const void* object) -{ - if (!checkInstrumentedObjects()) - return true; - if (!m_allocatedObjects.contains(object)) { - ++m_totalObjectsNotInAllocatedSet; - return false; - } - return true; -} - -void MemoryInstrumentationClientImpl::reportNode(const MemoryObjectInfo& node) -{ - if (m_graphSerializer) - m_graphSerializer->reportNode(node); -} - -void MemoryInstrumentationClientImpl::reportEdge(const void* target, const char* name, MemberType memberType) -{ - if (m_graphSerializer) - m_graphSerializer->reportEdge(target, name, memberType); -} - -void MemoryInstrumentationClientImpl::reportLeaf(const MemoryObjectInfo& target, const char* edgeName) -{ - if (m_graphSerializer) - m_graphSerializer->reportLeaf(target, edgeName); -} - -void MemoryInstrumentationClientImpl::reportBaseAddress(const void* base, const void* real) -{ - if (m_graphSerializer) - m_graphSerializer->reportBaseAddress(base, real); -} - -int MemoryInstrumentationClientImpl::registerString(const char* string) -{ - if (m_graphSerializer) - return m_graphSerializer->registerString(string); - return -1; -} - -void MemoryInstrumentationClientImpl::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorMemoryAgent); - info.addMember(m_totalSizes, "totalSizes"); - info.addMember(m_visitedObjects, "visitedObjects"); - info.addMember(m_allocatedObjects, "allocatedObjects"); - info.addMember(m_countedObjects, "countedObjects"); - info.addMember(m_graphSerializer, "graphSerializer"); -} - -void MemoryInstrumentationImpl::processDeferredObjects() -{ - while (!m_deferredObjects.isEmpty()) { - OwnPtr<WrapperBase> pointer = m_deferredObjects.last().release(); - m_deferredObjects.removeLast(); - pointer->process(this); - } -} - -void MemoryInstrumentationImpl::deferObject(PassOwnPtr<WrapperBase> pointer) -{ - m_deferredObjects.append(pointer); -} - -void MemoryInstrumentationImpl::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorMemoryAgent); - info.addMember(m_deferredObjects, "deferredObjects"); -} - - -} // namespace WebCore - diff --git a/third_party/WebKit/Source/core/inspector/MemoryInstrumentationImpl.h b/third_party/WebKit/Source/core/inspector/MemoryInstrumentationImpl.h deleted file mode 100644 index 0143d91..0000000 --- a/third_party/WebKit/Source/core/inspector/MemoryInstrumentationImpl.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MemoryInstrumentationImpl_h -#define MemoryInstrumentationImpl_h - -#include "wtf/Forward.h" -#include "wtf/HashMap.h" -#include "wtf/HashSet.h" -#include "wtf/MemoryInstrumentation.h" -#include "wtf/Vector.h" -#include "wtf/text/StringHash.h" - -using WTF::MemoryObjectType; -using WTF::MemberType; - -namespace WebCore { - -class HeapGraphSerializer; - -typedef HashSet<const void*> VisitedObjects; -typedef HashMap<String, size_t> TypeNameToSizeMap; - -class MemoryInstrumentationClientImpl : public WTF::MemoryInstrumentationClient { -public: - typedef HashMap<const void*, size_t> ObjectToSizeMap; - - explicit MemoryInstrumentationClientImpl(HeapGraphSerializer* serializer) - : m_totalCountedObjects(0) - , m_totalObjectsNotInAllocatedSet(0) - , m_graphSerializer(serializer) - { } - - size_t totalSize(MemoryObjectType objectType) const - { - TypeToSizeMap::const_iterator i = m_totalSizes.find(objectType); - return i == m_totalSizes.end() ? 0 : i->value; - } - - size_t reportedSizeForAllTypes() const - { - size_t size = 0; - for (TypeToSizeMap::const_iterator i = m_totalSizes.begin(); i != m_totalSizes.end(); ++i) - size += i->value; - return size; - } - - TypeNameToSizeMap sizesMap() const; - VisitedObjects& allocatedObjects() { return m_allocatedObjects; } - const ObjectToSizeMap& countedObjects() { return m_countedObjects; } - - bool checkInstrumentedObjects() const { return !m_allocatedObjects.isEmpty(); } - size_t visitedObjects() const { return m_visitedObjects.size(); } - size_t totalCountedObjects() const { return m_totalCountedObjects; } - size_t totalObjectsNotInAllocatedSet() const { return m_totalObjectsNotInAllocatedSet; } - - virtual void countObjectSize(const void*, MemoryObjectType, size_t) OVERRIDE; - virtual bool visited(const void*) OVERRIDE; - virtual bool checkCountedObject(const void*) OVERRIDE; - virtual void reportNode(const MemoryObjectInfo&) OVERRIDE; - virtual void reportEdge(const void*, const char*, MemberType) OVERRIDE; - virtual void reportLeaf(const MemoryObjectInfo&, const char*) OVERRIDE; - virtual void reportBaseAddress(const void*, const void*) OVERRIDE; - virtual int registerString(const char*) OVERRIDE; - - void reportMemoryUsage(MemoryObjectInfo*) const; - -private: - typedef HashMap<MemoryObjectType, size_t> TypeToSizeMap; - TypeToSizeMap m_totalSizes; - VisitedObjects m_visitedObjects; - VisitedObjects m_allocatedObjects; - ObjectToSizeMap m_countedObjects; - size_t m_totalCountedObjects; - size_t m_totalObjectsNotInAllocatedSet; - HeapGraphSerializer* m_graphSerializer; -}; - -class MemoryInstrumentationImpl : public WTF::MemoryInstrumentation { -public: - explicit MemoryInstrumentationImpl(WTF::MemoryInstrumentationClient* client) - : MemoryInstrumentation(client) - { - } - - size_t selfSize() const; - - void reportMemoryUsage(MemoryObjectInfo*) const; - -private: - virtual void deferObject(PassOwnPtr<WrapperBase>) OVERRIDE; - virtual void processDeferredObjects() OVERRIDE; - - Vector<OwnPtr<WrapperBase> > m_deferredObjects; -}; - -} // namespace WebCore - -#endif // !defined(MemoryInstrumentationImpl_h) - diff --git a/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp index 8324829..40a2c2b 100644 --- a/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp +++ b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp @@ -34,7 +34,6 @@ #include "core/loader/cache/CachedResource.h" #include "core/platform/SharedBuffer.h" #include "core/platform/network/ResourceResponse.h" -#include "wtf/MemoryInstrumentationHashMap.h" namespace { // 100MB @@ -66,15 +65,6 @@ XHRReplayData::XHRReplayData(const String &method, const KURL& url, bool async, { } -void XHRReplayData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this); - info.addMember(m_method, "method"); - info.addMember(m_url, "url"); - info.addMember(m_formData, "formData"); - info.addMember(m_headers, "headers"); -} - // ResourceData NetworkResourcesData::ResourceData::ResourceData(const String& requestId, const String& loaderId) : m_requestId(requestId) @@ -146,22 +136,6 @@ size_t NetworkResourcesData::ResourceData::decodeDataToContent() return contentSizeInBytes(m_content) - dataLength; } -void NetworkResourcesData::ResourceData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this); - info.addMember(m_requestId, "requestId"); - info.addMember(m_loaderId, "loaderId"); - info.addMember(m_frameId, "frameId"); - info.addMember(m_url, "url"); - info.addMember(m_content, "content"); - info.addMember(m_xhrReplayData, "xhrReplayData"); - info.addMember(m_dataBuffer, "dataBuffer"); - info.addMember(m_textEncodingName, "textEncodingName"); - info.addMember(m_decoder, "decoder"); - info.addMember(m_buffer, "buffer"); - info.addMember(m_cachedResource, "cachedResource"); -} - // NetworkResourcesData NetworkResourcesData::NetworkResourcesData() : m_contentSize(0) @@ -412,13 +386,5 @@ bool NetworkResourcesData::ensureFreeSpace(size_t size) return true; } -void NetworkResourcesData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this); - info.addMember(m_requestIdsDeque, "requestIdsDeque"); - info.addMember(m_reusedXHRReplayDataRequestIds, "reusedXHRReplayDataRequestIds"); - info.addMember(m_requestIdToResourceDataMap, "requestIdToResourceDataMap"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/inspector/NetworkResourcesData.h b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.h index 6dc84e2..5c976e4 100644 --- a/third_party/WebKit/Source/core/inspector/NetworkResourcesData.h +++ b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.h @@ -58,7 +58,7 @@ public: PassRefPtr<FormData> formData() const { return m_formData; } const HTTPHeaderMap& headers() const { return m_headers; } bool includeCredentials() const { return m_includeCredentials; } - void reportMemoryUsage(MemoryObjectInfo*) const; + private: XHRReplayData(const String &method, const KURL&, bool async, PassRefPtr<FormData>, bool includeCredentials); @@ -119,8 +119,6 @@ public: XHRReplayData* xhrReplayData() const { return m_xhrReplayData.get(); } void setXHRReplayData(XHRReplayData* xhrReplayData) { m_xhrReplayData = xhrReplayData; } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: bool hasData() const { return m_dataBuffer; } size_t dataLength() const; @@ -168,8 +166,6 @@ public: void reuseXHRReplayData(const String& requestId, const String& reusedRequestId); XHRReplayData* xhrReplayData(const String& requestId); - void reportMemoryUsage(MemoryObjectInfo*) const; - private: ResourceData* resourceDataForRequestId(const String& requestId); void ensureNoDataForRequestId(const String& requestId); diff --git a/third_party/WebKit/Source/core/inspector/ScriptDebugListener.h b/third_party/WebKit/Source/core/inspector/ScriptDebugListener.h index 17ddcc7..9ab765b 100644 --- a/third_party/WebKit/Source/core/inspector/ScriptDebugListener.h +++ b/third_party/WebKit/Source/core/inspector/ScriptDebugListener.h @@ -61,8 +61,6 @@ public: int endLine; int endColumn; bool isContentScript; - - void reportMemoryUsage(MemoryObjectInfo*) const; }; virtual ~ScriptDebugListener() { } diff --git a/third_party/WebKit/Source/core/loader/CachedMetadata.cpp b/third_party/WebKit/Source/core/loader/CachedMetadata.cpp index 1e944c7..f3f2a30 100644 --- a/third_party/WebKit/Source/core/loader/CachedMetadata.cpp +++ b/third_party/WebKit/Source/core/loader/CachedMetadata.cpp @@ -31,15 +31,6 @@ #include "config.h" #include "core/loader/CachedMetadata.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" -#include "wtf/MemoryInstrumentationVector.h" - namespace WebCore { -void CachedMetadata::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this); - info.addMember(m_serializedData, "serializedData"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/loader/CachedMetadata.h b/third_party/WebKit/Source/core/loader/CachedMetadata.h index e216858..6b479e8 100644 --- a/third_party/WebKit/Source/core/loader/CachedMetadata.h +++ b/third_party/WebKit/Source/core/loader/CachedMetadata.h @@ -79,8 +79,6 @@ public: return m_serializedData.size() - dataStart; } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: // Reads an unsigned value at position. Returns 0 on error. unsigned readUnsigned(size_t position) const diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp index 9c60bc9..9d23704 100644 --- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp @@ -35,7 +35,6 @@ #include "core/dom/Document.h" #include "core/dom/DocumentParser.h" #include "core/dom/Event.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/html/HTMLFrameOwnerElement.h" #include "core/inspector/InspectorInstrumentation.h" #include "core/loader/DocumentWriter.h" @@ -59,9 +58,6 @@ #include "weborigin/SchemeRegistry.h" #include "weborigin/SecurityPolicy.h" #include "wtf/Assertions.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationHashSet.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/text/WTFString.h" namespace WebCore { @@ -651,26 +647,6 @@ void DocumentLoader::commitData(const char* bytes, size_t length) m_writer->addData(bytes, length); } -void DocumentLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Loader); - info.addMember(m_frame, "frame"); - info.addMember(m_cachedResourceLoader, "cachedResourceLoader"); - info.addMember(m_mainResource, "mainResource"); - info.addMember(m_resourceLoaders, "resourceLoaders"); - info.addMember(m_multipartResourceLoaders, "multipartResourceLoaders"); - info.addMember(m_substituteData, "substituteData"); - info.addMember(m_pageTitle.string(), "pageTitle.string()"); - info.addMember(m_overrideEncoding, "overrideEncoding"); - info.addMember(m_originalRequest, "originalRequest"); - info.addMember(m_originalRequestCopy, "originalRequestCopy"); - info.addMember(m_request, "request"); - info.addMember(m_response, "response"); - info.addMember(m_archiveResourceCollection, "archiveResourceCollection"); - info.addMember(m_archive, "archive"); - info.addMember(m_applicationCacheHost, "applicationCacheHost"); -} - void DocumentLoader::dataReceived(CachedResource* resource, const char* data, int length) { ASSERT(data); diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.h b/third_party/WebKit/Source/core/loader/DocumentLoader.h index 7e15c50..de79abd 100644 --- a/third_party/WebKit/Source/core/loader/DocumentLoader.h +++ b/third_party/WebKit/Source/core/loader/DocumentLoader.h @@ -159,7 +159,6 @@ namespace WebCore { ApplicationCacheHost* applicationCacheHost() const { return m_applicationCacheHost.get(); } - virtual void reportMemoryUsage(MemoryObjectInfo*) const; void checkLoadComplete(); bool isRedirect() const { return m_redirectChain.size() > 1; } diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp index da47716..859d9f9 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp @@ -46,7 +46,6 @@ #include "core/dom/Event.h" #include "core/dom/EventNames.h" #include "core/dom/PageTransitionEvent.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/editing/Editor.h" #include "core/history/BackForwardController.h" #include "core/history/HistoryItem.h" @@ -88,7 +87,6 @@ #include "modules/webdatabase/DatabaseManager.h" #include "weborigin/SecurityOrigin.h" #include "weborigin/SecurityPolicy.h" -#include "wtf/MemoryInstrumentationHashSet.h" #include "wtf/TemporaryChange.h" #include "wtf/text/CString.h" #include "wtf/text/WTFString.h" @@ -2358,21 +2356,4 @@ void FrameLoader::dispatchDidCommitLoad() } -void FrameLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Loader); - info.addMember(m_frame, "frame"); - info.ignoreMember(m_client); - info.addMember(m_progressTracker, "progressTracker"); - info.addMember(m_documentLoader, "documentLoader"); - info.addMember(m_provisionalDocumentLoader, "provisionalDocumentLoader"); - info.addMember(m_policyDocumentLoader, "policyDocumentLoader"); - info.addMember(m_submittedFormURL, "submittedFormURL"); - info.addMember(m_checkTimer, "checkTimer"); - info.addMember(m_opener, "opener"); - info.addMember(m_openedFrames, "openedFrames"); - info.addMember(m_outgoingReferrer, "outgoingReferrer"); - info.addMember(m_requestedHistoryItem, "requestedHistoryItem"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.h b/third_party/WebKit/Source/core/loader/FrameLoader.h index bb553fb..68e4ce2 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoader.h +++ b/third_party/WebKit/Source/core/loader/FrameLoader.h @@ -247,8 +247,6 @@ public: }; PageDismissalType pageDismissalEventBeingDispatched() const { return m_pageDismissalEventBeingDispatched; } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: bool allChildrenAreComplete() const; // immediate children, not all descendants diff --git a/third_party/WebKit/Source/core/loader/ImageLoader.cpp b/third_party/WebKit/Source/core/loader/ImageLoader.cpp index e24ee1f..6ad2aca 100644 --- a/third_party/WebKit/Source/core/loader/ImageLoader.cpp +++ b/third_party/WebKit/Source/core/loader/ImageLoader.cpp @@ -27,7 +27,6 @@ #include "core/dom/Element.h" #include "core/dom/Event.h" #include "core/dom/EventSender.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/html/HTMLObjectElement.h" #include "core/html/parser/HTMLParserIdioms.h" #include "core/loader/CrossOriginAccessControl.h" @@ -449,13 +448,4 @@ inline void ImageLoader::clearFailedLoadURL() m_failedLoadURL = AtomicString(); } -void ImageLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Image); - info.addMember(m_element, "element"); - info.addMember(m_image.get(), "image", WTF::RetainingPointer); - info.addMember(m_derefElementTimer, "derefElementTimer"); - info.addMember(m_failedLoadURL, "failedLoadURL"); -} - } diff --git a/third_party/WebKit/Source/core/loader/ImageLoader.h b/third_party/WebKit/Source/core/loader/ImageLoader.h index 8c07187..f06089e 100644 --- a/third_party/WebKit/Source/core/loader/ImageLoader.h +++ b/third_party/WebKit/Source/core/loader/ImageLoader.h @@ -69,8 +69,6 @@ public: static void dispatchPendingLoadEvents(); static void dispatchPendingErrorEvents(); - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - protected: virtual void notifyFinished(CachedResource*); diff --git a/third_party/WebKit/Source/core/loader/Prerenderer.cpp b/third_party/WebKit/Source/core/loader/Prerenderer.cpp index e16405d..5afa94f9d 100644 --- a/third_party/WebKit/Source/core/loader/Prerenderer.cpp +++ b/third_party/WebKit/Source/core/loader/Prerenderer.cpp @@ -33,14 +33,13 @@ #include "core/loader/Prerenderer.h" #include "core/dom/Document.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/FrameLoader.h" #include "core/loader/PrerendererClient.h" #include "core/page/Frame.h" #include "core/platform/PrerenderHandle.h" #include "weborigin/ReferrerPolicy.h" #include "weborigin/SecurityPolicy.h" -#include "wtf/MemoryInstrumentationVector.h" + #include "wtf/PassOwnPtr.h" #include "wtf/PassRefPtr.h" #include "wtf/RefPtr.h" @@ -141,13 +140,4 @@ PrerendererClient* Prerenderer::client() return m_client; } -void Prerenderer::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - ActiveDOMObject::reportMemoryUsage(memoryObjectInfo); - info.ignoreMember(m_client); - info.addMember(m_activeHandles, "activeHandles"); - info.addMember(m_suspendedHandles, "suspendedHandles"); -} - } diff --git a/third_party/WebKit/Source/core/loader/Prerenderer.h b/third_party/WebKit/Source/core/loader/Prerenderer.h index 91259f7..a754565 100644 --- a/third_party/WebKit/Source/core/loader/Prerenderer.h +++ b/third_party/WebKit/Source/core/loader/Prerenderer.h @@ -56,8 +56,6 @@ public: static PassOwnPtr<Prerenderer> create(Document*); - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - // From ActiveDOMObject: virtual bool canSuspend() const OVERRIDE { return true; } virtual void stop() OVERRIDE; diff --git a/third_party/WebKit/Source/core/loader/ResourceLoader.cpp b/third_party/WebKit/Source/core/loader/ResourceLoader.cpp index ca965c8..62aef07 100644 --- a/third_party/WebKit/Source/core/loader/ResourceLoader.cpp +++ b/third_party/WebKit/Source/core/loader/ResourceLoader.cpp @@ -412,19 +412,4 @@ void ResourceLoader::didFail(ResourceHandle*, const ResourceError& error) releaseResources(); } -void ResourceLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Loader); - info.addMember(m_handle, "handle"); - info.addMember(m_frame, "frame"); - info.addMember(m_documentLoader, "documentLoader"); - info.addMember(m_request, "request"); - info.addMember(m_originalRequest, "originalRequest"); - info.addMember(m_deferredRequest, "deferredRequest"); - info.addMember(m_options, "options"); - info.addMember(m_resource, "resource"); - info.addMember(m_documentLoader, "documentLoader"); - info.addMember(m_requestCountTracker, "requestCountTracker"); -} - } diff --git a/third_party/WebKit/Source/core/loader/ResourceLoader.h b/third_party/WebKit/Source/core/loader/ResourceLoader.h index 9582dac..f0052c7 100644 --- a/third_party/WebKit/Source/core/loader/ResourceLoader.h +++ b/third_party/WebKit/Source/core/loader/ResourceLoader.h @@ -91,8 +91,6 @@ public: const ResourceRequest& request() const { return m_request; } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: ResourceLoader(DocumentLoader*, CachedResource*, ResourceLoaderOptions); diff --git a/third_party/WebKit/Source/core/loader/SubstituteData.cpp b/third_party/WebKit/Source/core/loader/SubstituteData.cpp index 7ba107c..74f241e 100644 --- a/third_party/WebKit/Source/core/loader/SubstituteData.cpp +++ b/third_party/WebKit/Source/core/loader/SubstituteData.cpp @@ -31,18 +31,6 @@ #include "config.h" #include "core/loader/SubstituteData.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" - namespace WebCore { -void SubstituteData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Loader); - info.addMember(m_content, "content"); - info.addMember(m_mimeType, "mimeType"); - info.addMember(m_textEncoding, "textEncoding"); - info.addMember(m_failingURL, "failingURL"); - info.addMember(m_responseURL, "responseURL"); -} - } diff --git a/third_party/WebKit/Source/core/loader/SubstituteData.h b/third_party/WebKit/Source/core/loader/SubstituteData.h index 137a3f3..e7f3099 100644 --- a/third_party/WebKit/Source/core/loader/SubstituteData.h +++ b/third_party/WebKit/Source/core/loader/SubstituteData.h @@ -54,8 +54,6 @@ namespace WebCore { const KURL& failingURL() const { return m_failingURL; } const KURL& responseURL() const { return m_responseURL; } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: RefPtr<SharedBuffer> m_content; String m_mimeType; diff --git a/third_party/WebKit/Source/core/loader/cache/CachedCSSStyleSheet.cpp b/third_party/WebKit/Source/core/loader/cache/CachedCSSStyleSheet.cpp index d7aee75..6a209ea 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedCSSStyleSheet.cpp +++ b/third_party/WebKit/Source/core/loader/cache/CachedCSSStyleSheet.cpp @@ -28,7 +28,6 @@ #include "core/loader/cache/CachedCSSStyleSheet.h" #include "core/css/StyleSheetContents.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/TextResourceDecoder.h" #include "core/loader/cache/CachedResourceClientWalker.h" #include "core/loader/cache/CachedStyleSheetClient.h" @@ -181,13 +180,4 @@ void CachedCSSStyleSheet::saveParsedStyleSheet(PassRefPtr<StyleSheetContents> sh setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); } -void CachedCSSStyleSheet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResourceCSS); - CachedResource::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_decoder, "decoder"); - info.addMember(m_parsedStyleSheetCache, "parsedStyleSheetCache"); - info.addMember(m_decodedSheetText, "decodedSheetText"); -} - } diff --git a/third_party/WebKit/Source/core/loader/cache/CachedCSSStyleSheet.h b/third_party/WebKit/Source/core/loader/cache/CachedCSSStyleSheet.h index e1cbf0d..ea59d1e 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedCSSStyleSheet.h +++ b/third_party/WebKit/Source/core/loader/cache/CachedCSSStyleSheet.h @@ -50,8 +50,6 @@ namespace WebCore { PassRefPtr<StyleSheetContents> restoreParsedStyleSheet(const CSSParserContext&); void saveParsedStyleSheet(PassRefPtr<StyleSheetContents>); - - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; private: bool canUseSheet(bool enforceMIMEType, bool* hasValidMIMEType) const; diff --git a/third_party/WebKit/Source/core/loader/cache/CachedDocument.cpp b/third_party/WebKit/Source/core/loader/cache/CachedDocument.cpp index d0ad108..a38ce23 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedDocument.cpp +++ b/third_party/WebKit/Source/core/loader/cache/CachedDocument.cpp @@ -79,12 +79,4 @@ PassRefPtr<Document> CachedDocument::createDocument(const KURL& url) } } -void CachedDocument::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResourceSVG); - CachedResource::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_document, "document"); - info.addMember(m_decoder, "decoder"); -} - } diff --git a/third_party/WebKit/Source/core/loader/cache/CachedDocument.h b/third_party/WebKit/Source/core/loader/cache/CachedDocument.h index 72e5f19..365647d 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedDocument.h +++ b/third_party/WebKit/Source/core/loader/cache/CachedDocument.h @@ -43,8 +43,6 @@ public: virtual String encoding() const; virtual void checkNotify() OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: PassRefPtr<Document> createDocument(const KURL&); diff --git a/third_party/WebKit/Source/core/loader/cache/CachedFont.cpp b/third_party/WebKit/Source/core/loader/cache/CachedFont.cpp index d82b581..83f34de 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedFont.cpp +++ b/third_party/WebKit/Source/core/loader/cache/CachedFont.cpp @@ -27,7 +27,6 @@ #include "config.h" #include "core/loader/cache/CachedFont.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/TextResourceDecoder.h" #include "core/loader/cache/CachedResourceClient.h" #include "core/loader/cache/CachedResourceClientWalker.h" @@ -163,14 +162,4 @@ void CachedFont::checkNotify() c->fontLoaded(this); } -void CachedFont::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResourceFont); - CachedResource::reportMemoryUsage(memoryObjectInfo); -#if ENABLE(SVG_FONTS) - info.addMember(m_externalSVGDocument, "externalSVGDocument"); -#endif - info.addMember(m_fontData, "fontData"); -} - } diff --git a/third_party/WebKit/Source/core/loader/cache/CachedFont.h b/third_party/WebKit/Source/core/loader/cache/CachedFont.h index 775ff03..91cdcbb0 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedFont.h +++ b/third_party/WebKit/Source/core/loader/cache/CachedFont.h @@ -60,8 +60,6 @@ public: SVGFontElement* getSVGFontById(const String&) const; #endif - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: virtual void checkNotify(); FontCustomPlatformData* m_fontData; diff --git a/third_party/WebKit/Source/core/loader/cache/CachedImage.cpp b/third_party/WebKit/Source/core/loader/cache/CachedImage.cpp index 0585571..3681cbe 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedImage.cpp +++ b/third_party/WebKit/Source/core/loader/cache/CachedImage.cpp @@ -35,8 +35,6 @@ #include "core/rendering/RenderObject.h" #include "core/svg/graphics/SVGImage.h" #include "wtf/CurrentTime.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryObjectInfo.h" #include "wtf/StdLibExtras.h" #include "wtf/Vector.h" @@ -440,16 +438,6 @@ void CachedImage::changedInRect(const Image* image, const IntRect& rect) notifyObservers(&rect); } -void CachedImage::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResourceImage); - memoryObjectInfo->setClassName("CachedImage"); - CachedResource::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_pendingContainerSizeRequests, "pendingContainerSizeRequests"); - info.addMember(m_image, "m_image"); - info.addMember(m_svgImageCache, "svgImageCache"); -} - bool CachedImage::currentFrameKnownToBeOpaque(const RenderObject* renderer) { Image* image = imageForRenderer(renderer); diff --git a/third_party/WebKit/Source/core/loader/cache/CachedImage.h b/third_party/WebKit/Source/core/loader/cache/CachedImage.h index e3d4320..b42b921 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedImage.h +++ b/third_party/WebKit/Source/core/loader/cache/CachedImage.h @@ -94,8 +94,6 @@ public: virtual void animationAdvanced(const Image*); virtual void changedInRect(const Image*, const IntRect&); - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: void clear(); diff --git a/third_party/WebKit/Source/core/loader/cache/CachedRawResource.cpp b/third_party/WebKit/Source/core/loader/cache/CachedRawResource.cpp index bee1e68..9633dcd 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedRawResource.cpp +++ b/third_party/WebKit/Source/core/loader/cache/CachedRawResource.cpp @@ -26,7 +26,6 @@ #include "config.h" #include "core/loader/cache/CachedRawResource.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/ResourceLoader.h" #include "core/loader/cache/CachedResourceClient.h" #include "core/loader/cache/CachedResourceClientWalker.h" @@ -194,11 +193,4 @@ void CachedRawResource::clear() setEncodedSize(0); } -void CachedRawResource::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResourceRaw); - CachedResource::reportMemoryUsage(memoryObjectInfo); -} - - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/loader/cache/CachedRawResource.h b/third_party/WebKit/Source/core/loader/cache/CachedRawResource.h index 14694a5..876ed30 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedRawResource.h +++ b/third_party/WebKit/Source/core/loader/cache/CachedRawResource.h @@ -45,8 +45,6 @@ public: virtual bool canReuse(const ResourceRequest&) const; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: virtual void didAddClient(CachedResourceClient*); virtual void appendData(const char*, int) OVERRIDE; diff --git a/third_party/WebKit/Source/core/loader/cache/CachedResource.cpp b/third_party/WebKit/Source/core/loader/cache/CachedResource.cpp index 2ccf57b..ef7be11 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedResource.cpp +++ b/third_party/WebKit/Source/core/loader/cache/CachedResource.cpp @@ -24,7 +24,6 @@ #include "config.h" #include "core/loader/cache/CachedResource.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/inspector/InspectorInstrumentation.h" #include "core/loader/CachedMetadata.h" #include "core/loader/CrossOriginAccessControl.h" @@ -41,22 +40,11 @@ #include "weborigin/KURL.h" #include "wtf/CurrentTime.h" #include "wtf/MathExtras.h" -#include "wtf/MemoryInstrumentationHashCountedSet.h" -#include "wtf/MemoryInstrumentationHashSet.h" -#include "wtf/MemoryObjectInfo.h" #include "wtf/RefCountedLeakCounter.h" #include "wtf/StdLibExtras.h" #include "wtf/Vector.h" #include "wtf/text/CString.h" -namespace WTF { - -template<> struct SequenceMemoryInstrumentationTraits<WebCore::CachedResourceClient*> { - template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&) { } -}; - -} - using namespace WTF; namespace WebCore { @@ -835,29 +823,4 @@ void CachedResource::CachedResourceCallback::timerFired(Timer<CachedResourceCall m_resource->didAddClient(m_client); } -void CachedResource::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResource); - memoryObjectInfo->setName(url().string().utf8().data()); - info.addMember(m_resourceRequest, "resourceRequest"); - info.addMember(m_fragmentIdentifierForRequest, "fragmentIdentifierForRequest"); - info.addMember(m_clients, "clients"); - info.addMember(m_accept, "accept"); - info.addMember(m_loader, "loader"); - info.addMember(m_response, "response"); - info.addMember(m_data, "data"); - info.addMember(m_cachedMetadata, "cachedMetadata"); - info.addMember(m_nextInAllResourcesList, "nextInAllResourcesList"); - info.addMember(m_prevInAllResourcesList, "prevInAllResourcesList"); - info.addMember(m_nextInLiveResourcesList, "nextInLiveResourcesList"); - info.addMember(m_prevInLiveResourcesList, "prevInLiveResourcesList"); - info.addMember(m_resourceToRevalidate, "resourceToRevalidate"); - info.addMember(m_proxyResource, "proxyResource"); - info.addMember(m_handlesToRevalidate, "handlesToRevalidate"); - info.addMember(m_options, "options"); - info.ignoreMember(m_clientsAwaitingCallback); - - if (m_purgeableData && !m_purgeableData->wasPurged()) - info.addRawBuffer(m_purgeableData.get(), m_purgeableData->size(), "PurgeableData", "purgeableData"); -} } diff --git a/third_party/WebKit/Source/core/loader/cache/CachedResource.h b/third_party/WebKit/Source/core/loader/cache/CachedResource.h index 7c59bad..a47846d 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedResource.h +++ b/third_party/WebKit/Source/core/loader/cache/CachedResource.h @@ -235,8 +235,6 @@ public: double loadFinishTime() const { return m_loadFinishTime; } - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - virtual bool canReuse(const ResourceRequest&) const { return true; } protected: diff --git a/third_party/WebKit/Source/core/loader/cache/CachedResourceHandle.cpp b/third_party/WebKit/Source/core/loader/cache/CachedResourceHandle.cpp index ad68e15..03d648e 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedResourceHandle.cpp +++ b/third_party/WebKit/Source/core/loader/cache/CachedResourceHandle.cpp @@ -26,8 +26,6 @@ #include "config.h" #include "core/loader/cache/CachedResourceHandle.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" - namespace WebCore { void CachedResourceHandleBase::setResource(CachedResource* resource) @@ -41,11 +39,4 @@ void CachedResourceHandleBase::setResource(CachedResource* resource) m_resource->registerHandle(this); } -void CachedResourceHandleBase::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::MemoryCacheStructures); - info.addMember(m_resource, "resource"); -} - - } diff --git a/third_party/WebKit/Source/core/loader/cache/CachedResourceHandle.h b/third_party/WebKit/Source/core/loader/cache/CachedResourceHandle.h index d972c3e3..04fedf8 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedResourceHandle.h +++ b/third_party/WebKit/Source/core/loader/cache/CachedResourceHandle.h @@ -41,8 +41,6 @@ namespace WebCore { typedef CachedResource* CachedResourceHandleBase::*UnspecifiedBoolType; operator UnspecifiedBoolType() const { return m_resource ? &CachedResourceHandleBase::m_resource : 0; } - void reportMemoryUsage(MemoryObjectInfo*) const; - protected: CachedResourceHandleBase() : m_resource(0) {} CachedResourceHandleBase(CachedResource* res) { m_resource = res; if (m_resource) m_resource->registerHandle(this); } diff --git a/third_party/WebKit/Source/core/loader/cache/CachedResourceLoader.cpp b/third_party/WebKit/Source/core/loader/cache/CachedResourceLoader.cpp index 3c00d4a..87d41d3 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedResourceLoader.cpp +++ b/third_party/WebKit/Source/core/loader/cache/CachedResourceLoader.cpp @@ -57,9 +57,6 @@ #include "public/platform/WebURL.h" #include "weborigin/SecurityOrigin.h" #include "weborigin/SecurityPolicy.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationHashSet.h" -#include "wtf/MemoryInstrumentationListHashSet.h" #include "wtf/text/CString.h" #include "wtf/text/WTFString.h" @@ -1129,18 +1126,6 @@ void CachedResourceLoader::printPreloadStats() } #endif -void CachedResourceLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Loader); - info.addMember(m_documentResources, "documentResources"); - info.addMember(m_document, "document"); - info.addMember(m_documentLoader, "documentLoader"); - info.addMember(m_validatedURLs, "validatedURLs"); - info.addMember(m_preloads, "preloads"); - info.addMember(m_pendingPreloads, "pendingPreloads"); - info.addMember(m_garbageCollectDocumentResourcesTimer, "garbageCollectDocumentResourcesTimer"); -} - const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions() { DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffContent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientForCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaultOriginRestrictionsForType, DocumentContext)); diff --git a/third_party/WebKit/Source/core/loader/cache/CachedResourceLoader.h b/third_party/WebKit/Source/core/loader/cache/CachedResourceLoader.h index 5ff24d9..9fab79c 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedResourceLoader.h +++ b/third_party/WebKit/Source/core/loader/cache/CachedResourceLoader.h @@ -125,7 +125,6 @@ public: void printPreloadStats(); bool canRequest(CachedResource::Type, const KURL&, const ResourceLoaderOptions&, bool forPreload = false); bool canAccess(CachedResource*); - void reportMemoryUsage(MemoryObjectInfo*) const; static const ResourceLoaderOptions& defaultCachedResourceOptions(); diff --git a/third_party/WebKit/Source/core/loader/cache/CachedScript.cpp b/third_party/WebKit/Source/core/loader/cache/CachedScript.cpp index 8c2531d..0ed66ad 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedScript.cpp +++ b/third_party/WebKit/Source/core/loader/cache/CachedScript.cpp @@ -27,7 +27,6 @@ #include "config.h" #include "core/loader/cache/CachedScript.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/TextResourceDecoder.h" #include "core/platform/MIMETypeRegistry.h" #include "core/platform/SharedBuffer.h" @@ -89,12 +88,4 @@ bool CachedScript::mimeTypeAllowedByNosniff() const return parseContentTypeOptionsHeader(m_response.httpHeaderField("X-Content-Type-Options")) != ContentTypeOptionsNosniff || MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeType()); } -void CachedScript::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResourceScript); - CachedResource::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_script, "script"); - info.addMember(m_decoder, "decoder"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/loader/cache/CachedScript.h b/third_party/WebKit/Source/core/loader/cache/CachedScript.h index 4ba3d9f..5a23a6a 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedScript.h +++ b/third_party/WebKit/Source/core/loader/cache/CachedScript.h @@ -46,8 +46,6 @@ namespace WebCore { bool mimeTypeAllowedByNosniff() const; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: String m_script; RefPtr<TextResourceDecoder> m_decoder; diff --git a/third_party/WebKit/Source/core/loader/cache/CachedShader.cpp b/third_party/WebKit/Source/core/loader/cache/CachedShader.cpp index 537d0e7..fea166c 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedShader.cpp +++ b/third_party/WebKit/Source/core/loader/cache/CachedShader.cpp @@ -30,7 +30,6 @@ #include "config.h" #include "core/loader/cache/CachedShader.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/TextResourceDecoder.h" #include "core/platform/SharedBuffer.h" #include "wtf/text/StringBuilder.h" @@ -59,12 +58,4 @@ const String& CachedShader::shaderString() return m_shaderString; } -void CachedShader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResourceShader); - CachedResource::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_decoder, "decoder"); - info.addMember(m_shaderString, "shaderString"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/loader/cache/CachedShader.h b/third_party/WebKit/Source/core/loader/cache/CachedShader.h index f3a5b64..18d3189 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedShader.h +++ b/third_party/WebKit/Source/core/loader/cache/CachedShader.h @@ -43,8 +43,6 @@ public: const String& shaderString(); - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: RefPtr<TextResourceDecoder> m_decoder; String m_shaderString; diff --git a/third_party/WebKit/Source/core/loader/cache/CachedXSLStyleSheet.cpp b/third_party/WebKit/Source/core/loader/cache/CachedXSLStyleSheet.cpp index a65e88c..88d87c7 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedXSLStyleSheet.cpp +++ b/third_party/WebKit/Source/core/loader/cache/CachedXSLStyleSheet.cpp @@ -27,7 +27,6 @@ #include "config.h" #include "core/loader/cache/CachedXSLStyleSheet.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/TextResourceDecoder.h" #include "core/loader/cache/CachedResourceClientWalker.h" #include "core/loader/cache/CachedStyleSheetClient.h" @@ -76,12 +75,4 @@ void CachedXSLStyleSheet::checkNotify() c->setXSLStyleSheet(m_resourceRequest.url(), m_response.url(), m_sheet); } -void CachedXSLStyleSheet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResourceXSLT); - CachedResource::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_sheet, "sheet"); - info.addMember(m_decoder, "decoder"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/loader/cache/CachedXSLStyleSheet.h b/third_party/WebKit/Source/core/loader/cache/CachedXSLStyleSheet.h index a851bfa..74480c6 100644 --- a/third_party/WebKit/Source/core/loader/cache/CachedXSLStyleSheet.h +++ b/third_party/WebKit/Source/core/loader/cache/CachedXSLStyleSheet.h @@ -44,8 +44,6 @@ namespace WebCore { virtual void setEncoding(const String&); virtual String encoding() const; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - protected: virtual void checkNotify(); diff --git a/third_party/WebKit/Source/core/loader/cache/MemoryCache.cpp b/third_party/WebKit/Source/core/loader/cache/MemoryCache.cpp index 6b75977..b4cc594 100644 --- a/third_party/WebKit/Source/core/loader/cache/MemoryCache.cpp +++ b/third_party/WebKit/Source/core/loader/cache/MemoryCache.cpp @@ -26,7 +26,6 @@ #include <stdio.h> #include "core/dom/CrossThreadTask.h" #include "core/dom/Document.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/cache/CachedResource.h" #include "core/loader/cache/CachedResourceHandle.h" #include "core/page/FrameView.h" @@ -39,9 +38,6 @@ #include "wtf/Assertions.h" #include "wtf/CurrentTime.h" #include "wtf/MathExtras.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationVector.h" -#include "wtf/MemoryObjectInfo.h" #include "wtf/TemporaryChange.h" #include "wtf/text/CString.h" @@ -542,17 +538,6 @@ MemoryCache::Statistics MemoryCache::getStatistics() return stats; } -void MemoryCache::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::MemoryCacheStructures); - memoryObjectInfo->setClassName("MemoryCache"); - info.addMember(m_resources, "resources"); - info.addMember(m_allResources, "allResources"); - info.addMember(m_liveDecodedResources, "liveDecodedResources"); - for (CachedResourceMap::const_iterator i = m_resources.begin(); i != m_resources.end(); ++i) - info.addMember(i->value, "cachedResourceItem", WTF::RetainingPointer); -} - void MemoryCache::evictResources() { for (;;) { diff --git a/third_party/WebKit/Source/core/loader/cache/MemoryCache.h b/third_party/WebKit/Source/core/loader/cache/MemoryCache.h index 1bf7c24..3f45682 100644 --- a/third_party/WebKit/Source/core/loader/cache/MemoryCache.h +++ b/third_party/WebKit/Source/core/loader/cache/MemoryCache.h @@ -148,8 +148,6 @@ public: unsigned liveSize() const { return m_liveSize; } unsigned deadSize() const { return m_deadSize; } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: LRUList* lruListFor(CachedResource*); diff --git a/third_party/WebKit/Source/core/page/DOMTimer.cpp b/third_party/WebKit/Source/core/page/DOMTimer.cpp index 08a9ba9..ee3157f 100644 --- a/third_party/WebKit/Source/core/page/DOMTimer.cpp +++ b/third_party/WebKit/Source/core/page/DOMTimer.cpp @@ -29,7 +29,6 @@ #include "bindings/v8/ScheduledAction.h" #include "core/dom/ScriptExecutionContext.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/inspector/InspectorInstrumentation.h" #include "wtf/CurrentTime.h" @@ -178,12 +177,4 @@ double DOMTimer::alignedFireTime(double fireTime) const return fireTime; } -void DOMTimer::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - SuspendableTimer::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_action, "action"); - info.addMember(m_userGestureToken, "userGestureToken"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/page/DOMTimer.h b/third_party/WebKit/Source/core/page/DOMTimer.h index 496b83a..9324899 100644 --- a/third_party/WebKit/Source/core/page/DOMTimer.h +++ b/third_party/WebKit/Source/core/page/DOMTimer.h @@ -52,8 +52,6 @@ public: virtual void contextDestroyed() OVERRIDE; virtual void stop() OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - // The following are essentially constants. All intervals are in seconds. static double hiddenPageAlignmentInterval(); static double visiblePageAlignmentInterval(); diff --git a/third_party/WebKit/Source/core/page/DOMWindow.cpp b/third_party/WebKit/Source/core/page/DOMWindow.cpp index cb56979..b4547b1 100644 --- a/third_party/WebKit/Source/core/page/DOMWindow.cpp +++ b/third_party/WebKit/Source/core/page/DOMWindow.cpp @@ -54,7 +54,6 @@ #include "core/dom/PageTransitionEvent.h" #include "core/dom/RequestAnimationFrameCallback.h" #include "core/dom/ScriptExecutionContext.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/editing/Editor.h" #include "core/history/BackForwardController.h" #include "core/html/HTMLCanvasElement.h" @@ -620,12 +619,6 @@ Navigator* DOMWindow::navigator() const return m_navigator.get(); } -void DOMWindow::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_document, "document"); -} - Performance* DOMWindow::performance() const { if (!isCurrentlyDisplayedInFrame()) diff --git a/third_party/WebKit/Source/core/page/DOMWindow.h b/third_party/WebKit/Source/core/page/DOMWindow.h index ae61ae0..ac289d4 100644 --- a/third_party/WebKit/Source/core/page/DOMWindow.h +++ b/third_party/WebKit/Source/core/page/DOMWindow.h @@ -384,8 +384,6 @@ namespace WebCore { DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend); DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel); - void reportMemoryUsage(MemoryObjectInfo*) const; - Performance* performance() const; // FIXME: When this DOMWindow is no longer the active DOMWindow (i.e., diff --git a/third_party/WebKit/Source/core/page/Frame.cpp b/third_party/WebKit/Source/core/page/Frame.cpp index 328d8f1..5aa82a6 100644 --- a/third_party/WebKit/Source/core/page/Frame.cpp +++ b/third_party/WebKit/Source/core/page/Frame.cpp @@ -345,17 +345,6 @@ void Frame::dispatchVisibilityStateChangeEvent() childFrames[i]->dispatchVisibilityStateChangeEvent(); } -void Frame::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - info.addMember(m_domWindow, "domWindow"); - info.ignoreMember(m_view); - info.addMember(m_ownerElement, "ownerElement"); - info.addMember(m_page, "page"); - info.addMember(m_loader, "loader"); - info.ignoreMember(m_destructionObservers); -} - void Frame::willDetachPage() { if (Frame* parent = tree()->parent()) diff --git a/third_party/WebKit/Source/core/page/Frame.h b/third_party/WebKit/Source/core/page/Frame.h index 26192df..0e1343c 100644 --- a/third_party/WebKit/Source/core/page/Frame.h +++ b/third_party/WebKit/Source/core/page/Frame.h @@ -104,8 +104,6 @@ namespace WebCore { void dispatchVisibilityStateChangeEvent(); - void reportMemoryUsage(MemoryObjectInfo*) const; - // ======== All public functions below this point are candidates to move out of Frame into another class. ======== bool inScope(TreeScope*) const; diff --git a/third_party/WebKit/Source/core/page/Page.cpp b/third_party/WebKit/Source/core/page/Page.cpp index e61d068..a022a6b 100644 --- a/third_party/WebKit/Source/core/page/Page.cpp +++ b/third_party/WebKit/Source/core/page/Page.cpp @@ -26,7 +26,6 @@ #include "core/dom/Event.h" #include "core/dom/EventNames.h" #include "core/dom/VisitedLinkState.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/editing/Editor.h" #include "core/history/BackForwardController.h" #include "core/history/HistoryItem.h" @@ -55,7 +54,6 @@ #include "core/rendering/RenderView.h" #include "core/storage/StorageNamespace.h" #include "wtf/HashMap.h" -#include "wtf/MemoryInstrumentationHashSet.h" #include "wtf/RefCountedLeakCounter.h" #include "wtf/StdLibExtras.h" #include "wtf/text/Base64.h" @@ -768,38 +766,6 @@ void Page::addRelevantUnpaintedObject(RenderObject* object, const LayoutRect& ob m_relevantUnpaintedRegion.unite(pixelSnappedIntRect(objectPaintRect)); } -void Page::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Page); - info.addMember(m_chrome, "chrome"); - info.addMember(m_dragCaretController, "dragCaretController"); - - info.addMember(m_dragController, "dragController"); - info.addMember(m_focusController, "focusController"); - info.addMember(m_contextMenuController, "contextMenuController"); - info.addMember(m_inspectorController, "inspectorController"); - info.addMember(m_pointerLockController, "pointerLockController"); - info.addMember(m_scrollingCoordinator, "scrollingCoordinator"); - info.addMember(m_settings, "settings"); - info.addMember(m_progress, "progress"); - info.addMember(m_backForwardController, "backForwardController"); - info.addMember(m_mainFrame, "mainFrame"); - info.addMember(m_pluginData, "pluginData"); - info.addMember(m_theme, "theme"); - info.addMember(m_UseCounter, "UseCounter"); - info.addMember(m_pagination, "pagination"); - info.addMember(m_userStyleSheet, "userStyleSheet"); - info.addMember(m_group, "group"); - info.addMember(m_sessionStorage, "sessionStorage"); - info.addMember(m_relevantUnpaintedRenderObjects, "relevantUnpaintedRenderObjects"); - info.addMember(m_topRelevantPaintedRegion, "relevantPaintedRegion"); - info.addMember(m_bottomRelevantPaintedRegion, "relevantPaintedRegion"); - info.addMember(m_relevantUnpaintedRegion, "relevantUnpaintedRegion"); - - info.ignoreMember(m_editorClient); - info.ignoreMember(m_validationMessageClient); -} - void Page::addMultisamplingChangedObserver(MultisamplingChangedObserver* observer) { m_multisamplingChangedObservers.add(observer); diff --git a/third_party/WebKit/Source/core/page/Page.h b/third_party/WebKit/Source/core/page/Page.h index 5bf8e68c..f0f0723 100644 --- a/third_party/WebKit/Source/core/page/Page.h +++ b/third_party/WebKit/Source/core/page/Page.h @@ -251,8 +251,6 @@ public: PageConsole* console() { return m_console.get(); } - void reportMemoryUsage(MemoryObjectInfo*) const; - double timerAlignmentInterval() const; class MultisamplingChangedObserver { diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp index 20a515f..87829b1 100644 --- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp @@ -49,6 +49,7 @@ #include "public/platform/WebScrollbarLayer.h" #include "public/platform/WebScrollbarThemeGeometry.h" #include "public/platform/WebScrollbarThemePainter.h" +#include "wtf/text/StringBuilder.h" using WebKit::WebLayer; using WebKit::WebLayerPositionConstraint; diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.h b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.h index de91423..c446d36 100644 --- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.h +++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.h @@ -30,6 +30,7 @@ #include "core/platform/ScrollTypes.h" #include "core/platform/graphics/IntRect.h" #include "core/rendering/RenderObject.h" +#include "wtf/text/WTFString.h" namespace WebKit { class WebLayer; diff --git a/third_party/WebKit/Source/core/platform/PlatformMemoryInstrumentation.cpp b/third_party/WebKit/Source/core/platform/PlatformMemoryInstrumentation.cpp deleted file mode 100644 index f83cbcb..0000000 --- a/third_party/WebKit/Source/core/platform/PlatformMemoryInstrumentation.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "core/platform/PlatformMemoryInstrumentation.h" - -namespace WebCore { - -MemoryObjectType PlatformMemoryTypes::Image = "Image"; -MemoryObjectType PlatformMemoryTypes::Loader = "Resources"; -MemoryObjectType PlatformMemoryTypes::Rendering = "Rendering"; -MemoryObjectType PlatformMemoryTypes::Layers = "Rendering"; - -MemoryObjectType PlatformMemoryTypes::Audio = "Audio"; -MemoryObjectType PlatformMemoryTypes::AudioSharedData = "Audio"; - -} // namespace WebCore diff --git a/third_party/WebKit/Source/core/platform/PlatformMemoryInstrumentation.h b/third_party/WebKit/Source/core/platform/PlatformMemoryInstrumentation.h deleted file mode 100644 index 6c442198..0000000 --- a/third_party/WebKit/Source/core/platform/PlatformMemoryInstrumentation.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef PlatformMemoryInstrumentation_h -#define PlatformMemoryInstrumentation_h - -#include <wtf/MemoryInstrumentation.h> -#include <wtf/MemoryInstrumentationString.h> - -namespace WebCore { - -using WTF::MemoryClassInfo; -using WTF::MemoryObjectType; - -class PlatformMemoryTypes { -public: - static MemoryObjectType Image; - static MemoryObjectType Loader; - static MemoryObjectType Rendering; - static MemoryObjectType Layers; - - static MemoryObjectType Audio; - static MemoryObjectType AudioSharedData; -}; - -} // namespace WebCore - -#endif // !defined(PlatformMemoryInstrumentation_h) diff --git a/third_party/WebKit/Source/core/platform/ScrollableArea.cpp b/third_party/WebKit/Source/core/platform/ScrollableArea.cpp index 0f02cf0..bd89596 100644 --- a/third_party/WebKit/Source/core/platform/ScrollableArea.cpp +++ b/third_party/WebKit/Source/core/platform/ScrollableArea.cpp @@ -32,7 +32,6 @@ #include "config.h" #include "core/platform/ScrollableArea.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/ScrollAnimator.h" #include "core/platform/ScrollbarTheme.h" #include "core/platform/graphics/FloatPoint.h" @@ -404,10 +403,4 @@ IntPoint ScrollableArea::clampScrollPosition(const IntPoint& scrollPosition) con return scrollPosition.shrunkTo(maximumScrollPosition()).expandedTo(minimumScrollPosition()); } -void ScrollableArea::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this); - info.addMember(m_scrollAnimator, "scrollAnimator"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/platform/ScrollableArea.h b/third_party/WebKit/Source/core/platform/ScrollableArea.h index 30d020c..bdefcb6 100644 --- a/third_party/WebKit/Source/core/platform/ScrollableArea.h +++ b/third_party/WebKit/Source/core/platform/ScrollableArea.h @@ -173,8 +173,6 @@ public: virtual bool usesCompositedScrolling() const { return false; } virtual void updateNeedsCompositedScrolling() { } - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - // Convenience functions int scrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? scrollPosition().x() : scrollPosition().y(); } int minimumScrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? minimumScrollPosition().x() : minimumScrollPosition().y(); } diff --git a/third_party/WebKit/Source/core/platform/SharedBuffer.cpp b/third_party/WebKit/Source/core/platform/SharedBuffer.cpp index 0d9c948..fa83910 100644 --- a/third_party/WebKit/Source/core/platform/SharedBuffer.cpp +++ b/third_party/WebKit/Source/core/platform/SharedBuffer.cpp @@ -27,9 +27,7 @@ #include "config.h" #include "core/platform/SharedBuffer.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/PurgeableBuffer.h" -#include <wtf/MemoryInstrumentationVector.h> #include <wtf/PassOwnPtr.h> #include <wtf/unicode/Unicode.h> #include <wtf/unicode/UTF8.h> @@ -352,16 +350,6 @@ const Vector<char>& SharedBuffer::buffer() const return m_buffer; } -void SharedBuffer::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this); - info.addMember(m_buffer, "buffer"); - for (unsigned i = 0; i < m_segments.size(); ++i) - info.addRawBuffer(m_segments[i], segmentSize, "RawBufferSegment", "segment"); - info.addMember(m_segments, "segments"); - info.addMember(m_purgeableBuffer, "purgeableBuffer"); -} - unsigned SharedBuffer::getSomeData(const char*& someData, unsigned position) const { unsigned totalSize = size(); diff --git a/third_party/WebKit/Source/core/platform/SharedBuffer.h b/third_party/WebKit/Source/core/platform/SharedBuffer.h index e940a75..94adc29 100644 --- a/third_party/WebKit/Source/core/platform/SharedBuffer.h +++ b/third_party/WebKit/Source/core/platform/SharedBuffer.h @@ -89,8 +89,6 @@ public: // } unsigned getSomeData(const char*& data, unsigned position = 0) const; - void reportMemoryUsage(MemoryObjectInfo*) const; - void createPurgeableBuffer() const; // Creates an ArrayBuffer and copies this SharedBuffer's contents to that diff --git a/third_party/WebKit/Source/core/platform/audio/AudioArray.h b/third_party/WebKit/Source/core/platform/audio/AudioArray.h index b161cf2..3959361 100644 --- a/third_party/WebKit/Source/core/platform/audio/AudioArray.h +++ b/third_party/WebKit/Source/core/platform/audio/AudioArray.h @@ -142,14 +142,6 @@ public: memcpy(this->data() + start, sourceData, sizeof(T) * (end - start)); } - template<typename MemoryObjectInfo> - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - typename MemoryObjectInfo::ClassInfo info(memoryObjectInfo, this); - info.addRawBuffer(m_allocation, m_size * sizeof(T), "AudioArrayData", "allocation"); - info.ignoreMember(m_alignedData); - } - private: static T* alignedAddress(T* address, intptr_t alignment) { diff --git a/third_party/WebKit/Source/core/platform/audio/FFTFrame.cpp b/third_party/WebKit/Source/core/platform/audio/FFTFrame.cpp index 35d73b11..c553dd2 100644 --- a/third_party/WebKit/Source/core/platform/audio/FFTFrame.cpp +++ b/third_party/WebKit/Source/core/platform/audio/FFTFrame.cpp @@ -37,16 +37,10 @@ #endif #include "core/platform/Logging.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include <wtf/Complex.h> #include <wtf/MathExtras.h> -#include <wtf/MemoryObjectInfo.h> #include <wtf/OwnPtr.h> -#if !USE_ACCELERATE_FFT && USE(WEBAUDIO_FFMPEG) -void reportMemoryUsage(const RDFTContext* const&, WTF::MemoryObjectInfo*); -#endif // USE(WEBAUDIO_FFMPEG) - namespace WebCore { void FFTFrame::doPaddedFFT(const float* data, size_t dataSize) @@ -254,37 +248,6 @@ void FFTFrame::addConstantGroupDelay(double sampleFrameDelay) } } -void FFTFrame::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::AudioSharedData); -#if USE_ACCELERATE_FFT - info.addMember(m_frame, "frame"); - info.addMember(m_realData, "realData"); - info.addMember(m_imagData, "imagData"); -#else // !USE_ACCELERATE_FFT - -#if USE(WEBAUDIO_FFMPEG) - info.addMember(m_forwardContext, "forwardContext"); - info.addMember(m_inverseContext, "inverseContext"); - info.addMember(m_complexData, "complexData"); - info.addMember(m_realData, "realData"); - info.addMember(m_imagData, "imagData"); -#endif // USE(WEBAUDIO_FFMPEG) - -#if USE(WEBAUDIO_IPP) - int size = 0; - ippsDFTGetBufSize_R_32f(m_DFTSpec, &size); - info.addRawBuffer(m_buffer, size * sizeof(Ipp8u), "buffer"); - ippsDFTGetSize_R_32f(m_FFTSize, IPP_FFT_NODIV_BY_ANY, ippAlgHintFast, &size, 0, 0); - info.addRawBuffer(m_DFTSpec, size, "DFTSpec"); - info.addMember(m_complexData, "complexData"); - info.addMember(m_realData, "realData"); - info.addMember(m_imagData, "imagData"); -#endif // USE(WEBAUDIO_IPP) - -#endif // !USE_ACCELERATE_FFT -} - #ifndef NDEBUG void FFTFrame::print() { diff --git a/third_party/WebKit/Source/core/platform/audio/FFTFrame.h b/third_party/WebKit/Source/core/platform/audio/FFTFrame.h index 8c2cea4..5cd4e39 100644 --- a/third_party/WebKit/Source/core/platform/audio/FFTFrame.h +++ b/third_party/WebKit/Source/core/platform/audio/FFTFrame.h @@ -98,8 +98,6 @@ public: unsigned fftSize() const { return m_FFTSize; } unsigned log2FFTSize() const { return m_log2FFTSize; } - void reportMemoryUsage(MemoryObjectInfo*) const; - private: unsigned m_FFTSize; unsigned m_log2FFTSize; diff --git a/third_party/WebKit/Source/core/platform/audio/HRTFDatabase.cpp b/third_party/WebKit/Source/core/platform/audio/HRTFDatabase.cpp index 3a6b7f4..5bf5e1e 100644 --- a/third_party/WebKit/Source/core/platform/audio/HRTFDatabase.cpp +++ b/third_party/WebKit/Source/core/platform/audio/HRTFDatabase.cpp @@ -32,9 +32,7 @@ #include "core/platform/audio/HRTFDatabase.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/audio/HRTFElevation.h" -#include <wtf/MemoryInstrumentationVector.h> using namespace std; @@ -121,12 +119,6 @@ unsigned HRTFDatabase::indexFromElevationAngle(double elevationAngle) return elevationIndex; } -void HRTFDatabase::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::AudioSharedData); - info.addMember(m_elevations, "elevations"); -} - } // namespace WebCore #endif // ENABLE(WEB_AUDIO) diff --git a/third_party/WebKit/Source/core/platform/audio/HRTFDatabase.h b/third_party/WebKit/Source/core/platform/audio/HRTFDatabase.h index 2709fb4..2ffe359 100644 --- a/third_party/WebKit/Source/core/platform/audio/HRTFDatabase.h +++ b/third_party/WebKit/Source/core/platform/audio/HRTFDatabase.h @@ -59,8 +59,6 @@ public: // Number of elevations loaded from resource. static const unsigned NumberOfRawElevations; - void reportMemoryUsage(MemoryObjectInfo*) const; - private: explicit HRTFDatabase(float sampleRate); diff --git a/third_party/WebKit/Source/core/platform/audio/HRTFDatabaseLoader.cpp b/third_party/WebKit/Source/core/platform/audio/HRTFDatabaseLoader.cpp index ae98589..32b7128 100644 --- a/third_party/WebKit/Source/core/platform/audio/HRTFDatabaseLoader.cpp +++ b/third_party/WebKit/Source/core/platform/audio/HRTFDatabaseLoader.cpp @@ -32,10 +32,8 @@ #include "core/platform/audio/HRTFDatabaseLoader.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/audio/HRTFDatabase.h" #include "wtf/MainThread.h" -#include "wtf/MemoryInstrumentationHashMap.h" namespace WebCore { @@ -128,13 +126,6 @@ void HRTFDatabaseLoader::waitForLoaderThreadCompletion() m_databaseLoaderThread = 0; } -void HRTFDatabaseLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::AudioSharedData); - info.addMember(m_hrtfDatabase, "hrtfDatabase"); - info.addMember(s_loaderMap, "loaderMap", WTF::RetainingPointer); -} - } // namespace WebCore #endif // ENABLE(WEB_AUDIO) diff --git a/third_party/WebKit/Source/core/platform/audio/HRTFDatabaseLoader.h b/third_party/WebKit/Source/core/platform/audio/HRTFDatabaseLoader.h index fd520c1..e11178c 100644 --- a/third_party/WebKit/Source/core/platform/audio/HRTFDatabaseLoader.h +++ b/third_party/WebKit/Source/core/platform/audio/HRTFDatabaseLoader.h @@ -64,8 +64,6 @@ public: // Called in asynchronous loading thread. void load(); - void reportMemoryUsage(MemoryObjectInfo*) const; - private: // Both constructor and destructor must be called from the main thread. explicit HRTFDatabaseLoader(float sampleRate); diff --git a/third_party/WebKit/Source/core/platform/audio/HRTFElevation.cpp b/third_party/WebKit/Source/core/platform/audio/HRTFElevation.cpp index f072e99..12c337f 100644 --- a/third_party/WebKit/Source/core/platform/audio/HRTFElevation.cpp +++ b/third_party/WebKit/Source/core/platform/audio/HRTFElevation.cpp @@ -34,10 +34,8 @@ #include <math.h> #include <algorithm> -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/audio/AudioBus.h" #include "core/platform/audio/HRTFPanner.h" -#include <wtf/MemoryInstrumentationVector.h> #include <wtf/OwnPtr.h> using namespace std; @@ -336,13 +334,6 @@ void HRTFElevation::getKernelsFromAzimuth(double azimuthBlend, unsigned azimuthI frameDelayR = (1.0 - azimuthBlend) * frameDelayR + azimuthBlend * frameDelay2R; } -void HRTFElevation::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::AudioSharedData); - info.addMember(m_kernelListL, "kernelListL"); - info.addMember(m_kernelListR, "kernelListR"); -} - } // namespace WebCore #endif // ENABLE(WEB_AUDIO) diff --git a/third_party/WebKit/Source/core/platform/audio/HRTFElevation.h b/third_party/WebKit/Source/core/platform/audio/HRTFElevation.h index 0f60442..6a825a1 100644 --- a/third_party/WebKit/Source/core/platform/audio/HRTFElevation.h +++ b/third_party/WebKit/Source/core/platform/audio/HRTFElevation.h @@ -92,8 +92,6 @@ public: static bool calculateSymmetricKernelsForAzimuthElevation(int azimuth, int elevation, float sampleRate, const String& subjectName, RefPtr<HRTFKernel>& kernelL, RefPtr<HRTFKernel>& kernelR); - void reportMemoryUsage(MemoryObjectInfo*) const; - private: HRTFElevation(PassOwnPtr<HRTFKernelList> kernelListL, PassOwnPtr<HRTFKernelList> kernelListR, int elevation, float sampleRate) : m_kernelListL(kernelListL) diff --git a/third_party/WebKit/Source/core/platform/audio/HRTFKernel.cpp b/third_party/WebKit/Source/core/platform/audio/HRTFKernel.cpp index 6a0689b..7d22ec4 100644 --- a/third_party/WebKit/Source/core/platform/audio/HRTFKernel.cpp +++ b/third_party/WebKit/Source/core/platform/audio/HRTFKernel.cpp @@ -33,7 +33,6 @@ #include "core/platform/audio/HRTFKernel.h" #include "core/platform/FloatConversion.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/audio/AudioChannel.h" #include "core/platform/audio/FFTFrame.h" #include <wtf/MathExtras.h> @@ -132,12 +131,6 @@ PassRefPtr<HRTFKernel> HRTFKernel::createInterpolatedKernel(HRTFKernel* kernel1, return HRTFKernel::create(interpolatedFrame.release(), frameDelay, sampleRate1); } -void HRTFKernel::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::AudioSharedData); - info.addMember(m_fftFrame, "fftFrame"); -} - } // namespace WebCore #endif // ENABLE(WEB_AUDIO) diff --git a/third_party/WebKit/Source/core/platform/audio/HRTFKernel.h b/third_party/WebKit/Source/core/platform/audio/HRTFKernel.h index 0006ae1..087cecc 100644 --- a/third_party/WebKit/Source/core/platform/audio/HRTFKernel.h +++ b/third_party/WebKit/Source/core/platform/audio/HRTFKernel.h @@ -75,8 +75,6 @@ public: // Converts back into impulse-response form. PassOwnPtr<AudioChannel> createImpulseResponse(); - void reportMemoryUsage(MemoryObjectInfo*) const; - private: // Note: this is destructive on the passed in AudioChannel. HRTFKernel(AudioChannel*, size_t fftSize, float sampleRate); diff --git a/third_party/WebKit/Source/core/platform/audio/ffmpeg/FFTFrameFFMPEG.cpp b/third_party/WebKit/Source/core/platform/audio/ffmpeg/FFTFrameFFMPEG.cpp index 5b50612..fe177d9 100644 --- a/third_party/WebKit/Source/core/platform/audio/ffmpeg/FFTFrameFFMPEG.cpp +++ b/third_party/WebKit/Source/core/platform/audio/ffmpeg/FFTFrameFFMPEG.cpp @@ -34,7 +34,6 @@ #include "core/platform/audio/FFTFrame.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/audio/VectorMath.h" extern "C" { @@ -81,18 +80,6 @@ struct RDFTContextProxy { } -void reportMemoryUsage(const struct RDFTContext* const& object, WTF::MemoryObjectInfo* memoryObjectInfo) -{ - const RDFTContextProxy* proxyObject = reinterpret_cast<const RDFTContextProxy*>(object); - - WTF::MemoryClassInfo info(memoryObjectInfo, proxyObject, 0, sizeof(RDFTContextProxy)); - - // The size of buffers is counted the same way as it is counted in ff_rdft_init && ff_fft_init. - size_t count = 1 << (proxyObject->nbits - 1); - info.addRawBuffer(proxyObject->fft.revtab, count * sizeof(uint16_t), "FFTBuffer", "revtab"); - info.addRawBuffer(proxyObject->fft.tmpBuf, count * sizeof(FFTComplex), "FFTBuffer", "tmpBuf"); -} - namespace WebCore { const int kMaxFFTPow2Size = 24; diff --git a/third_party/WebKit/Source/core/platform/graphics/BitmapImage.cpp b/third_party/WebKit/Source/core/platform/graphics/BitmapImage.cpp index 5b6c81b..18e903c 100644 --- a/third_party/WebKit/Source/core/platform/graphics/BitmapImage.cpp +++ b/third_party/WebKit/Source/core/platform/graphics/BitmapImage.cpp @@ -27,7 +27,6 @@ #include "config.h" #include "core/platform/graphics/BitmapImage.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/Timer.h" #include "core/platform/graphics/FloatRect.h" #include "core/platform/graphics/GraphicsContextStateSaver.h" @@ -35,8 +34,6 @@ #include "core/platform/graphics/skia/NativeImageSkia.h" #include "core/platform/graphics/skia/SkiaUtils.h" #include "wtf/CurrentTime.h" -#include "wtf/MemoryInstrumentationVector.h" -#include "wtf/MemoryObjectInfo.h" #include "wtf/PassRefPtr.h" #include "wtf/Vector.h" #include "wtf/text/WTFString.h" @@ -660,21 +657,4 @@ Color BitmapImage::solidColor() const return m_solidColor; } -void BitmapImage::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); - memoryObjectInfo->setClassName("BitmapImage"); - Image::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_source, "source"); - info.addMember(m_frameTimer, "frameTimer"); - info.addMember(m_frames, "frames"); -} - -void FrameData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); - memoryObjectInfo->setClassName("FrameData"); - info.addMember(m_frame, "frame"); -} - } diff --git a/third_party/WebKit/Source/core/platform/graphics/BitmapImage.h b/third_party/WebKit/Source/core/platform/graphics/BitmapImage.h index 6ee322c..42a966c 100644 --- a/third_party/WebKit/Source/core/platform/graphics/BitmapImage.h +++ b/third_party/WebKit/Source/core/platform/graphics/BitmapImage.h @@ -77,8 +77,6 @@ public: // Returns whether there was cached image data to clear. bool clear(bool clearMetadata); - void reportMemoryUsage(MemoryObjectInfo*) const; - RefPtr<NativeImageSkia> m_frame; ImageOrientation m_orientation; float m_duration; @@ -137,8 +135,6 @@ public: virtual bool notSolidColor() OVERRIDE; #endif - void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: void updateSize() const; diff --git a/third_party/WebKit/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp b/third_party/WebKit/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp index b7bc272..f6e2136 100644 --- a/third_party/WebKit/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp +++ b/third_party/WebKit/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp @@ -26,7 +26,6 @@ #include "config.h" #include "core/platform/graphics/CrossfadeGeneratedImage.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/graphics/FloatRect.h" #include "core/platform/graphics/GraphicsContextStateSaver.h" #include "core/platform/graphics/ImageBuffer.h" @@ -108,12 +107,4 @@ void CrossfadeGeneratedImage::drawPattern(GraphicsContext* context, const FloatR imageBuffer->drawPattern(context, srcRect, scale, phase, compositeOp, dstRect); } -void CrossfadeGeneratedImage::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); - GeneratedImage::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_fromImage, "fromImage"); - info.addMember(m_toImage, "toImage"); -} - } diff --git a/third_party/WebKit/Source/core/platform/graphics/CrossfadeGeneratedImage.h b/third_party/WebKit/Source/core/platform/graphics/CrossfadeGeneratedImage.h index f6626ae..1f52692 100644 --- a/third_party/WebKit/Source/core/platform/graphics/CrossfadeGeneratedImage.h +++ b/third_party/WebKit/Source/core/platform/graphics/CrossfadeGeneratedImage.h @@ -50,8 +50,6 @@ public: virtual IntSize size() const { return m_crossfadeSize; } - void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - protected: virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, CompositeOperator, BlendMode) OVERRIDE; diff --git a/third_party/WebKit/Source/core/platform/graphics/GeneratedImage.cpp b/third_party/WebKit/Source/core/platform/graphics/GeneratedImage.cpp index 4b39063..bb7aa0b 100644 --- a/third_party/WebKit/Source/core/platform/graphics/GeneratedImage.cpp +++ b/third_party/WebKit/Source/core/platform/graphics/GeneratedImage.cpp @@ -31,7 +31,6 @@ #include "config.h" #include "core/platform/graphics/GeneratedImage.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/graphics/FloatSize.h" @@ -43,10 +42,4 @@ void GeneratedImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicRatio = FloatSize(); } -void GeneratedImage::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); - Image::reportMemoryUsage(memoryObjectInfo); -} - } diff --git a/third_party/WebKit/Source/core/platform/graphics/GeneratedImage.h b/third_party/WebKit/Source/core/platform/graphics/GeneratedImage.h index e852860..17eef2e 100644 --- a/third_party/WebKit/Source/core/platform/graphics/GeneratedImage.h +++ b/third_party/WebKit/Source/core/platform/graphics/GeneratedImage.h @@ -48,8 +48,6 @@ public: virtual void destroyDecodedData() OVERRIDE { } virtual unsigned decodedSize() const OVERRIDE { return 0; } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - protected: virtual void drawPattern(GraphicsContext*, const FloatRect&, const FloatSize&, const FloatPoint&, CompositeOperator, diff --git a/third_party/WebKit/Source/core/platform/graphics/GeneratorGeneratedImage.cpp b/third_party/WebKit/Source/core/platform/graphics/GeneratorGeneratedImage.cpp index 96ab49d..56031ad 100644 --- a/third_party/WebKit/Source/core/platform/graphics/GeneratorGeneratedImage.cpp +++ b/third_party/WebKit/Source/core/platform/graphics/GeneratorGeneratedImage.cpp @@ -26,7 +26,6 @@ #include "config.h" #include "core/platform/graphics/GeneratorGeneratedImage.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/graphics/FloatRect.h" #include "core/platform/graphics/GraphicsContextStateSaver.h" @@ -150,13 +149,4 @@ void GeneratorGeneratedImage::invalidateCacheTimerFired(DeferrableOneShotTimer<G m_cachedAdjustedSize = IntSize(); } -void GeneratorGeneratedImage::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); - GeneratedImage::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_gradient, "gradient"); - info.addMember(m_cachedImageBuffer, "cachedImageBuffer"); - info.addMember(m_cacheTimer, "cacheTimer"); -} - } diff --git a/third_party/WebKit/Source/core/platform/graphics/GeneratorGeneratedImage.h b/third_party/WebKit/Source/core/platform/graphics/GeneratorGeneratedImage.h index 3f78858..eeac3f1 100644 --- a/third_party/WebKit/Source/core/platform/graphics/GeneratorGeneratedImage.h +++ b/third_party/WebKit/Source/core/platform/graphics/GeneratorGeneratedImage.h @@ -50,8 +50,6 @@ public: m_cacheTimer.stop(); } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - protected: virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, CompositeOperator, BlendMode) OVERRIDE; diff --git a/third_party/WebKit/Source/core/platform/graphics/GraphicsContextAnnotation.cpp b/third_party/WebKit/Source/core/platform/graphics/GraphicsContextAnnotation.cpp index 425a83d..0a8c387 100644 --- a/third_party/WebKit/Source/core/platform/graphics/GraphicsContextAnnotation.cpp +++ b/third_party/WebKit/Source/core/platform/graphics/GraphicsContextAnnotation.cpp @@ -35,6 +35,7 @@ #include "core/rendering/PaintInfo.h" #include "core/rendering/PaintPhase.h" #include "core/rendering/RenderObject.h" +#include "wtf/text/StringBuilder.h" namespace { diff --git a/third_party/WebKit/Source/core/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/core/platform/graphics/GraphicsLayer.cpp index b5d0472..53ba337 100644 --- a/third_party/WebKit/Source/core/platform/graphics/GraphicsLayer.cpp +++ b/third_party/WebKit/Source/core/platform/graphics/GraphicsLayer.cpp @@ -29,7 +29,6 @@ #include "SkImageFilter.h" #include "SkMatrix44.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/ScrollableArea.h" #include "core/platform/graphics/FloatPoint.h" #include "core/platform/graphics/FloatRect.h" @@ -46,8 +45,6 @@ #include "wtf/CurrentTime.h" #include "wtf/HashMap.h" #include "wtf/HashSet.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/text/CString.h" #include "wtf/text/StringBuilder.h" #include "wtf/text/StringHash.h" @@ -895,26 +892,6 @@ String GraphicsLayer::layerTreeAsText(LayerTreeFlags flags) const return ts.release(); } -void GraphicsLayer::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Layers); - info.addMember(m_children, "children"); - info.addMember(m_parent, "parent"); - info.addMember(m_maskLayer, "maskLayer"); - info.addMember(m_replicaLayer, "replicaLayer"); - info.addMember(m_replicatedLayer, "replicatedLayer"); - info.ignoreMember(m_client); - info.addMember(m_name, "name"); - info.addMember(m_nameBase, "nameBase"); - info.addMember(m_layer, "layer"); - info.addMember(m_imageLayer, "imageLayer"); - info.addMember(m_contentsLayer, "contentsLayer"); - info.addMember(m_linkHighlight, "linkHighlight"); - info.addMember(m_opaqueRectTrackingContentLayerDelegate, "opaqueRectTrackingContentLayerDelegate"); - info.addMember(m_animationIdMap, "animationIdMap"); - info.addMember(m_scrollableArea, "scrollableArea"); -} - void GraphicsLayer::setName(const String& name) { m_nameBase = name; diff --git a/third_party/WebKit/Source/core/platform/graphics/GraphicsLayer.h b/third_party/WebKit/Source/core/platform/graphics/GraphicsLayer.h index ab10b80..ef40e45 100644 --- a/third_party/WebKit/Source/core/platform/graphics/GraphicsLayer.h +++ b/third_party/WebKit/Source/core/platform/graphics/GraphicsLayer.h @@ -419,8 +419,6 @@ public: // Exposed for tests. FIXME - name is too similar to contentLayer(), very error prone. WebKit::WebLayer* contentsLayer() const { return m_contentsLayer; } - void reportMemoryUsage(MemoryObjectInfo*) const; - static void registerContentsLayer(WebKit::WebLayer*); static void unregisterContentsLayer(WebKit::WebLayer*); diff --git a/third_party/WebKit/Source/core/platform/graphics/Image.cpp b/third_party/WebKit/Source/core/platform/graphics/Image.cpp index f1d3de4..a47afaf 100644 --- a/third_party/WebKit/Source/core/platform/graphics/Image.cpp +++ b/third_party/WebKit/Source/core/platform/graphics/Image.cpp @@ -30,7 +30,6 @@ #include <math.h> #include "core/platform/Length.h" #include "core/platform/MIMETypeRegistry.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/SharedBuffer.h" #include "core/platform/graphics/BitmapImage.h" #include "core/platform/graphics/GraphicsContext.h" @@ -38,7 +37,6 @@ #include "core/platform/graphics/GraphicsTypes.h" #include "core/platform/graphics/IntRect.h" #include "wtf/MainThread.h" -#include "wtf/MemoryObjectInfo.h" #include "wtf/StdLibExtras.h" namespace WebCore { @@ -214,12 +212,4 @@ void Image::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsic intrinsicHeight = Length(intrinsicRatio.height(), Fixed); } -void Image::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); - memoryObjectInfo->setClassName("Image"); - info.addMember(m_encodedImageData, "encodedImageData"); - info.addWeakPointer(m_imageObserver); -} - } diff --git a/third_party/WebKit/Source/core/platform/graphics/Image.h b/third_party/WebKit/Source/core/platform/graphics/Image.h index ec42980..85c30d2 100644 --- a/third_party/WebKit/Source/core/platform/graphics/Image.h +++ b/third_party/WebKit/Source/core/platform/graphics/Image.h @@ -119,8 +119,6 @@ public: virtual bool notSolidColor() { return true; } #endif - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - protected: Image(ImageObserver* = 0); diff --git a/third_party/WebKit/Source/core/platform/graphics/ImageBuffer.cpp b/third_party/WebKit/Source/core/platform/graphics/ImageBuffer.cpp index d130b56..12e3cbc 100644 --- a/third_party/WebKit/Source/core/platform/graphics/ImageBuffer.cpp +++ b/third_party/WebKit/Source/core/platform/graphics/ImageBuffer.cpp @@ -35,7 +35,6 @@ #include "core/html/ImageData.h" #include "core/platform/MIMETypeRegistry.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/graphics/BitmapImage.h" #include "core/platform/graphics/Extensions3D.h" #include "core/platform/graphics/GraphicsContext.h" @@ -43,7 +42,6 @@ #include "core/platform/graphics/IntRect.h" #include "core/platform/graphics/chromium/Canvas2DLayerBridge.h" #include "core/platform/graphics/gpu/SharedGraphicsContext3D.h" -#include "core/platform/graphics/skia/MemoryInstrumentationSkia.h" #include "core/platform/graphics/skia/NativeImageSkia.h" #include "core/platform/graphics/skia/SkiaUtils.h" #include "core/platform/image-encoders/skia/JPEGImageEncoder.h" @@ -487,12 +485,4 @@ String ImageDataToDataURL(const ImageData& imageData, const String& mimeType, co return "data:" + mimeType + ";base64," + base64Data; } -void ImageBuffer::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); - info.addMember(m_canvas, "canvas"); - info.addMember(m_context, "context"); - info.addMember(m_layerBridge, "layerBridge"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/platform/graphics/ImageBuffer.h b/third_party/WebKit/Source/core/platform/graphics/ImageBuffer.h index fd96acf..bbbb183 100644 --- a/third_party/WebKit/Source/core/platform/graphics/ImageBuffer.h +++ b/third_party/WebKit/Source/core/platform/graphics/ImageBuffer.h @@ -130,8 +130,6 @@ public: // Extensions3D::canUseCopyTextureCHROMIUM(). bool copyToPlatformTexture(GraphicsContext3D&, Platform3DObject, GC3Denum, GC3Denum, GC3Dint, bool, bool); - void reportMemoryUsage(MemoryObjectInfo*) const; - private: void draw(GraphicsContext*, const FloatRect&, const FloatRect& = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false); void drawPattern(GraphicsContext*, const FloatRect&, const FloatSize&, const FloatPoint&, CompositeOperator, const FloatRect&); diff --git a/third_party/WebKit/Source/core/platform/graphics/ImageSource.cpp b/third_party/WebKit/Source/core/platform/graphics/ImageSource.cpp index 0340650..66b79b0 100644 --- a/third_party/WebKit/Source/core/platform/graphics/ImageSource.cpp +++ b/third_party/WebKit/Source/core/platform/graphics/ImageSource.cpp @@ -28,10 +28,10 @@ #include "config.h" #include "core/platform/graphics/ImageSource.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/graphics/ImageOrientation.h" #include "core/platform/graphics/chromium/DeferredImageDecoder.h" #include "core/platform/image-decoders/ImageDecoder.h" +#include "wtf/PassOwnPtr.h" #include "wtf/PassRefPtr.h" namespace WebCore { @@ -172,10 +172,4 @@ unsigned ImageSource::frameBytesAtIndex(size_t index) const return m_decoder->frameBytesAtIndex(index); } -void ImageSource::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); - info.addMember(m_decoder, "decoder"); -} - } diff --git a/third_party/WebKit/Source/core/platform/graphics/ImageSource.h b/third_party/WebKit/Source/core/platform/graphics/ImageSource.h index f711871..32f523c 100644 --- a/third_party/WebKit/Source/core/platform/graphics/ImageSource.h +++ b/third_party/WebKit/Source/core/platform/graphics/ImageSource.h @@ -123,8 +123,6 @@ public: // decoded then return 0. unsigned frameBytesAtIndex(size_t) const; - void reportMemoryUsage(MemoryObjectInfo*) const; - private: OwnPtr<DeferredImageDecoder> m_decoder; diff --git a/third_party/WebKit/Source/core/platform/graphics/skia/MemoryInstrumentationSkia.cpp b/third_party/WebKit/Source/core/platform/graphics/skia/MemoryInstrumentationSkia.cpp deleted file mode 100644 index fae9cee..0000000 --- a/third_party/WebKit/Source/core/platform/graphics/skia/MemoryInstrumentationSkia.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "core/platform/graphics/skia/MemoryInstrumentationSkia.h" - -#include "SkBitmap.h" -#include "SkCanvas.h" -#include "SkDevice.h" -#include "SkPixelRef.h" -#include "core/platform/PlatformMemoryInstrumentation.h" -#include <wtf/MemoryObjectInfo.h> - -void reportMemoryUsage(const SkBitmap* const& image, WTF::MemoryObjectInfo* memoryObjectInfo) -{ - WTF::MemoryClassInfo info(memoryObjectInfo, image); - memoryObjectInfo->setClassName("SkBitmap"); - SkPixelRef* pixelRef = image->pixelRef(); - info.addMember(pixelRef, "pixelRef"); - if (pixelRef) - info.addRawBuffer(pixelRef->pixels(), image->getSize(), "Pixels", "pixelRef"); -} - -void reportMemoryUsage(const SkDevice* const& device, WTF::MemoryObjectInfo* memoryObjectInfo) -{ - WTF::MemoryClassInfo info(memoryObjectInfo, device); - info.addMember(const_cast<SkDevice*>(device)->accessBitmap(false), "bitmap", WTF::RetainingPointer); -} - -void reportMemoryUsage(const SkCanvas* const& canvas, WTF::MemoryObjectInfo* memoryObjectInfo) -{ - WTF::MemoryClassInfo info(memoryObjectInfo, canvas); - info.addMember(canvas->getDevice(), "canvas", WTF::RetainingPointer); -} diff --git a/third_party/WebKit/Source/core/platform/graphics/skia/MemoryInstrumentationSkia.h b/third_party/WebKit/Source/core/platform/graphics/skia/MemoryInstrumentationSkia.h deleted file mode 100644 index 7dac63f..0000000 --- a/third_party/WebKit/Source/core/platform/graphics/skia/MemoryInstrumentationSkia.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MemoryInstrumentationSkia_h -#define MemoryInstrumentationSkia_h - -#include "core/platform/PlatformMemoryInstrumentation.h" - -class SkBitmap; -class SkDevice; -class SkCanvas; - -void reportMemoryUsage(const SkBitmap* const&, WTF::MemoryObjectInfo*); -void reportMemoryUsage(const SkDevice* const&, WTF::MemoryObjectInfo*); -void reportMemoryUsage(const SkCanvas* const&, WTF::MemoryObjectInfo*); - -#endif // !defined(MemoryInstrumentationSkia_h) diff --git a/third_party/WebKit/Source/core/platform/graphics/skia/NativeImageSkia.cpp b/third_party/WebKit/Source/core/platform/graphics/skia/NativeImageSkia.cpp index bcb68cf..68025e8 100644 --- a/third_party/WebKit/Source/core/platform/graphics/skia/NativeImageSkia.cpp +++ b/third_party/WebKit/Source/core/platform/graphics/skia/NativeImageSkia.cpp @@ -33,8 +33,6 @@ #include "skia/ext/image_operations.h" #include "core/platform/PlatformInstrumentation.h" -#include "core/platform/PlatformMemoryInstrumentation.h" -#include "core/platform/graphics/skia/MemoryInstrumentationSkia.h" #include "core/platform/graphics/skia/NativeImageSkia.h" #include "core/platform/graphics/chromium/DeferredImageDecoder.h" @@ -176,12 +174,4 @@ SkIRect NativeImageSkia::CachedImageInfo::rectInSubset(const SkIRect& otherScale return subsetRect; } -void NativeImageSkia::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this); - info.addMember(m_image, "image"); - info.addMember(m_resizedImage, "resizedImage"); - info.addMember(m_cachedImageInfo, "cachedImageInfo"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/platform/graphics/skia/NativeImageSkia.h b/third_party/WebKit/Source/core/platform/graphics/skia/NativeImageSkia.h index 1faeb5a..756fce8 100644 --- a/third_party/WebKit/Source/core/platform/graphics/skia/NativeImageSkia.h +++ b/third_party/WebKit/Source/core/platform/graphics/skia/NativeImageSkia.h @@ -102,8 +102,6 @@ public: // Rectangle of the subset in the scaled image. SkBitmap resizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const; - void reportMemoryUsage(MemoryObjectInfo*) const; - private: NativeImageSkia(); diff --git a/third_party/WebKit/Source/core/platform/image-decoders/ImageDecoder.cpp b/third_party/WebKit/Source/core/platform/image-decoders/ImageDecoder.cpp index fd2da24..917161f 100644 --- a/third_party/WebKit/Source/core/platform/image-decoders/ImageDecoder.cpp +++ b/third_party/WebKit/Source/core/platform/image-decoders/ImageDecoder.cpp @@ -21,7 +21,6 @@ #include "config.h" #include "core/platform/image-decoders/ImageDecoder.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/SharedBuffer.h" #include "core/platform/image-decoders/bmp/BMPImageDecoder.h" #include "core/platform/image-decoders/gif/GIFImageDecoder.h" @@ -29,8 +28,7 @@ #include "core/platform/image-decoders/jpeg/JPEGImageDecoder.h" #include "core/platform/image-decoders/png/PNGImageDecoder.h" #include "core/platform/image-decoders/webp/WEBPImageDecoder.h" - -#include <wtf/MemoryInstrumentationVector.h> +#include "wtf/PassOwnPtr.h" namespace WebCore { @@ -133,13 +131,6 @@ unsigned ImageDecoder::frameBytesAtIndex(size_t index) const return m_size.area() * sizeof(ImageFrame::PixelData); } -void ImageDecoder::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); - info.addMember(m_data, "data"); - info.addMember(m_frameBufferCache, "frameBufferCache"); -} - size_t ImageDecoder::clearCacheExceptFrame(size_t clearExceptFrame) { // Don't clear if there are no frames or only one frame. diff --git a/third_party/WebKit/Source/core/platform/image-decoders/ImageDecoder.h b/third_party/WebKit/Source/core/platform/image-decoders/ImageDecoder.h index b609d50..3249e5e 100644 --- a/third_party/WebKit/Source/core/platform/image-decoders/ImageDecoder.h +++ b/third_party/WebKit/Source/core/platform/image-decoders/ImageDecoder.h @@ -117,7 +117,6 @@ namespace WebCore { bool premultiplyAlpha() const { return m_premultiplyAlpha; } SkBitmap::Allocator* allocator() const { return m_allocator; } const SkBitmap& getSkBitmap() const { return m_bitmap->bitmap(); } - void reportMemoryUsage(MemoryObjectInfo*) const; size_t requiredPreviousFrameIndex() const { @@ -378,8 +377,6 @@ namespace WebCore { // and returns true. Otherwise returns false. virtual bool hotSpot(IntPoint&) const { return false; } - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - virtual void setMemoryAllocator(SkBitmap::Allocator* allocator) { // FIXME: this doesn't work for images with multiple frames. diff --git a/third_party/WebKit/Source/core/platform/image-decoders/ImageFrame.cpp b/third_party/WebKit/Source/core/platform/image-decoders/ImageFrame.cpp index 6c9c073..db762c9 100644 --- a/third_party/WebKit/Source/core/platform/image-decoders/ImageFrame.cpp +++ b/third_party/WebKit/Source/core/platform/image-decoders/ImageFrame.cpp @@ -27,7 +27,6 @@ #include "config.h" #include "core/platform/image-decoders/ImageDecoder.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/graphics/skia/NativeImageSkia.h" #include "wtf/PassRefPtr.h" @@ -146,12 +145,6 @@ void ImageFrame::setStatus(FrameStatus status) } } -void ImageFrame::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); - info.addMember(m_bitmap, "bitmap"); -} - void ImageFrame::zeroFillFrameRect(const IntRect& rect) { if (rect.isEmpty()) diff --git a/third_party/WebKit/Source/core/platform/network/FormData.cpp b/third_party/WebKit/Source/core/platform/network/FormData.cpp index 488bb85..6967f83 100644 --- a/third_party/WebKit/Source/core/platform/network/FormData.cpp +++ b/third_party/WebKit/Source/core/platform/network/FormData.cpp @@ -25,10 +25,8 @@ #include "core/fileapi/File.h" #include "core/html/FormDataList.h" #include "core/platform/FileSystem.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/network/BlobData.h" #include "core/platform/network/FormDataBuilder.h" -#include "wtf/MemoryInstrumentationVector.h" #include "wtf/text/TextEncoding.h" namespace WebCore { @@ -262,19 +260,4 @@ String FormData::flattenToString() const return Latin1Encoding().decode(reinterpret_cast<const char*>(bytes.data()), bytes.size()); } -void FormData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Loader); - info.addMember(m_boundary, "boundary"); - info.addMember(m_elements, "elements"); -} - -void FormDataElement::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Loader); - info.addMember(m_data, "data"); - info.addMember(m_filename, "filename"); - info.addMember(m_url, "url"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/platform/network/FormData.h b/third_party/WebKit/Source/core/platform/network/FormData.h index 9d928c6..d524a73 100644 --- a/third_party/WebKit/Source/core/platform/network/FormData.h +++ b/third_party/WebKit/Source/core/platform/network/FormData.h @@ -44,8 +44,6 @@ public: explicit FormDataElement(const KURL& blobURL) : m_type(encodedBlob), m_url(blobURL) { } FormDataElement(const KURL& url, long long start, long long length, double expectedFileModificationTime) : m_type(encodedURL), m_url(url), m_fileStart(start), m_fileLength(length), m_expectedFileModificationTime(expectedFileModificationTime) { } - void reportMemoryUsage(MemoryObjectInfo*) const; - enum Type { data, encodedFile @@ -127,8 +125,6 @@ public: bool containsPasswordData() const { return m_containsPasswordData; } void setContainsPasswordData(bool containsPasswordData) { m_containsPasswordData = containsPasswordData; } - void reportMemoryUsage(MemoryObjectInfo*) const; - static EncodingType parseEncodingType(const String& type) { if (equalIgnoringCase(type, "text/plain")) diff --git a/third_party/WebKit/Source/core/platform/network/ResourceRequest.cpp b/third_party/WebKit/Source/core/platform/network/ResourceRequest.cpp index 6390601..670d1fa 100644 --- a/third_party/WebKit/Source/core/platform/network/ResourceRequest.cpp +++ b/third_party/WebKit/Source/core/platform/network/ResourceRequest.cpp @@ -27,10 +27,7 @@ #include "config.h" #include "core/platform/network/ResourceRequest.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/network/ResourceRequest.h" -#include <wtf/MemoryInstrumentationHashMap.h> -#include <wtf/MemoryInstrumentationVector.h> namespace WebCore { @@ -307,17 +304,6 @@ bool ResourceRequest::isConditional() const m_httpHeaderFields.contains("If-Unmodified-Since")); } -void ResourceRequest::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Loader); - info.addMember(m_url, "url"); - info.addMember(m_firstPartyForCookies, "firstPartyForCookies"); - info.addMember(m_httpMethod, "httpMethod"); - info.addMember(m_httpHeaderFields, "httpHeaderFields"); - info.addMember(m_httpBody, "httpBody"); - info.addMember(m_extraData, "extraData"); -} - double ResourceRequest::defaultTimeoutInterval() { return s_defaultTimeoutInterval; diff --git a/third_party/WebKit/Source/core/platform/network/ResourceRequest.h b/third_party/WebKit/Source/core/platform/network/ResourceRequest.h index cf189e1..456d7c0 100644 --- a/third_party/WebKit/Source/core/platform/network/ResourceRequest.h +++ b/third_party/WebKit/Source/core/platform/network/ResourceRequest.h @@ -205,8 +205,6 @@ namespace WebCore { TargetType targetType() const { return m_targetType; } void setTargetType(TargetType type) { m_targetType = type; } - void reportMemoryUsage(MemoryObjectInfo*) const; - static double defaultTimeoutInterval(); // May return 0 when using platform default. static void setDefaultTimeoutInterval(double); diff --git a/third_party/WebKit/Source/core/platform/network/ResourceResponse.cpp b/third_party/WebKit/Source/core/platform/network/ResourceResponse.cpp index c6383b5..08fc0b1 100644 --- a/third_party/WebKit/Source/core/platform/network/ResourceResponse.cpp +++ b/third_party/WebKit/Source/core/platform/network/ResourceResponse.cpp @@ -27,12 +27,10 @@ #include "config.h" #include "core/platform/network/ResourceResponse.h" -#include "core/platform/PlatformMemoryInstrumentation.h" #include "core/platform/network/HTTPParsers.h" #include "core/platform/network/ResourceResponse.h" #include <wtf/CurrentTime.h> #include <wtf/MathExtras.h> -#include <wtf/MemoryInstrumentationHashMap.h> #include <wtf/StdLibExtras.h> namespace WebCore { @@ -539,19 +537,6 @@ void ResourceResponse::setResourceLoadInfo(PassRefPtr<ResourceLoadInfo> loadInfo m_resourceLoadInfo = loadInfo; } -void ResourceResponse::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Loader); - info.addMember(m_url, "url"); - info.addMember(m_mimeType, "mimeType"); - info.addMember(m_textEncodingName, "textEncodingName"); - info.addMember(m_suggestedFilename, "suggestedFilename"); - info.addMember(m_httpStatusText, "httpStatusText"); - info.addMember(m_httpHeaderFields, "httpHeaderFields"); - info.addMember(m_resourceLoadTiming, "resourceLoadTiming"); - info.addMember(m_resourceLoadInfo, "resourceLoadInfo"); -} - bool ResourceResponse::compare(const ResourceResponse& a, const ResourceResponse& b) { if (a.isNull() != b.isNull()) diff --git a/third_party/WebKit/Source/core/platform/network/ResourceResponse.h b/third_party/WebKit/Source/core/platform/network/ResourceResponse.h index 1f6cb75..e2d24bb 100644 --- a/third_party/WebKit/Source/core/platform/network/ResourceResponse.h +++ b/third_party/WebKit/Source/core/platform/network/ResourceResponse.h @@ -186,8 +186,6 @@ public: return 1280; } - void reportMemoryUsage(MemoryObjectInfo*) const; - static bool compare(const ResourceResponse&, const ResourceResponse&); private: diff --git a/third_party/WebKit/Source/core/rendering/InlineBox.cpp b/third_party/WebKit/Source/core/rendering/InlineBox.cpp index 01b0b0a..73d7305 100644 --- a/third_party/WebKit/Source/core/rendering/InlineBox.cpp +++ b/third_party/WebKit/Source/core/rendering/InlineBox.cpp @@ -20,7 +20,6 @@ #include "config.h" #include "core/rendering/InlineBox.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/platform/graphics/FontMetrics.h" #include "core/rendering/InlineFlowBox.h" #include "core/rendering/PaintInfo.h" @@ -389,17 +388,6 @@ LayoutPoint InlineBox::flipForWritingMode(const LayoutPoint& point) return root()->block()->flipForWritingMode(point); } -void InlineBox::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Rendering); - info.addMember(m_next, "next"); - info.addMember(m_prev, "prev"); - info.addMember(m_parent, "parent"); - info.addMember(m_renderer, "renderer"); - - info.setCustomAllocation(true); -} - } // namespace WebCore #ifndef NDEBUG diff --git a/third_party/WebKit/Source/core/rendering/InlineBox.h b/third_party/WebKit/Source/core/rendering/InlineBox.h index a7025cf..0f9d0f7 100644 --- a/third_party/WebKit/Source/core/rendering/InlineBox.h +++ b/third_party/WebKit/Source/core/rendering/InlineBox.h @@ -301,8 +301,6 @@ public: bool dirOverride() const { return m_bitfields.dirOverride(); } void setDirOverride(bool dirOverride) { m_bitfields.setDirOverride(dirOverride); } - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - private: InlineBox* m_next; // The next element on the same line as us. InlineBox* m_prev; // The previous element on the same line as us. diff --git a/third_party/WebKit/Source/core/rendering/InlineFlowBox.cpp b/third_party/WebKit/Source/core/rendering/InlineFlowBox.cpp index 040faa7..1d187f5 100644 --- a/third_party/WebKit/Source/core/rendering/InlineFlowBox.cpp +++ b/third_party/WebKit/Source/core/rendering/InlineFlowBox.cpp @@ -22,7 +22,6 @@ #include "CSSPropertyNames.h" #include "core/dom/Document.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/platform/graphics/Font.h" #include "core/platform/graphics/GraphicsContextStateSaver.h" #include "core/rendering/HitTestResult.h" @@ -1642,15 +1641,4 @@ void InlineFlowBox::checkConsistency() const #endif -void InlineFlowBox::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Rendering); - InlineBox::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_overflow, "overflow"); - info.addMember(m_firstChild, "firstChild"); - info.addMember(m_lastChild, "lastChild"); - info.addMember(m_prevLineBox, "prevLineBox"); - info.addMember(m_nextLineBox, "nextLineBox"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/InlineFlowBox.h b/third_party/WebKit/Source/core/rendering/InlineFlowBox.h index 767d8e9..a858edc 100644 --- a/third_party/WebKit/Source/core/rendering/InlineFlowBox.h +++ b/third_party/WebKit/Source/core/rendering/InlineFlowBox.h @@ -299,8 +299,6 @@ public: parent()->clearDescendantsHaveSameLineHeightAndBaseline(); } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE FINAL; - private: void addBoxShadowVisualOverflow(LayoutRect& logicalVisualOverflow); void addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow); diff --git a/third_party/WebKit/Source/core/rendering/InlineTextBox.cpp b/third_party/WebKit/Source/core/rendering/InlineTextBox.cpp index c016016..8a8c594 100644 --- a/third_party/WebKit/Source/core/rendering/InlineTextBox.cpp +++ b/third_party/WebKit/Source/core/rendering/InlineTextBox.cpp @@ -27,7 +27,6 @@ #include "core/dom/DocumentMarkerController.h" #include "core/dom/RenderedDocumentMarker.h" #include "core/dom/Text.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/editing/Editor.h" #include "core/page/Frame.h" #include "core/page/Page.h" @@ -1560,12 +1559,4 @@ void InlineTextBox::showBox(int printedCharacters) const #endif -void InlineTextBox::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Rendering); - InlineBox::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_prevTextBox, "prevTextBox"); - info.addMember(m_nextTextBox, "nextTextBox"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/InlineTextBox.h b/third_party/WebKit/Source/core/rendering/InlineTextBox.h index 5d05b4e..78b5038 100644 --- a/third_party/WebKit/Source/core/rendering/InlineTextBox.h +++ b/third_party/WebKit/Source/core/rendering/InlineTextBox.h @@ -102,8 +102,6 @@ public: virtual const char* boxName() const; #endif - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE FINAL; - private: LayoutUnit selectionTop(); LayoutUnit selectionBottom(); diff --git a/third_party/WebKit/Source/core/rendering/RenderBlock.cpp b/third_party/WebKit/Source/core/rendering/RenderBlock.cpp index 5d04032..f535ada 100644 --- a/third_party/WebKit/Source/core/rendering/RenderBlock.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderBlock.cpp @@ -29,7 +29,6 @@ #include "core/dom/Document.h" #include "core/dom/Element.h" #include "core/dom/OverflowEvent.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/dom/shadow/ShadowRoot.h" #include "core/editing/Editor.h" #include "core/editing/FrameSelection.h" @@ -64,9 +63,6 @@ #include "core/rendering/shapes/ShapeOutsideInfo.h" #include "core/rendering/svg/SVGTextRunRenderingContext.h" #include <wtf/StdLibExtras.h> -#include <wtf/MemoryInstrumentationHashMap.h> -#include <wtf/MemoryInstrumentationHashSet.h> -#include <wtf/MemoryInstrumentationListHashSet.h> #include <wtf/TemporaryChange.h> using namespace std; @@ -8251,25 +8247,4 @@ String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl #endif -void RenderBlock::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - RenderBox::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_rareData, "rareData"); - info.addMember(m_children, "children"); - info.addMember(m_lineBoxes, "lineBoxes"); -} - -void RenderBlock::reportStaticMembersMemoryUsage(MemoryInstrumentation* memoryInstrumentation) -{ - memoryInstrumentation->addRootObject(gColumnInfoMap, WebCoreMemoryTypes::RenderingStructures); - memoryInstrumentation->addRootObject(gPositionedDescendantsMap, WebCoreMemoryTypes::RenderingStructures); - memoryInstrumentation->addRootObject(gPercentHeightDescendantsMap, WebCoreMemoryTypes::RenderingStructures); - memoryInstrumentation->addRootObject(gPositionedContainerMap, WebCoreMemoryTypes::RenderingStructures); - memoryInstrumentation->addRootObject(gPercentHeightContainerMap, WebCoreMemoryTypes::RenderingStructures); - memoryInstrumentation->addRootObject(gFloatingObjectContainerMap, WebCoreMemoryTypes::RenderingStructures); - memoryInstrumentation->addRootObject(gFloatingObjectMap, WebCoreMemoryTypes::RenderingStructures); - memoryInstrumentation->addRootObject(gDelayedUpdateScrollInfoSet, WebCoreMemoryTypes::RenderingStructures); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/RenderBlock.h b/third_party/WebKit/Source/core/rendering/RenderBlock.h index d58c2748..52fcaf6 100644 --- a/third_party/WebKit/Source/core/rendering/RenderBlock.h +++ b/third_party/WebKit/Source/core/rendering/RenderBlock.h @@ -460,9 +460,6 @@ public: ShapeInsideInfo* layoutShapeInsideInfo() const; bool allowsShapeInsideInfoSharing() const { return !isInline() && !isFloating(); } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - static void reportStaticMembersMemoryUsage(MemoryInstrumentation*); - protected: virtual void willBeDestroyed(); diff --git a/third_party/WebKit/Source/core/rendering/RenderBox.cpp b/third_party/WebKit/Source/core/rendering/RenderBox.cpp index 99509170..30e8eb9 100644 --- a/third_party/WebKit/Source/core/rendering/RenderBox.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderBox.cpp @@ -30,7 +30,6 @@ #include <algorithm> #include "HTMLNames.h" #include "core/dom/Document.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/editing/htmlediting.h" #include "core/html/HTMLElement.h" #include "core/html/HTMLFrameOwnerElement.h" @@ -56,16 +55,9 @@ #include "core/rendering/RenderTableCell.h" #include "core/rendering/RenderTheme.h" #include "core/rendering/RenderView.h" -#include <wtf/MemoryInstrumentationHashMap.h> using namespace std; -namespace WTF { -template<> struct SequenceMemoryInstrumentationTraits<WebCore::LayoutUnit> { - template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&) { } -}; -} - namespace WebCore { using namespace HTMLNames; @@ -4642,20 +4634,4 @@ RenderObject* RenderBox::splitAnonymousBoxesAroundChild(RenderObject* beforeChil return beforeChild; } -void RenderBox::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - RenderBoxModelObject::reportMemoryUsage(memoryObjectInfo); - info.addWeakPointer(m_inlineBoxWrapper); - info.addMember(m_overflow, "overflow"); -} - -void RenderBox::reportStaticMembersMemoryUsage(MemoryInstrumentation* memoryInstrumentation) -{ - memoryInstrumentation->addRootObject(gOverrideHeightMap, WebCoreMemoryTypes::RenderingStructures); - memoryInstrumentation->addRootObject(gOverrideWidthMap, WebCoreMemoryTypes::RenderingStructures); - memoryInstrumentation->addRootObject(gOverrideContainingBlockLogicalHeightMap, WebCoreMemoryTypes::RenderingStructures); - memoryInstrumentation->addRootObject(gOverrideContainingBlockLogicalWidthMap, WebCoreMemoryTypes::RenderingStructures); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/RenderBox.h b/third_party/WebKit/Source/core/rendering/RenderBox.h index 2691dc9..bc62793 100644 --- a/third_party/WebKit/Source/core/rendering/RenderBox.h +++ b/third_party/WebKit/Source/core/rendering/RenderBox.h @@ -576,9 +576,6 @@ public: bool hasSameDirectionAs(const RenderBox* object) const { return style()->direction() == object->style()->direction(); } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - static void reportStaticMembersMemoryUsage(MemoryInstrumentation*); - ShapeOutsideInfo* shapeOutsideInfo() const { return isFloatingWithShapeOutside() && ShapeOutsideInfo::isEnabledFor(this) ? ShapeOutsideInfo::info(this) : 0; diff --git a/third_party/WebKit/Source/core/rendering/RenderFrameSet.cpp b/third_party/WebKit/Source/core/rendering/RenderFrameSet.cpp index 8b6acf9..7de277c 100644 --- a/third_party/WebKit/Source/core/rendering/RenderFrameSet.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderFrameSet.cpp @@ -35,7 +35,6 @@ #include "core/rendering/PaintInfo.h" #include "core/rendering/RenderFrame.h" #include "core/rendering/RenderView.h" -#include <wtf/MemoryInstrumentationVector.h> namespace WebCore { @@ -672,22 +671,4 @@ CursorDirective RenderFrameSet::getCursor(const LayoutPoint& point, Cursor& curs return RenderBox::getCursor(point, cursor); } -void RenderFrameSet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - RenderBox::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_children, "children"); - info.addMember(m_rows, "rows"); - info.addMember(m_cols, "cols"); -} - -void RenderFrameSet::GridAxis::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - info.addMember(m_sizes, "sizes"); - info.addMember(m_deltas, "deltas"); - info.addMember(m_preventResize, "preventResize"); - info.addMember(m_allowBorder, "allowBorder"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/RenderFrameSet.h b/third_party/WebKit/Source/core/rendering/RenderFrameSet.h index 99c39ef..42c487f 100644 --- a/third_party/WebKit/Source/core/rendering/RenderFrameSet.h +++ b/third_party/WebKit/Source/core/rendering/RenderFrameSet.h @@ -76,8 +76,6 @@ public: void notifyFrameEdgeInfoChanged(); - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: static const int noSplit = -1; @@ -87,8 +85,6 @@ private: GridAxis(); void resize(int); - void reportMemoryUsage(MemoryObjectInfo*) const; - Vector<int> m_sizes; Vector<int> m_deltas; Vector<bool> m_preventResize; diff --git a/third_party/WebKit/Source/core/rendering/RenderInline.cpp b/third_party/WebKit/Source/core/rendering/RenderInline.cpp index 2530163..81a8bdc 100644 --- a/third_party/WebKit/Source/core/rendering/RenderInline.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderInline.cpp @@ -24,7 +24,6 @@ #include "core/rendering/RenderInline.h" #include "core/dom/FullscreenController.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/editing/VisiblePosition.h" #include "core/page/Chrome.h" #include "core/page/Frame.h" @@ -1562,12 +1561,4 @@ void RenderInline::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) regions.append(region); } -void RenderInline::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - RenderBoxModelObject::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_children, "children"); - info.addMember(m_lineBoxes, "lineBoxes"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/RenderInline.h b/third_party/WebKit/Source/core/rendering/RenderInline.h index 6b5f366..95f52ef 100644 --- a/third_party/WebKit/Source/core/rendering/RenderInline.h +++ b/third_party/WebKit/Source/core/rendering/RenderInline.h @@ -95,8 +95,6 @@ public: bool hitTestCulledInline(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset); - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE FINAL; - protected: virtual void willBeDestroyed(); diff --git a/third_party/WebKit/Source/core/rendering/RenderLayer.cpp b/third_party/WebKit/Source/core/rendering/RenderLayer.cpp index 01aa012..dcb8112 100644 --- a/third_party/WebKit/Source/core/rendering/RenderLayer.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderLayer.cpp @@ -51,7 +51,6 @@ #include "core/css/PseudoStyleRequest.h" #include "core/dom/Document.h" #include "core/dom/DocumentEventQueue.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/dom/shadow/ShadowRoot.h" #include "core/editing/FrameSelection.h" #include "core/html/HTMLFrameElement.h" @@ -104,7 +103,6 @@ #include "core/rendering/RenderView.h" #include "core/rendering/svg/ReferenceFilterBuilder.h" #include "core/rendering/svg/RenderSVGResourceClipper.h" -#include <wtf/MemoryInstrumentationVector.h> #include <wtf/StdLibExtras.h> #include <wtf/text/CString.h> #include <wtf/UnusedParam.h> @@ -6354,30 +6352,6 @@ void RenderLayer::filterNeedsRepaint() renderer()->repaint(); } -void RenderLayer::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Rendering); - ScrollableArea::reportMemoryUsage(memoryObjectInfo); - info.addWeakPointer(m_renderer); - info.addWeakPointer(m_parent); - info.addWeakPointer(m_previous); - info.addWeakPointer(m_next); - info.addWeakPointer(m_first); - info.addWeakPointer(m_last); - info.addMember(m_hBar, "hBar"); - info.addMember(m_vBar, "vBar"); - info.addMember(m_posZOrderList, "posZOrderList"); - info.addMember(m_negZOrderList, "negZOrderList"); - info.addMember(m_normalFlowList, "normalFlowList"); - info.addMember(m_clipRectsCache, "clipRectsCache"); - info.addMember(m_transform, "transform"); - info.addWeakPointer(m_reflection); - info.addWeakPointer(m_scrollCorner); - info.addWeakPointer(m_resizer); - info.addMember(m_backing, "backing"); - info.setCustomAllocation(true); -} - } // namespace WebCore #ifndef NDEBUG diff --git a/third_party/WebKit/Source/core/rendering/RenderLayer.h b/third_party/WebKit/Source/core/rendering/RenderLayer.h index bf6a7ab..fd9ee61 100644 --- a/third_party/WebKit/Source/core/rendering/RenderLayer.h +++ b/third_party/WebKit/Source/core/rendering/RenderLayer.h @@ -799,8 +799,6 @@ public: bool isInTopLayer() const; bool isInTopLayerSubtree() const; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - enum ViewportConstrainedNotCompositedReason { NoNotCompositedReason, NotCompositedForBoundsOutOfView, diff --git a/third_party/WebKit/Source/core/rendering/RenderLayerBacking.cpp b/third_party/WebKit/Source/core/rendering/RenderLayerBacking.cpp index 35579d2..7442e45 100644 --- a/third_party/WebKit/Source/core/rendering/RenderLayerBacking.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderLayerBacking.cpp @@ -30,8 +30,6 @@ #include "CSSPropertyNames.h" #include "HTMLNames.h" #include "RuntimeEnabledFeatures.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" -#include "core/html/HTMLCanvasElement.h" #include "core/html/HTMLIFrameElement.h" #include "core/html/HTMLMediaElement.h" #include "core/html/canvas/CanvasRenderingContext.h" @@ -1874,21 +1872,4 @@ double RenderLayerBacking::backingStoreMemoryEstimate() const return backingMemory; } -void RenderLayerBacking::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - info.addWeakPointer(m_owningLayer); - info.addMember(m_ancestorClippingLayer, "ancestorClippingLayer"); - info.addMember(m_graphicsLayer, "graphicsLayer"); - info.addMember(m_foregroundLayer, "foregroundLayer"); - info.addMember(m_backgroundLayer, "backgroundLayer"); - info.addMember(m_childContainmentLayer, "childContainmentLayer"); - info.addMember(m_maskLayer, "maskLayer"); - info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar"); - info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); - info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); - info.addMember(m_scrollingLayer, "scrollingLayer"); - info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/RenderLayerBacking.h b/third_party/WebKit/Source/core/rendering/RenderLayerBacking.h index 3b135ed..c8d7fe2 100644 --- a/third_party/WebKit/Source/core/rendering/RenderLayerBacking.h +++ b/third_party/WebKit/Source/core/rendering/RenderLayerBacking.h @@ -162,7 +162,6 @@ public: double backingStoreMemoryEstimate() const; void setBlendMode(BlendMode); - void reportMemoryUsage(MemoryObjectInfo*) const; private: void createPrimaryGraphicsLayer(); diff --git a/third_party/WebKit/Source/core/rendering/RenderLayerCompositor.cpp b/third_party/WebKit/Source/core/rendering/RenderLayerCompositor.cpp index 6a6ca61..a5ebd96 100644 --- a/third_party/WebKit/Source/core/rendering/RenderLayerCompositor.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderLayerCompositor.cpp @@ -30,7 +30,6 @@ #include "CSSPropertyNames.h" #include "HTMLNames.h" #include "core/dom/NodeList.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/html/HTMLCanvasElement.h" #include "core/html/HTMLIFrameElement.h" #include "core/html/canvas/CanvasRenderingContext.h" @@ -61,8 +60,6 @@ #include "core/rendering/RenderReplica.h" #include "core/rendering/RenderVideo.h" #include "core/rendering/RenderView.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationHashSet.h" #include "wtf/TemporaryChange.h" #if !LOG_DISABLED @@ -2724,24 +2721,4 @@ Page* RenderLayerCompositor::page() const return 0; } -void RenderLayerCompositor::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - info.addWeakPointer(m_renderView); - info.addMember(m_rootContentLayer, "rootContentLayer"); - info.addMember(m_containerLayer, "containerLayer"); - info.addMember(m_scrollLayer, "scrollLayer"); - info.addMember(m_viewportConstrainedLayers, "viewportConstrainedLayers"); - info.addMember(m_overflowControlsHostLayer, "overflowControlsHostLayer"); - info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar"); - info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); - info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); -#if ENABLE(RUBBER_BANDING) - info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); - info.addMember(m_contentShadowLayer, "contentShadowLayer"); - info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); - info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); -#endif -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/RenderLayerCompositor.h b/third_party/WebKit/Source/core/rendering/RenderLayerCompositor.h index 790680e..588ab69 100644 --- a/third_party/WebKit/Source/core/rendering/RenderLayerCompositor.h +++ b/third_party/WebKit/Source/core/rendering/RenderLayerCompositor.h @@ -200,7 +200,6 @@ public: void resetTrackedRepaintRects(); void setTracksRepaints(bool); - void reportMemoryUsage(MemoryObjectInfo*) const; void setShouldReevaluateCompositingAfterLayout() { m_reevaluateCompositingAfterLayout = true; } // Returns all reasons (direct, indirectly due to subtree, and indirectly due to overlap) that a layer should be composited. diff --git a/third_party/WebKit/Source/core/rendering/RenderLayerModelObject.cpp b/third_party/WebKit/Source/core/rendering/RenderLayerModelObject.cpp index 6c11f67..7ec48cc 100644 --- a/third_party/WebKit/Source/core/rendering/RenderLayerModelObject.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderLayerModelObject.cpp @@ -182,12 +182,5 @@ void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderSt } } -void RenderLayerModelObject::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - RenderObject::reportMemoryUsage(memoryObjectInfo); - info.addWeakPointer(m_layer); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/RenderLayerModelObject.h b/third_party/WebKit/Source/core/rendering/RenderLayerModelObject.h index 8483ae7b..6233e36 100644 --- a/third_party/WebKit/Source/core/rendering/RenderLayerModelObject.h +++ b/third_party/WebKit/Source/core/rendering/RenderLayerModelObject.h @@ -50,8 +50,6 @@ public: // The query rect is given in local coordinate system. virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const { return false; } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - // This is null for anonymous renderers. ContainerNode* node() const { return toContainerNode(RenderObject::node()); } diff --git a/third_party/WebKit/Source/core/rendering/RenderListMarker.cpp b/third_party/WebKit/Source/core/rendering/RenderListMarker.cpp index 4964c58..326eaa8 100644 --- a/third_party/WebKit/Source/core/rendering/RenderListMarker.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderListMarker.cpp @@ -26,7 +26,6 @@ #include "core/rendering/RenderListMarker.h" #include "core/dom/Document.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/cache/CachedImage.h" #include "core/platform/graphics/Font.h" #include "core/platform/graphics/GraphicsContextStateSaver.h" @@ -1848,13 +1847,4 @@ LayoutRect RenderListMarker::selectionRectForRepaint(const RenderLayerModelObjec return rect; } -void RenderListMarker::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - RenderBox::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_text, "text"); - info.addMember(m_image, "image"); - info.addMember(m_listItem, "listItem"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/RenderListMarker.h b/third_party/WebKit/Source/core/rendering/RenderListMarker.h index e5ca966..c8a0867 100644 --- a/third_party/WebKit/Source/core/rendering/RenderListMarker.h +++ b/third_party/WebKit/Source/core/rendering/RenderListMarker.h @@ -44,8 +44,6 @@ public: bool isInside() const; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - void updateMarginsAndContent(); private: diff --git a/third_party/WebKit/Source/core/rendering/RenderObject.cpp b/third_party/WebKit/Source/core/rendering/RenderObject.cpp index d84ea8a..31a02d6 100644 --- a/third_party/WebKit/Source/core/rendering/RenderObject.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderObject.cpp @@ -3152,18 +3152,6 @@ bool RenderObject::canBeReplacedWithInlineRunIn() const return true; } -void RenderObject::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - info.addMember(m_style, "style"); - info.addWeakPointer(m_node); - info.addWeakPointer(m_parent); - info.addWeakPointer(m_previous); - info.addWeakPointer(m_next); - - info.setCustomAllocation(true); -} - RenderSVGResourceContainer* RenderObject::toRenderSVGResourceContainer() { ASSERT_NOT_REACHED(); diff --git a/third_party/WebKit/Source/core/rendering/RenderObject.h b/third_party/WebKit/Source/core/rendering/RenderObject.h index 4500ca3..9a22cf1 100644 --- a/third_party/WebKit/Source/core/rendering/RenderObject.h +++ b/third_party/WebKit/Source/core/rendering/RenderObject.h @@ -135,7 +135,7 @@ const int showTreeCharacterOffset = 39; #endif // Base class for all rendering tree objects. -class RenderObject : public CachedImageClient, public MemoryReporterTag { +class RenderObject : public CachedImageClient { friend class RenderBlock; friend class RenderLayer; friend class RenderObjectChildList; @@ -255,8 +255,6 @@ public: virtual bool createsAnonymousWrapper() const { return false; } ////////////////////////////////////////// - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - protected: ////////////////////////////////////////// // Helper functions. Dangerous to use! @@ -1001,8 +999,8 @@ private: static RenderObjectAncestorLineboxDirtySet* s_ancestorLineboxDirtySet; #ifndef NDEBUG - bool m_hasAXObject : 1; - bool m_setNeedsLayoutForbidden : 1; + unsigned m_hasAXObject : 1; + unsigned m_setNeedsLayoutForbidden : 1; #endif #define ADD_BOOLEAN_BITFIELD(name, Name) \ diff --git a/third_party/WebKit/Source/core/rendering/RenderReplaced.cpp b/third_party/WebKit/Source/core/rendering/RenderReplaced.cpp index 93db7ed..2e19c57 100644 --- a/third_party/WebKit/Source/core/rendering/RenderReplaced.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderReplaced.cpp @@ -581,10 +581,4 @@ LayoutRect RenderReplaced::clippedOverflowRectForRepaint(const RenderLayerModelO return r; } -void RenderReplaced::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - RenderBox::reportMemoryUsage(memoryObjectInfo); -} - } diff --git a/third_party/WebKit/Source/core/rendering/RenderReplaced.h b/third_party/WebKit/Source/core/rendering/RenderReplaced.h index 0b9ed07..882044963 100644 --- a/third_party/WebKit/Source/core/rendering/RenderReplaced.h +++ b/third_party/WebKit/Source/core/rendering/RenderReplaced.h @@ -40,8 +40,6 @@ public: virtual bool needsPreferredWidthsRecalculation() const OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE FINAL; - protected: virtual void willBeDestroyed(); diff --git a/third_party/WebKit/Source/core/rendering/RenderTableCol.cpp b/third_party/WebKit/Source/core/rendering/RenderTableCol.cpp index 64dde07..533cf48 100644 --- a/third_party/WebKit/Source/core/rendering/RenderTableCol.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderTableCol.cpp @@ -27,7 +27,6 @@ #include "core/rendering/RenderTableCol.h" #include "HTMLNames.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/html/HTMLTableColElement.h" #include "core/loader/cache/CachedImage.h" #include "core/rendering/RenderTable.h" @@ -188,11 +187,4 @@ const BorderValue& RenderTableCol::borderAdjoiningCellAfter(const RenderTableCel return style()->borderEnd(); } -void RenderTableCol::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - RenderBox::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_children, "children"); -} - } diff --git a/third_party/WebKit/Source/core/rendering/RenderTableCol.h b/third_party/WebKit/Source/core/rendering/RenderTableCol.h index 066d8ce..dd3e1b0 100644 --- a/third_party/WebKit/Source/core/rendering/RenderTableCol.h +++ b/third_party/WebKit/Source/core/rendering/RenderTableCol.h @@ -76,8 +76,6 @@ public: const BorderValue& borderAdjoiningCellBefore(const RenderTableCell*) const; const BorderValue& borderAdjoiningCellAfter(const RenderTableCell*) const; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: virtual RenderObjectChildList* virtualChildren() { return children(); } virtual const RenderObjectChildList* virtualChildren() const { return children(); } diff --git a/third_party/WebKit/Source/core/rendering/RenderTableRow.cpp b/third_party/WebKit/Source/core/rendering/RenderTableRow.cpp index bbad6c4..0e559ad 100644 --- a/third_party/WebKit/Source/core/rendering/RenderTableRow.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderTableRow.cpp @@ -27,7 +27,6 @@ #include "HTMLNames.h" #include "core/dom/Document.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/loader/cache/CachedImage.h" #include "core/rendering/HitTestResult.h" #include "core/rendering/PaintInfo.h" @@ -281,11 +280,4 @@ RenderTableRow* RenderTableRow::createAnonymousWithParentRenderer(const RenderOb return newRow; } -void RenderTableRow::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - RenderBox::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_children, "children"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/RenderTableRow.h b/third_party/WebKit/Source/core/rendering/RenderTableRow.h index 505dcf4..8f385fa 100644 --- a/third_party/WebKit/Source/core/rendering/RenderTableRow.h +++ b/third_party/WebKit/Source/core/rendering/RenderTableRow.h @@ -88,8 +88,6 @@ public: const BorderValue& borderAdjoiningStartCell(const RenderTableCell*) const; const BorderValue& borderAdjoiningEndCell(const RenderTableCell*) const; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: virtual RenderObjectChildList* virtualChildren() { return children(); } virtual const RenderObjectChildList* virtualChildren() const { return children(); } diff --git a/third_party/WebKit/Source/core/rendering/RenderTableSection.cpp b/third_party/WebKit/Source/core/rendering/RenderTableSection.cpp index 41ad275..9bca834 100644 --- a/third_party/WebKit/Source/core/rendering/RenderTableSection.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderTableSection.cpp @@ -36,9 +36,6 @@ #include "core/rendering/RenderTableRow.h" #include "core/rendering/RenderView.h" #include <wtf/HashSet.h> -#include <wtf/MemoryInstrumentationHashMap.h> -#include <wtf/MemoryInstrumentationHashSet.h> -#include <wtf/MemoryInstrumentationVector.h> #include <wtf/Vector.h> using namespace std; @@ -1525,29 +1522,4 @@ void RenderTableSection::setLogicalPositionForCell(RenderTableCell* cell, unsign view()->addLayoutDelta(oldCellLocation - cell->location()); } -void RenderTableSection::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - RenderBox::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_children, "children"); - info.addMember(m_grid, "grid"); - info.addMember(m_rowPos, "rowPos"); - info.addMember(m_overflowingCells, "overflowingCells"); - info.addMember(m_cellsCollapsedBorders, "cellsCollapsedBorders"); -} - -void RenderTableSection::RowStruct::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - info.addMember(row, "row"); - info.addMember(rowRenderer, "rowRenderer"); - info.addMember(logicalHeight, "logicalHeight"); -} - -void RenderTableSection::CellStruct::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - info.addMember(cells, "cells"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/RenderTableSection.h b/third_party/WebKit/Source/core/rendering/RenderTableSection.h index 41c2359..4725240 100644 --- a/third_party/WebKit/Source/core/rendering/RenderTableSection.h +++ b/third_party/WebKit/Source/core/rendering/RenderTableSection.h @@ -105,8 +105,6 @@ public: } bool hasCells() const { return cells.size() > 0; } - - void reportMemoryUsage(MemoryObjectInfo*) const; }; typedef Vector<CellStruct> Row; @@ -118,8 +116,6 @@ public: { } - void reportMemoryUsage(MemoryObjectInfo*) const; - Row row; RenderTableRow* rowRenderer; LayoutUnit baseline; @@ -204,8 +200,6 @@ public: virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - protected: virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); diff --git a/third_party/WebKit/Source/core/rendering/RenderText.cpp b/third_party/WebKit/Source/core/rendering/RenderText.cpp index 65030b4..55095ae 100644 --- a/third_party/WebKit/Source/core/rendering/RenderText.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderText.cpp @@ -1927,13 +1927,4 @@ void RenderText::momentarilyRevealLastTypedCharacter(unsigned lastTypedCharacter secureTextTimer->restartWithNewText(lastTypedCharacterOffset); } -void RenderText::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - RenderObject::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_text, "text"); - info.addMember(m_firstTextBox, "firstTextBox"); - info.addMember(m_lastTextBox, "lastTextBox"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/RenderText.h b/third_party/WebKit/Source/core/rendering/RenderText.h index e3f0e36..0b6d533 100644 --- a/third_party/WebKit/Source/core/rendering/RenderText.h +++ b/third_party/WebKit/Source/core/rendering/RenderText.h @@ -143,8 +143,6 @@ public: void removeAndDestroyTextBoxes(); - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE FINAL; - protected: virtual void computePreferredLogicalWidths(float leadWidth); virtual void willBeDestroyed(); diff --git a/third_party/WebKit/Source/core/rendering/RenderTheme.cpp b/third_party/WebKit/Source/core/rendering/RenderTheme.cpp index 5c8b9bc..05d9330 100644 --- a/third_party/WebKit/Source/core/rendering/RenderTheme.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderTheme.cpp @@ -56,6 +56,7 @@ #include "public/platform/Platform.h" #include "public/platform/WebFallbackThemeEngine.h" #include "public/platform/WebRect.h" +#include "wtf/text/StringBuilder.h" #if ENABLE(INPUT_SPEECH) #include "core/rendering/RenderInputSpeech.h" diff --git a/third_party/WebKit/Source/core/rendering/RenderTheme.h b/third_party/WebKit/Source/core/rendering/RenderTheme.h index efbbe68..899a954 100644 --- a/third_party/WebKit/Source/core/rendering/RenderTheme.h +++ b/third_party/WebKit/Source/core/rendering/RenderTheme.h @@ -33,6 +33,7 @@ #include "core/rendering/style/CachedUAStyle.h" #include "wtf/PassRefPtr.h" #include "wtf/RefCounted.h" +#include "wtf/text/WTFString.h" namespace WebCore { diff --git a/third_party/WebKit/Source/core/rendering/RenderView.cpp b/third_party/WebKit/Source/core/rendering/RenderView.cpp index 0501515..22e2250 100644 --- a/third_party/WebKit/Source/core/rendering/RenderView.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderView.cpp @@ -42,7 +42,6 @@ #include "core/rendering/RenderLazyBlock.h" #include "core/rendering/RenderSelectionInfo.h" #include "core/rendering/RenderWidget.h" -#include "wtf/MemoryInstrumentationHashSet.h" namespace WebCore { @@ -1095,22 +1094,6 @@ bool RenderView::backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const return m_frameView->hasOpaqueBackground(); } -void RenderView::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering); - RenderBlock::reportMemoryUsage(memoryObjectInfo); - info.addWeakPointer(m_frameView); - info.addWeakPointer(m_selectionStart); - info.addWeakPointer(m_selectionEnd); - info.addMember(m_widgets, "widgets"); - info.addMember(m_layoutState, "layoutState"); - info.addMember(m_compositor, "compositor"); - info.addMember(m_customFilterGlobalContext, "customFilterGlobalContext"); - info.addMember(m_flowThreadController, "flowThreadController"); - info.addMember(m_intervalArena, "intervalArena"); - info.addWeakPointer(m_renderQuoteHead); -} - FragmentationDisabler::FragmentationDisabler(RenderObject* root) { RenderView* renderView = root->view(); diff --git a/third_party/WebKit/Source/core/rendering/RenderView.h b/third_party/WebKit/Source/core/rendering/RenderView.h index 340a3e2..8016e8e 100644 --- a/third_party/WebKit/Source/core/rendering/RenderView.h +++ b/third_party/WebKit/Source/core/rendering/RenderView.h @@ -254,8 +254,6 @@ private: friend class LayoutStateMaintainer; friend class LayoutStateDisabler; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - protected: FrameView* m_frameView; diff --git a/third_party/WebKit/Source/core/rendering/style/DataRef.h b/third_party/WebKit/Source/core/rendering/style/DataRef.h index cac8987..c8d8072 100644 --- a/third_party/WebKit/Source/core/rendering/style/DataRef.h +++ b/third_party/WebKit/Source/core/rendering/style/DataRef.h @@ -62,14 +62,6 @@ public: return m_data != o.m_data && *m_data != *o.m_data; } - // Template helps us to write the implementation without MemoryInstrumentation.h include. - template<typename MemoryObjectInfo> - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - typename MemoryObjectInfo::ClassInfo info(memoryObjectInfo, this); - info.addMember(m_data, "data"); - } - private: RefPtr<T> m_data; }; diff --git a/third_party/WebKit/Source/core/rendering/style/RenderStyle.cpp b/third_party/WebKit/Source/core/rendering/style/RenderStyle.cpp index 1ffb016..a607135 100644 --- a/third_party/WebKit/Source/core/rendering/style/RenderStyle.cpp +++ b/third_party/WebKit/Source/core/rendering/style/RenderStyle.cpp @@ -26,7 +26,6 @@ #include <algorithm> #include "CSSPropertyNames.h" #include "core/css/resolver/StyleResolver.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/platform/graphics/Font.h" #include "core/platform/graphics/FontSelector.h" #include "core/rendering/RenderTheme.h" @@ -38,8 +37,6 @@ #include "core/rendering/style/StyleImage.h" #include "core/rendering/style/StyleInheritedData.h" #include <wtf/MathExtras.h> -#include <wtf/MemoryInstrumentationVector.h> -#include <wtf/MemoryObjectInfo.h> #include <wtf/StdLibExtras.h> using namespace std; @@ -1560,23 +1557,4 @@ ShapeValue* RenderStyle::initialShapeInside() return sOutsideValue.get(); } -void RenderStyle::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_box, "box"); - info.addMember(visual, "visual"); - // FIXME: m_background contains RefPtr<StyleImage> that might need to be instrumented. - info.addMember(m_background, "background"); - // FIXME: surrond contains some fields e.g. BorderData that might need to be instrumented. - info.addMember(surround, "surround"); - info.addMember(rareNonInheritedData, "rareNonInheritedData"); - info.addMember(rareInheritedData, "rareInheritedData"); - // FIXME: inherited contains StyleImage and Font fields that might need to be instrumented. - info.addMember(inherited, "inherited"); - info.addMember(m_cachedPseudoStyles, "cachedPseudoStyles"); - info.addMember(m_svgStyle, "svgStyle"); - info.addMember(inherited_flags, "inherited_flags"); - info.addMember(noninherited_flags, "noninherited_flags"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/style/RenderStyle.h b/third_party/WebKit/Source/core/rendering/style/RenderStyle.h index 87f1823..f4dd5f5 100644 --- a/third_party/WebKit/Source/core/rendering/style/RenderStyle.h +++ b/third_party/WebKit/Source/core/rendering/style/RenderStyle.h @@ -1449,8 +1449,6 @@ public: void setHasCurrentColor() { noninherited_flags.currentColor = true; } bool hasCurrentColor() const { return noninherited_flags.currentColor; } - void reportMemoryUsage(MemoryObjectInfo*) const; - // Initial values for all the properties static EBorderCollapse initialBorderCollapse() { return BSEPARATE; } static EBorderStyle initialBorderStyle() { return BNONE; } diff --git a/third_party/WebKit/Source/core/rendering/style/StyleRareInheritedData.cpp b/third_party/WebKit/Source/core/rendering/style/StyleRareInheritedData.cpp index 90043c3..4154ddb 100644 --- a/third_party/WebKit/Source/core/rendering/style/StyleRareInheritedData.cpp +++ b/third_party/WebKit/Source/core/rendering/style/StyleRareInheritedData.cpp @@ -22,14 +22,12 @@ #include "config.h" #include "core/rendering/style/StyleRareInheritedData.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/rendering/style/CursorList.h" #include "core/rendering/style/QuotesData.h" #include "core/rendering/style/RenderStyle.h" #include "core/rendering/style/RenderStyleConstants.h" #include "core/rendering/style/ShadowData.h" #include "core/rendering/style/StyleImage.h" -#include <wtf/MemoryObjectInfo.h> namespace WebCore { @@ -235,20 +233,4 @@ bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& return true; } -void StyleRareInheritedData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(listStyleImage, "listStyleImage"); - info.addMember(indent, "indent"); - info.addMember(textShadow, "textShadow"); - info.addMember(highlight, "highlight"); - info.addMember(cursorData, "cursorData"); - info.addMember(hyphenationString, "hyphenationString"); - info.addMember(locale, "locale"); - info.addMember(textEmphasisCustomMark, "textEmphasisCustomMark"); - info.addMember(quotes, "quotes"); - info.addMember(m_lineGrid, "lineGrid"); - info.addMember(m_variables, "variables"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/style/StyleRareInheritedData.h b/third_party/WebKit/Source/core/rendering/style/StyleRareInheritedData.h index 9c9a946..1640c30 100644 --- a/third_party/WebKit/Source/core/rendering/style/StyleRareInheritedData.h +++ b/third_party/WebKit/Source/core/rendering/style/StyleRareInheritedData.h @@ -57,8 +57,6 @@ public: } bool shadowDataEquivalent(const StyleRareInheritedData&) const; - void reportMemoryUsage(MemoryObjectInfo*) const; - RefPtr<StyleImage> listStyleImage; Color textStrokeColor; diff --git a/third_party/WebKit/Source/core/rendering/style/StyleRareNonInheritedData.cpp b/third_party/WebKit/Source/core/rendering/style/StyleRareNonInheritedData.cpp index e4d640a..c93cdd4 100644 --- a/third_party/WebKit/Source/core/rendering/style/StyleRareNonInheritedData.cpp +++ b/third_party/WebKit/Source/core/rendering/style/StyleRareNonInheritedData.cpp @@ -22,15 +22,11 @@ #include "config.h" #include "core/rendering/style/StyleRareNonInheritedData.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/rendering/style/ContentData.h" #include "core/rendering/style/RenderStyle.h" #include "core/rendering/style/ShadowData.h" #include "core/rendering/style/StyleFilterData.h" #include "core/rendering/style/StyleTransformData.h" -#include <wtf/MemoryInstrumentationHashMap.h> -#include <wtf/MemoryInstrumentationVector.h> -#include <wtf/MemoryObjectInfo.h> namespace WebCore { @@ -289,34 +285,4 @@ bool StyleRareNonInheritedData::transitionDataEquivalent(const StyleRareNonInher return true; } -void StyleRareNonInheritedData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_deprecatedFlexibleBox, "deprecatedFlexibleBox"); - info.addMember(m_flexibleBox, "flexibleBox"); - info.addMember(m_marquee, "marquee"); - info.addMember(m_multiCol, "multiCol"); - info.addMember(m_transform, "transform"); - info.addMember(m_filter, "filter"); - info.addMember(m_grid, "grid"); - info.addMember(m_gridItem, "gridItem"); - info.addMember(m_content, "content"); - info.addMember(m_counterDirectives, "counterDirectives"); - info.addMember(m_boxShadow, "boxShadow"); - info.addMember(m_boxReflect, "boxReflect"); - info.addMember(m_animations, "animations"); - info.addMember(m_transitions, "transitions"); - info.addMember(m_shapeInside, "shapeInside"); - info.addMember(m_shapeOutside, "shapeOutside"); - info.addMember(m_clipPath, "clipPath"); - info.addMember(m_flowThread, "flowThread"); - info.addMember(m_regionThread, "regionThread"); - - info.ignoreMember(m_perspectiveOriginX); - info.ignoreMember(m_perspectiveOriginY); - info.ignoreMember(m_pageSize); - info.ignoreMember(m_shapeMargin); - info.ignoreMember(m_shapePadding); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/rendering/style/StyleRareNonInheritedData.h b/third_party/WebKit/Source/core/rendering/style/StyleRareNonInheritedData.h index bf42f544..6f024ed 100644 --- a/third_party/WebKit/Source/core/rendering/style/StyleRareNonInheritedData.h +++ b/third_party/WebKit/Source/core/rendering/style/StyleRareNonInheritedData.h @@ -85,8 +85,6 @@ public: bool animationDataEquivalent(const StyleRareNonInheritedData&) const; bool transitionDataEquivalent(const StyleRareNonInheritedData&) const; - void reportMemoryUsage(MemoryObjectInfo*) const; - float opacity; // Whether or not we're transparent. float m_aspectRatioDenominator; diff --git a/third_party/WebKit/Source/core/storage/Storage.cpp b/third_party/WebKit/Source/core/storage/Storage.cpp index c0a7e27..7ae2a87 100644 --- a/third_party/WebKit/Source/core/storage/Storage.cpp +++ b/third_party/WebKit/Source/core/storage/Storage.cpp @@ -26,6 +26,7 @@ #include "config.h" #include "core/storage/Storage.h" +#include "wtf/PassOwnPtr.h" #include <wtf/PassRefPtr.h> #include <wtf/text/WTFString.h> diff --git a/third_party/WebKit/Source/core/svg/SVGColor.cpp b/third_party/WebKit/Source/core/svg/SVGColor.cpp index 6279065..9d244c2 100644 --- a/third_party/WebKit/Source/core/svg/SVGColor.cpp +++ b/third_party/WebKit/Source/core/svg/SVGColor.cpp @@ -25,7 +25,6 @@ #include "core/css/CSSParser.h" #include "core/css/RGBColor.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" namespace WebCore { @@ -108,9 +107,4 @@ bool SVGColor::equals(const SVGColor& other) const return m_colorType == other.m_colorType && m_color == other.m_color; } -void SVGColor::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); -} - } diff --git a/third_party/WebKit/Source/core/svg/SVGColor.h b/third_party/WebKit/Source/core/svg/SVGColor.h index ed01fdf..dd820fd 100644 --- a/third_party/WebKit/Source/core/svg/SVGColor.h +++ b/third_party/WebKit/Source/core/svg/SVGColor.h @@ -76,8 +76,6 @@ public: bool equals(const SVGColor&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - protected: friend class CSSComputedStyleDeclaration; diff --git a/third_party/WebKit/Source/core/svg/SVGElementInstanceList.h b/third_party/WebKit/Source/core/svg/SVGElementInstanceList.h index f0fe1eb..5cc7bf3 100644 --- a/third_party/WebKit/Source/core/svg/SVGElementInstanceList.h +++ b/third_party/WebKit/Source/core/svg/SVGElementInstanceList.h @@ -22,6 +22,7 @@ #include "bindings/v8/ScriptWrappable.h" #include "wtf/RefCounted.h" +#include "wtf/RefPtr.h" namespace WebCore { diff --git a/third_party/WebKit/Source/core/svg/SVGPaint.cpp b/third_party/WebKit/Source/core/svg/SVGPaint.cpp index e300655..cb25e99 100644 --- a/third_party/WebKit/Source/core/svg/SVGPaint.cpp +++ b/third_party/WebKit/Source/core/svg/SVGPaint.cpp @@ -23,7 +23,6 @@ #include "core/svg/SVGPaint.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "wtf/text/WTFString.h" namespace WebCore { @@ -114,10 +113,4 @@ bool SVGPaint::equals(const SVGPaint& other) const return m_paintType == other.m_paintType && m_uri == other.m_uri && SVGColor::equals(other); } -void SVGPaint::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(m_uri, "uri"); -} - } diff --git a/third_party/WebKit/Source/core/svg/SVGPaint.h b/third_party/WebKit/Source/core/svg/SVGPaint.h index bd2f474..98ada60 100644 --- a/third_party/WebKit/Source/core/svg/SVGPaint.h +++ b/third_party/WebKit/Source/core/svg/SVGPaint.h @@ -96,8 +96,6 @@ public: bool equals(const SVGPaint&) const; - void reportDescendantMemoryUsage(MemoryObjectInfo*) const; - private: friend class CSSComputedStyleDeclaration; diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp index a78255a..8ca01dd 100644 --- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp +++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp @@ -368,13 +368,5 @@ String SVGImage::filenameExtension() const return "svg"; } -void SVGImage::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResourceImage); - Image::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_chromeClient, "chromeClient"); - info.addMember(m_page, "page"); -} - } diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.h b/third_party/WebKit/Source/core/svg/graphics/SVGImage.h index e8c4918..95c6885 100644 --- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.h +++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.h @@ -58,8 +58,6 @@ public: virtual void stopAnimation() OVERRIDE; virtual void resetAnimation() OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() OVERRIDE; private: diff --git a/third_party/WebKit/Source/core/tests/HeapGraphSerializerTest.cpp b/third_party/WebKit/Source/core/tests/HeapGraphSerializerTest.cpp deleted file mode 100644 index 94a22b8..0000000 --- a/third_party/WebKit/Source/core/tests/HeapGraphSerializerTest.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" - -#include <gtest/gtest.h> -#include "core/inspector/HeapGraphSerializer.h" -#include "core/inspector/MemoryInstrumentationImpl.h" -#include "wtf/Assertions.h" -#include "wtf/MemoryInstrumentation.h" -#include "wtf/MemoryInstrumentationHashSet.h" -#include "wtf/MemoryInstrumentationString.h" -#include "wtf/MemoryObjectInfo.h" -#include "wtf/text/CString.h" -#include "wtf/text/StringBuilder.h" -#include "wtf/text/WTFString.h" - -namespace WTF { - -static std::ostream& operator<<(std::ostream& os, const String& string) -{ - return os << string.utf8().data(); -} - -} - -namespace { - -using namespace WebCore; - -static WTF::MemoryObjectType g_defaultObjectType = "DefaultObjectType"; - -class HeapGraphReceiver : public HeapGraphSerializer::Client { -public: - HeapGraphReceiver() : m_serializer(this) { } - - virtual void addNativeSnapshotChunk(PassRefPtr<TypeBuilder::Memory::HeapSnapshotChunk> heapSnapshotChunk) OVERRIDE - { - ASSERT(!m_heapSnapshotChunk); - m_heapSnapshotChunk = heapSnapshotChunk; - m_strings = chunkPart("strings"); - m_edges = chunkPart("edges"); - m_nodes = chunkPart("nodes"); - - // Reset platform depended size field values. - for (JSONArray::iterator i = m_nodes->begin(); i != m_nodes->end(); i += s_nodeFieldCount) - *(i + s_sizeOffset) = JSONBasicValue::create(0); - - m_id2index.clear(); - - for (unsigned index = 0; index < m_nodes->length(); index += s_nodeFieldCount) - m_id2index.add(intValue(m_nodes.get(), index + s_idOffset), index); - } - - void printGraph() - { - EXPECT_TRUE(m_heapSnapshotChunk); - int processedEdgesCount = 0; - for (unsigned index = 0; index < m_nodes->length(); index += s_nodeFieldCount) - processedEdgesCount += printNode(index, processedEdgesCount); - } - - String dumpNodes() { return dumpPart("nodes"); } - String dumpEdges() { return dumpPart("edges"); } - String dumpBaseToRealNodeId() { return dumpPart("baseToRealNodeId"); } - String dumpStrings() { return dumpPart("strings"); } - - HeapGraphSerializer* serializer() { return &m_serializer; } - -private: - PassRefPtr<JSONArray> chunkPart(String partName) - { - EXPECT_TRUE(m_heapSnapshotChunk); - RefPtr<JSONObject> chunk = *reinterpret_cast<RefPtr<JSONObject>*>(&m_heapSnapshotChunk); - RefPtr<JSONValue> partValue = chunk->get(partName); - RefPtr<JSONArray> partArray; - EXPECT_TRUE(partValue->asArray(&partArray)); - return partArray.release(); - } - - String dumpPart(String partName) - { - return chunkPart(partName)->toJSONString().replace("\"", "'"); - } - - String stringValue(JSONArray* array, int index) - { - RefPtr<JSONValue> inspectorValue = array->get(index); - String value; - EXPECT_TRUE(inspectorValue->asString(&value)); - return value; - } - - int intValue(JSONArray* array, int index) - { - RefPtr<JSONValue> inspectorValue = array->get(index); - int value; - EXPECT_TRUE(inspectorValue->asNumber(&value)); - return value; - } - - String nodeToString(unsigned nodeIndex) - { - StringBuilder builder; - builder.append("node: "); - builder.appendNumber(intValue(m_nodes.get(), nodeIndex + s_idOffset)); - builder.append(" with className:'"); - builder.append(stringValue(m_strings.get(), intValue(m_nodes.get(), nodeIndex + s_classNameOffset))); - builder.append("' and name: '"); - builder.append(stringValue(m_strings.get(), intValue(m_nodes.get(), nodeIndex + s_nameOffset))); - builder.append("'"); - return builder.toString(); - } - - String edgeToString(unsigned edgeOrdinal) - { - unsigned edgeIndex = edgeOrdinal * s_edgeFieldCount; - StringBuilder builder; - builder.append("'"); - builder.append(stringValue(m_strings.get(), intValue(m_edges.get(), edgeIndex + s_edgeTypeOffset))); - builder.append("' edge '"); - builder.append(stringValue(m_strings.get(), intValue(m_edges.get(), edgeIndex + s_edgeNameOffset))); - builder.append("' points to "); - int nodeId = intValue(m_edges.get(), edgeIndex + s_toNodeIdOffset); - builder.append(nodeToString(m_id2index.get(nodeId))); - return builder.toString(); - } - - int printNode(unsigned nodeIndex, unsigned processedEdgesCount) - { - String nodeString = nodeToString(nodeIndex); - unsigned edgeCount = intValue(m_nodes.get(), nodeIndex + s_edgeCountOffset); - - printf("%s\n", nodeString.utf8().data()); - for (unsigned i = 0; i < edgeCount; ++i) { - String edgeText = edgeToString(i + processedEdgesCount); - printf("\thas %s\n", edgeText.utf8().data()); - } - return edgeCount; - } - - HeapGraphSerializer m_serializer; - RefPtr<TypeBuilder::Memory::HeapSnapshotChunk> m_heapSnapshotChunk; - - RefPtr<JSONArray> m_strings; - RefPtr<JSONArray> m_nodes; - RefPtr<JSONArray> m_edges; - HashMap<int, int> m_id2index; - - static const int s_nodeFieldCount = 5; - static const int s_classNameOffset = 0; - static const int s_nameOffset = 1; - static const int s_idOffset = 2; - static const int s_sizeOffset = 3; - static const int s_edgeCountOffset = 4; - - static const int s_edgeFieldCount = 3; - static const int s_edgeTypeOffset = 0; - static const int s_edgeNameOffset = 1; - static const int s_toNodeIdOffset = 2; -}; - -class Helper { -public: - Helper(HeapGraphSerializer* serializer) - : m_serializer(serializer) - , m_memoryInstrumentationClient(serializer) - , m_memoryInstrumentation(&m_memoryInstrumentationClient) - , m_currentPointer(0) - { } - - void* addNode(const char* className, const char* name, bool isRoot) - { - WTF::MemoryObjectInfo info(&m_memoryInstrumentation, g_defaultObjectType, ++m_currentPointer); - info.setClassName(className); - info.setName(name); - if (isRoot) - info.markAsRoot(); - m_serializer->reportNode(info); - return m_currentPointer; - } - - void addEdge(void* to, const char* edgeName, WTF::MemberType memberType) - { - m_serializer->reportEdge(to, edgeName, memberType); - } - - void done() - { - m_serializer->finish(); - } - -private: - HeapGraphSerializer* m_serializer; - MemoryInstrumentationClientImpl m_memoryInstrumentationClient; - MemoryInstrumentationImpl m_memoryInstrumentation; - - class Object { - public: - Object() { m_data[0] = 0; } - char m_data[sizeof(void*)]; - }; - Object* m_currentPointer; -}; - -TEST(HeapGraphSerializerTest, snapshotWithoutUserObjects) -{ - HeapGraphReceiver receiver; - Helper helper(receiver.serializer()); - helper.done(); - receiver.printGraph(); - EXPECT_EQ(String("['','weak','property','object','unknown','Root']"), receiver.dumpStrings()); - EXPECT_EQ(String("[5,0,1,0,0]"), receiver.dumpNodes()); // Only Root object. - EXPECT_EQ(String("[]"), receiver.dumpEdges()); // No edges. - EXPECT_EQ(String("[]"), receiver.dumpBaseToRealNodeId()); // No id maps. -} - -TEST(HeapGraphSerializerTest, oneRootUserObject) -{ - HeapGraphReceiver receiver; - Helper helper(receiver.serializer()); - helper.addNode("ClassName", "objectName", true); - helper.done(); - receiver.printGraph(); - EXPECT_EQ(String("['','weak','property','object','unknown','ClassName','objectName','Root']"), receiver.dumpStrings()); - EXPECT_EQ(String("[5,6,1,0,0,7,0,2,0,1]"), receiver.dumpNodes()); - EXPECT_EQ(String("[1,0,1]"), receiver.dumpEdges()); - EXPECT_EQ(String("[]"), receiver.dumpBaseToRealNodeId()); -} - -TEST(HeapGraphSerializerTest, twoUserObjectsWithEdge) -{ - HeapGraphReceiver receiver; - Helper helper(receiver.serializer()); - void* childObject = helper.addNode("Child", "child", false); - helper.addEdge(childObject, "pointerToChild", WTF::RetainingPointer); - helper.addNode("Parent", "parent", true); - helper.done(); - receiver.printGraph(); - EXPECT_EQ(String("['','weak','property','object','unknown','Child','child','pointerToChild','Parent','parent','Root']"), receiver.dumpStrings()); - EXPECT_EQ(String("[5,6,1,0,0,8,9,2,0,1,10,0,3,0,1]"), receiver.dumpNodes()); - EXPECT_EQ(String("[2,7,1,1,0,2]"), receiver.dumpEdges()); - EXPECT_EQ(String("[]"), receiver.dumpBaseToRealNodeId()); -} - -class Owner { -public: - Owner() - { - m_strings.add("first element"); - m_strings.add("second element"); - } - void reportMemoryUsage(WTF::MemoryObjectInfo* memoryObjectInfo) const - { - WTF::MemoryClassInfo info(memoryObjectInfo, this, g_defaultObjectType); - info.addMember(m_strings, "strings"); - } -private: - HashSet<String> m_strings; -}; - -TEST(HeapGraphSerializerTest, hashSetWithTwoStrings) -{ - HeapGraphReceiver receiver; - MemoryInstrumentationClientImpl memoryInstrumentationClient(receiver.serializer()); - MemoryInstrumentationImpl memoryInstrumentation(&memoryInstrumentationClient); - - Owner owner; - memoryInstrumentation.addRootObject(&owner); - receiver.serializer()->finish(); - receiver.printGraph(); - EXPECT_EQ(String("[6,0,1,0,0,5,0,4,0,3,9,0,3,0,0,9,0,2,0,0,10,0,5,0,1]"), receiver.dumpNodes()); - EXPECT_EQ(String("[2,7,1,2,8,2,2,8,3,1,0,4]"), receiver.dumpEdges()); - EXPECT_EQ(String("[]"), receiver.dumpBaseToRealNodeId()); -} - -} // namespace diff --git a/third_party/WebKit/Source/core/xml/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xml/XMLHttpRequest.cpp index 7ac35d7..91c32f7 100644 --- a/third_party/WebKit/Source/core/xml/XMLHttpRequest.cpp +++ b/third_party/WebKit/Source/core/xml/XMLHttpRequest.cpp @@ -36,7 +36,6 @@ #include "core/dom/EventListener.h" #include "core/dom/EventNames.h" #include "core/dom/ExceptionCode.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/editing/markup.h" #include "core/fileapi/Blob.h" #include "core/fileapi/File.h" @@ -1249,30 +1248,4 @@ EventTargetData* XMLHttpRequest::ensureEventTargetData() return &m_eventTargetData; } -void XMLHttpRequest::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - ScriptWrappable::reportMemoryUsage(memoryObjectInfo); - ActiveDOMObject::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_upload, "upload"); - info.addMember(m_url, "url"); - info.addMember(m_method, "method"); - info.addMember(m_requestHeaders, "requestHeaders"); - info.addMember(m_requestEntityBody, "requestEntityBody"); - info.addMember(m_mimeTypeOverride, "mimeTypeOverride"); - info.addMember(m_responseBlob, "responseBlob"); - info.addMember(m_loader, "loader"); - info.addMember(m_response, "response"); - info.addMember(m_responseEncoding, "responseEncoding"); - info.addMember(m_decoder, "decoder"); - info.addMember(m_responseText, "responseText"); - info.addMember(m_responseDocument, "responseDocument"); - info.addMember(m_binaryResponseBuilder, "binaryResponseBuilder"); - info.addMember(m_responseArrayBuffer, "responseArrayBuffer"); - info.addMember(m_lastSendURL, "lastSendURL"); - info.addMember(m_eventTargetData, "eventTargetData"); - info.addMember(m_progressEventThrottle, "progressEventThrottle"); - info.addMember(m_securityOrigin, "securityOrigin"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/core/xml/XMLHttpRequest.h b/third_party/WebKit/Source/core/xml/XMLHttpRequest.h index 0763080..6d48451 100644 --- a/third_party/WebKit/Source/core/xml/XMLHttpRequest.h +++ b/third_party/WebKit/Source/core/xml/XMLHttpRequest.h @@ -128,8 +128,6 @@ public: XMLHttpRequestUpload* upload(); - virtual void reportMemoryUsage(MemoryObjectInfo*) const; - DEFINE_ATTRIBUTE_EVENT_LISTENER(readystatechange); DEFINE_ATTRIBUTE_EVENT_LISTENER(abort); DEFINE_ATTRIBUTE_EVENT_LISTENER(error); diff --git a/third_party/WebKit/Source/devtools/protocol.json b/third_party/WebKit/Source/devtools/protocol.json index 8d9ab88..b911474 100644 --- a/third_party/WebKit/Source/devtools/protocol.json +++ b/third_party/WebKit/Source/devtools/protocol.json @@ -78,16 +78,6 @@ { "name": "nodes", "type": "integer" }, { "name": "jsEventListeners", "type": "integer" } ] - }, - { - "name": "getProcessMemoryDistribution", - "parameters": [ - { "name": "reportGraph", "type": "boolean", "optional": true, "description": "Whether native memory graph should be reported in addition to aggregated statistics." } - ], - "returns": [ - { "name": "distribution", "$ref": "MemoryBlock", "description": "An object describing all memory allocated by the process"}, - { "name": "graphMetaInformation", "type": "object", "optional": true, "description": "An object describing structures of nodes and edges in the graph."} - ] } ], "events": [ diff --git a/third_party/WebKit/Source/modules/crypto/Algorithm.cpp b/third_party/WebKit/Source/modules/crypto/Algorithm.cpp index 7336d39..7de4d6c 100644 --- a/third_party/WebKit/Source/modules/crypto/Algorithm.cpp +++ b/third_party/WebKit/Source/modules/crypto/Algorithm.cpp @@ -33,6 +33,7 @@ #include "modules/crypto/AesCbcParams.h" #include "modules/crypto/AesKeyGenParams.h" +#include "wtf/text/WTFString.h" namespace WebCore { diff --git a/third_party/WebKit/Source/modules/crypto/Crypto.h b/third_party/WebKit/Source/modules/crypto/Crypto.h index 12619df..888a426 100644 --- a/third_party/WebKit/Source/modules/crypto/Crypto.h +++ b/third_party/WebKit/Source/modules/crypto/Crypto.h @@ -32,8 +32,8 @@ #include "bindings/v8/ScriptWrappable.h" #include "modules/crypto/SubtleCrypto.h" #include "wtf/Forward.h" -#include "wtf/PassRefPtr.h" #include "wtf/RefCounted.h" +#include "wtf/RefPtr.h" namespace WebCore { diff --git a/third_party/WebKit/Source/modules/crypto/Key.h b/third_party/WebKit/Source/modules/crypto/Key.h index a868a73..4b9c008 100644 --- a/third_party/WebKit/Source/modules/crypto/Key.h +++ b/third_party/WebKit/Source/modules/crypto/Key.h @@ -36,6 +36,7 @@ #include "wtf/Forward.h" #include "wtf/PassRefPtr.h" #include "wtf/RefCounted.h" +#include "wtf/text/WTFString.h" namespace WebCore { diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp index f4ec35e..818c7bb 100644 --- a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp +++ b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp @@ -210,13 +210,4 @@ const AtomicString& MediaSource::interfaceName() const return eventNames().interfaceForMediaSource; } -void MediaSource::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - ScriptWrappable::reportMemoryUsage(memoryObjectInfo); - MediaSourceBase::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_sourceBuffers, "sourceBuffers"); - info.addMember(m_activeSourceBuffers, "activeSourceBuffers"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSource.h b/third_party/WebKit/Source/modules/mediasource/MediaSource.h index 543b4be..10dcd75 100644 --- a/third_party/WebKit/Source/modules/mediasource/MediaSource.h +++ b/third_party/WebKit/Source/modules/mediasource/MediaSource.h @@ -57,8 +57,6 @@ public: using RefCounted<MediaSourceBase>::ref; using RefCounted<MediaSourceBase>::deref; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: explicit MediaSource(ScriptExecutionContext*); diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSourceBase.cpp b/third_party/WebKit/Source/modules/mediasource/MediaSourceBase.cpp index 791e301..c983d8a 100644 --- a/third_party/WebKit/Source/modules/mediasource/MediaSourceBase.cpp +++ b/third_party/WebKit/Source/modules/mediasource/MediaSourceBase.cpp @@ -310,14 +310,4 @@ URLRegistry& MediaSourceBase::registry() const return MediaSourceRegistry::registry(); } -void MediaSourceBase::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - ActiveDOMObject::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_eventTargetData, "eventTargetData"); - info.addMember(m_readyState, "readyState"); - info.addMember(m_private, "private"); - info.addMember(m_asyncEventQueue, "asyncEventQueue"); -} - } diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSourceBase.h b/third_party/WebKit/Source/modules/mediasource/MediaSourceBase.h index 34ef5fb..2e67c51 100644 --- a/third_party/WebKit/Source/modules/mediasource/MediaSourceBase.h +++ b/third_party/WebKit/Source/modules/mediasource/MediaSourceBase.h @@ -87,8 +87,6 @@ public: // URLRegistrable interface virtual URLRegistry& registry() const OVERRIDE; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - using RefCounted<MediaSourceBase>::ref; using RefCounted<MediaSourceBase>::deref; diff --git a/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.cpp b/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.cpp index ef4f8c4..f0bdd5f 100644 --- a/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.cpp +++ b/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.cpp @@ -200,13 +200,4 @@ const AtomicString& WebKitMediaSource::interfaceName() const return eventNames().interfaceForWebKitMediaSource; } -void WebKitMediaSource::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - ScriptWrappable::reportMemoryUsage(memoryObjectInfo); - MediaSourceBase::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_sourceBuffers, "sourceBuffers"); - info.addMember(m_activeSourceBuffers, "activeSourceBuffers"); -} - } // namespace WebCore diff --git a/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.h b/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.h index 1769cf5..a46f216 100644 --- a/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.h +++ b/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.h @@ -57,8 +57,6 @@ public: using RefCounted<MediaSourceBase>::ref; using RefCounted<MediaSourceBase>::deref; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - private: explicit WebKitMediaSource(ScriptExecutionContext*); diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp index 16bf9e9..49b4878 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp @@ -30,7 +30,6 @@ #include "core/dom/Document.h" #include "core/dom/ExceptionCode.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "core/html/HTMLMediaElement.h" #include "core/inspector/ScriptCallStack.h" #include "core/platform/audio/FFTFrame.h" @@ -63,8 +62,6 @@ #include "modules/webaudio/PeriodicWave.h" #include "modules/webaudio/ScriptProcessorNode.h" #include "modules/webaudio/WaveShaperNode.h" -#include "wtf/MemoryInstrumentationHashSet.h" -#include "wtf/MemoryInstrumentationVector.h" #if DEBUG_AUDIONODE_REFERENCES #include <stdio.h> @@ -959,30 +956,6 @@ void AudioContext::decrementActiveSourceCount() atomicDecrement(&m_activeSourceCount); } -void AudioContext::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - AutoLocker locker(const_cast<AudioContext*>(this)); - - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Audio); - ActiveDOMObject::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_destinationNode, "destinationNode"); - info.addMember(m_listener, "listener"); - info.addMember(m_finishedNodes, "finishedNodes"); - info.addMember(m_referencedNodes, "referencedNodes"); - info.addMember(m_nodesMarkedForDeletion, "nodesMarkedForDeletion"); - info.addMember(m_nodesToDelete, "nodesToDelete"); - info.addMember(m_dirtySummingJunctions, "dirtySummingJunctions"); - info.addMember(m_dirtyAudioNodeOutputs, "dirtyAudioNodeOutputs"); - info.addMember(m_automaticPullNodes, "automaticPullNodes"); - info.addMember(m_renderingAutomaticPullNodes, "renderingAutomaticPullNodes"); - info.addMember(m_contextGraphMutex, "contextGraphMutex"); - info.addMember(m_deferredFinishDerefList, "deferredFinishDerefList"); - info.addMember(m_hrtfDatabaseLoader, "hrtfDatabaseLoader"); - info.addMember(m_eventTargetData, "eventTargetData"); - info.addMember(m_renderTarget, "renderTarget"); - info.addMember(m_audioDecoder, "audioDecoder"); -} - } // namespace WebCore #endif // ENABLE(WEB_AUDIO) diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContext.h b/third_party/WebKit/Source/modules/webaudio/AudioContext.h index cde1de8..ad974a3 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioContext.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioContext.h @@ -247,8 +247,6 @@ public: static unsigned s_hardwareContextCount; - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - protected: explicit AudioContext(Document*); AudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate); diff --git a/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp index 460f772..406b2db 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp @@ -29,14 +29,12 @@ #include "modules/webaudio/AudioNode.h" #include "core/dom/ExceptionCode.h" -#include "core/dom/WebCoreMemoryInstrumentation.h" #include "modules/webaudio/AudioContext.h" #include "modules/webaudio/AudioNodeInput.h" #include "modules/webaudio/AudioNodeOutput.h" #include "modules/webaudio/AudioParam.h" #include "wtf/Atomics.h" #include "wtf/MainThread.h" -#include "wtf/MemoryInstrumentationVector.h" #if DEBUG_AUDIONODE_REFERENCES #include <stdio.h> @@ -504,14 +502,6 @@ void AudioNode::finishDeref(RefType refType) } } -void AudioNode::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Audio); - info.addMember(m_context, "context"); - info.addMember(m_inputs, "inputs"); - info.addMember(m_outputs, "outputs"); -} - #if DEBUG_AUDIONODE_REFERENCES bool AudioNode::s_isNodeCountInitialized = false; diff --git a/third_party/WebKit/Source/modules/webaudio/AudioNode.h b/third_party/WebKit/Source/modules/webaudio/AudioNode.h index 9be358d..316e2f8 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioNode.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioNode.h @@ -168,8 +168,6 @@ public: void enableOutputsIfNecessary(); void disableOutputsIfNecessary(); - void reportMemoryUsage(MemoryObjectInfo*) const; - unsigned long channelCount(); virtual void setChannelCount(unsigned long, ExceptionCode&); diff --git a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp index 2ab6038..0f533fb 100644 --- a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp +++ b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp @@ -656,16 +656,6 @@ void WebDevToolsAgentImpl::paintPageOverlay(WebCanvas* canvas) } } -WebVector<WebMemoryUsageInfo> WebDevToolsAgentImpl::processMemoryDistribution() const -{ - HashMap<String, size_t> memoryInfo = m_webViewImpl->page()->inspectorController()->processMemoryDistribution(); - WebVector<WebMemoryUsageInfo> memoryInfoVector((size_t)memoryInfo.size()); - size_t i = 0; - for (HashMap<String, size_t>::const_iterator it = memoryInfo.begin(); it != memoryInfo.end(); ++it) - memoryInfoVector[i++] = WebMemoryUsageInfo(it->key, it->value); - return memoryInfoVector; -} - void WebDevToolsAgentImpl::highlight() { m_webViewImpl->addPageOverlay(this, OverlayZOrders::highlight); diff --git a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h index 610c5e0..afa0b9f 100644 --- a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h +++ b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h @@ -121,8 +121,6 @@ public: // WebPageOverlay virtual void paintPageOverlay(WebCanvas*); - virtual WebVector<WebMemoryUsageInfo> processMemoryDistribution() const; - private: // WebThread::TaskObserver virtual void willProcessTask(); diff --git a/third_party/WebKit/Source/weborigin/KURL.cpp b/third_party/WebKit/Source/weborigin/KURL.cpp index a666e96..99b20a1 100644 --- a/third_party/WebKit/Source/weborigin/KURL.cpp +++ b/third_party/WebKit/Source/weborigin/KURL.cpp @@ -29,8 +29,6 @@ #include "weborigin/KURL.h" #include "wtf/HashMap.h" -#include "wtf/MemoryInstrumentation.h" -#include "wtf/MemoryInstrumentationString.h" #include "wtf/StdLibExtras.h" #include "wtf/text/CString.h" #include "wtf/text/StringHash.h" @@ -839,14 +837,6 @@ void KURL::replaceComponents(const url_canon::Replacements<CHAR>& replacements) m_string = AtomicString::fromUTF8(output.data(), output.length()); } -void KURL::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - WTF::MemoryClassInfo info(memoryObjectInfo, this); - info.addMember(m_string, "string"); - info.addMember(m_innerURL, "innerURL"); - info.addMember(m_parsed, "parsed"); -} - bool KURL::isSafeToSendToAnotherThread() const { return m_string.isSafeToSendToAnotherThread() diff --git a/third_party/WebKit/Source/weborigin/KURL.h b/third_party/WebKit/Source/weborigin/KURL.h index eeab8c8..22a297c 100644 --- a/third_party/WebKit/Source/weborigin/KURL.h +++ b/third_party/WebKit/Source/weborigin/KURL.h @@ -176,7 +176,6 @@ public: void print() const; #endif - void reportMemoryUsage(MemoryObjectInfo*) const; bool isSafeToSendToAnotherThread() const; private: diff --git a/third_party/WebKit/Source/wtf/Forward.h b/third_party/WebKit/Source/wtf/Forward.h index 274d376..bc49fae 100644 --- a/third_party/WebKit/Source/wtf/Forward.h +++ b/third_party/WebKit/Source/wtf/Forward.h @@ -43,8 +43,6 @@ namespace WTF { class Int8Array; class Int16Array; class Int32Array; - class MemoryInstrumentation; - class MemoryObjectInfo; class String; template <typename T> class StringBuffer; class StringBuilder; @@ -74,8 +72,6 @@ using WTF::Float64Array; using WTF::Int8Array; using WTF::Int16Array; using WTF::Int32Array; -using WTF::MemoryInstrumentation; -using WTF::MemoryObjectInfo; using WTF::String; using WTF::StringBuffer; using WTF::StringBuilder; diff --git a/third_party/WebKit/Source/wtf/MemoryInstrumentation.cpp b/third_party/WebKit/Source/wtf/MemoryInstrumentation.cpp deleted file mode 100644 index 56b50e1..0000000 --- a/third_party/WebKit/Source/wtf/MemoryInstrumentation.cpp +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "MemoryInstrumentation.h" - -#include "wtf/MemoryObjectInfo.h" -#include <string.h> - -#if DEBUG_POINTER_INSTRUMENTATION -#include <stdio.h> -#include "wtf/Assertions.h" -#endif - -namespace WTF { - -MemoryInstrumentation::MemoryInstrumentation(MemoryInstrumentationClient* client) - : m_client(client) -{ -} - -MemoryInstrumentation::~MemoryInstrumentation() -{ -} - -void MemoryInstrumentation::reportEdge(const void* target, const char* name, MemberType memberType) -{ - m_client->reportEdge(target, name, memberType); -} - -MemoryObjectType MemoryInstrumentation::getObjectType(MemoryObjectInfo* objectInfo) -{ - return objectInfo->objectType(); -} - -void MemoryInstrumentation::reportLinkToBuffer(const void* buffer, MemoryObjectType ownerObjectType, size_t size, const char* className, const char* edgeName) -{ - MemoryObjectInfo memoryObjectInfo(this, ownerObjectType, 0); - memoryObjectInfo.reportObjectInfo(buffer, ownerObjectType, size); - memoryObjectInfo.setClassName(className); - m_client->reportLeaf(memoryObjectInfo, edgeName); -} - -MemoryInstrumentation::WrapperBase::WrapperBase(MemoryObjectType objectType, const void* pointer) - : m_pointer(pointer) - , m_ownerObjectType(objectType) -{ -#if DEBUG_POINTER_INSTRUMENTATION - m_callStackSize = s_maxCallStackSize; - WTFGetBacktrace(m_callStack, &m_callStackSize); -#endif -} - -void MemoryInstrumentation::WrapperBase::process(MemoryInstrumentation* memoryInstrumentation) -{ - processPointer(memoryInstrumentation, false); -} - -void MemoryInstrumentation::WrapperBase::processPointer(MemoryInstrumentation* memoryInstrumentation, bool isRoot) -{ - MemoryObjectInfo memoryObjectInfo(memoryInstrumentation, m_ownerObjectType, m_pointer); - if (isRoot) - memoryObjectInfo.markAsRoot(); - callReportMemoryUsage(&memoryObjectInfo); - - const void* realAddress = memoryObjectInfo.reportedPointer(); - ASSERT(realAddress); - - if (memoryObjectInfo.firstVisit()) { - memoryInstrumentation->countObjectSize(realAddress, memoryObjectInfo.objectType(), memoryObjectInfo.objectSize()); - memoryInstrumentation->m_client->reportNode(memoryObjectInfo); - } - - if (realAddress != m_pointer) - memoryInstrumentation->m_client->reportBaseAddress(m_pointer, realAddress); - - if (memoryObjectInfo.firstVisit() - && !memoryObjectInfo.customAllocation() - && !memoryInstrumentation->checkCountedObject(realAddress)) { -#if DEBUG_POINTER_INSTRUMENTATION - fputs("Unknown object counted:\n", stderr); - WTFPrintBacktrace(m_callStack, m_callStackSize); -#endif - } -} - -void MemoryInstrumentation::WrapperBase::processRootObjectRef(MemoryInstrumentation* memoryInstrumentation) -{ - MemoryObjectInfo memoryObjectInfo(memoryInstrumentation, m_ownerObjectType, m_pointer); - memoryObjectInfo.markAsRoot(); - callReportMemoryUsage(&memoryObjectInfo); - - ASSERT(m_pointer == memoryObjectInfo.reportedPointer()); - memoryInstrumentation->m_client->reportNode(memoryObjectInfo); -} - -#if COMPILER(MSVC) -static const char* className(const char* functionName, char* buffer, const int maxLength) -{ - // MSVC generates names like this: 'WTF::FN<class WebCore::SharedBuffer>::fn' - static const char prefix[] = "WTF::FN<"; - ASSERT(!strncmp(functionName, prefix, sizeof(prefix) - 1)); - const char* begin = strchr(functionName, ' '); - if (!begin) { // Fallback. - strncpy(buffer, functionName, maxLength); - buffer[maxLength - 1] = 0; - return buffer; - } - const char* end = strrchr(begin, '>'); - ASSERT(end); - int length = end - begin; - length = length < maxLength ? length : maxLength - 1; - memcpy(buffer, begin, length); - buffer[length] = 0; - return buffer; -} -#else -static const char* className(const char* functionName, char* buffer, const int maxLength) -{ -#if COMPILER(CLANG) - static const char prefix[] = "[T ="; -#elif COMPILER(GCC) - static const char prefix[] = "[with T ="; -#else - static const char prefix[] = "T ="; -#endif - const char* begin = strstr(functionName, prefix); - if (!begin) { // Fallback. - strncpy(buffer, functionName, maxLength); - buffer[maxLength - 1] = 0; - return buffer; - } - begin += sizeof(prefix); - const char* end = strchr(begin, ']'); - ASSERT(end); - int length = end - begin; - length = length < maxLength ? length : maxLength - 1; - memcpy(buffer, begin, length); - buffer[length] = 0; - return buffer; -} -#endif - -void MemoryClassInfo::callReportObjectInfo(MemoryObjectInfo* memoryObjectInfo, const void* objectAddress, const char* stringWithClassName, MemoryObjectType objectType, size_t actualSize) -{ - memoryObjectInfo->reportObjectInfo(objectAddress, objectType, actualSize); - char buffer[256]; - memoryObjectInfo->setClassName(className(stringWithClassName, buffer, sizeof(buffer))); -} - -void MemoryClassInfo::init(const void* objectAddress, const char* stringWithClassName, MemoryObjectType objectType, size_t actualSize) -{ - callReportObjectInfo(m_memoryObjectInfo, objectAddress, stringWithClassName, objectType, actualSize); - m_memoryInstrumentation = m_memoryObjectInfo->memoryInstrumentation(); - m_objectType = m_memoryObjectInfo->objectType(); - m_skipMembers = !m_memoryObjectInfo->firstVisit(); -} - -void MemoryClassInfo::addRawBuffer(const void* buffer, size_t size, const char* className, const char* edgeName) -{ - if (!m_skipMembers) - m_memoryInstrumentation->addRawBuffer(buffer, m_objectType, size, className, edgeName); -} - -void MemoryClassInfo::addPrivateBuffer(size_t size, MemoryObjectType ownerObjectType, const char* className, const char* edgeName) -{ - if (!size) - return; - if (m_skipMembers) - return; - if (!ownerObjectType) - ownerObjectType = m_objectType; - m_memoryInstrumentation->countObjectSize(0, ownerObjectType, size); - m_memoryInstrumentation->reportLinkToBuffer(0, ownerObjectType, size, className, edgeName); -} - -void MemoryClassInfo::setCustomAllocation(bool customAllocation) -{ - m_memoryObjectInfo->setCustomAllocation(customAllocation); -} - -} // namespace WTF diff --git a/third_party/WebKit/Source/wtf/MemoryInstrumentation.h b/third_party/WebKit/Source/wtf/MemoryInstrumentation.h deleted file mode 100644 index 4844d57..0000000 --- a/third_party/WebKit/Source/wtf/MemoryInstrumentation.h +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MemoryInstrumentation_h -#define MemoryInstrumentation_h - -#include "wtf/OwnPtr.h" -#include "wtf/PassOwnPtr.h" -#include "wtf/RefPtr.h" -#include "wtf/WTFExport.h" - -#define DEBUG_POINTER_INSTRUMENTATION 0 - -namespace WTF { - -class MemoryClassInfo; -class MemoryObjectInfo; -class MemoryInstrumentation; - -typedef const char* MemoryObjectType; - -enum MemberType { - PointerMember, - ReferenceMember, - RetainingPointer, - LastMemberTypeEntry -}; - -template <typename B, typename D> -struct IsBaseOf { - typedef char (&Yes)[1]; - typedef char (&No)[2]; - - template <typename U, typename V> - struct Host { - operator U*() const; - operator V*(); - }; - - template <typename T> static Yes checkBase(D*, T); - static No checkBase(B*, int); - - static const bool value = sizeof(checkBase(Host<B,D>(), int())) == sizeof(Yes); -}; - -template <bool B, class T = void> -struct EnableIf { - typedef T Type; -}; - -template <class T> -struct EnableIf<false, T> {}; - -class MemoryReporterTag {}; - -class MemoryInstrumentationClient { -public: - virtual ~MemoryInstrumentationClient() { } - virtual void countObjectSize(const void*, MemoryObjectType, size_t) = 0; - virtual bool visited(const void*) = 0; - virtual bool checkCountedObject(const void*) = 0; - - virtual void reportNode(const MemoryObjectInfo&) = 0; - virtual void reportEdge(const void* target, const char* edgeName, MemberType) = 0; - virtual void reportLeaf(const MemoryObjectInfo&, const char* edgeName) = 0; - virtual void reportBaseAddress(const void* base, const void* real) = 0; - virtual int registerString(const char*) = 0; -}; - -class WTF_EXPORT MemoryInstrumentation { -public: - explicit MemoryInstrumentation(MemoryInstrumentationClient*); - virtual ~MemoryInstrumentation(); - - template <typename T> void addRootObject(const T& t, MemoryObjectType objectType = 0) - { - MemberTypeTraits<T>::addRootObject(this, t, objectType); - processDeferredObjects(); - } - - template <typename T> void addRootObject(const OwnPtr<T>&, MemoryObjectType = 0); // Link time guard. - template <typename T> void addRootObject(const RefPtr<T>&, MemoryObjectType = 0); // Link time guard. - - template <int> - struct InstrumentationSelector { - template <typename T> static void reportObjectMemoryUsage(const T*, MemoryObjectInfo*); - }; - - template <typename Type> - class IsInstrumented { - class yes { - char m; - }; - - class no { - yes m[2]; - }; - - struct BaseMixin { - void reportMemoryUsage(MemoryObjectInfo*) const { } - }; - - struct Base : public Type, public BaseMixin { - // Provide expicit destructor without definition to avoid MSVC warning "destructor could - // not be generated because a base class destructor is inaccessible." - ~Base(); - }; - - template <typename T, T t> class Helper { }; - - template <typename U> static no deduce(U*, Helper<void (BaseMixin::*)(MemoryObjectInfo*) const, &U::reportMemoryUsage>* = 0); - static yes deduce(...); - - public: - static const bool result = sizeof(yes) == sizeof(deduce((Base*)(0))); - - }; - -protected: - class WTF_EXPORT WrapperBase { - public: - WrapperBase(MemoryObjectType, const void* pointer); - virtual ~WrapperBase() { } - void process(MemoryInstrumentation*); - void processPointer(MemoryInstrumentation*, bool isRoot); - void processRootObjectRef(MemoryInstrumentation*); - - protected: - virtual void callReportMemoryUsage(MemoryObjectInfo*) = 0; - const void* m_pointer; - const MemoryObjectType m_ownerObjectType; - - private: -#if DEBUG_POINTER_INSTRUMENTATION - static const int s_maxCallStackSize = 32; - void* m_callStack[s_maxCallStackSize]; - int m_callStackSize; -#endif - }; - -private: - void countObjectSize(const void* object, MemoryObjectType objectType, size_t size) { m_client->countObjectSize(object, objectType, size); } - bool visited(const void* pointer) { return m_client->visited(pointer); } - bool checkCountedObject(const void* pointer) { return m_client->checkCountedObject(pointer); } - - void reportEdge(const void* target, const char* edgeName, MemberType); - - virtual void deferObject(PassOwnPtr<WrapperBase>) = 0; - virtual void processDeferredObjects() = 0; - - static MemoryObjectType getObjectType(MemoryObjectInfo*); - - friend class MemoryObjectInfo; - friend class MemoryClassInfo; - - template<typename T> class Wrapper : public WrapperBase { - public: - Wrapper(const T* pointer, MemoryObjectType); - - protected: - virtual void callReportMemoryUsage(MemoryObjectInfo*) OVERRIDE; - }; - - template<typename T> void addObject(const T& t, MemoryObjectInfo* ownerObjectInfo, const char* edgeName, MemberType memberType) - { - MemberTypeTraits<T>::addObject(this, t, ownerObjectInfo, edgeName, memberType); - } - void addRawBuffer(const void* buffer, MemoryObjectType ownerObjectType, size_t size, const char* className = 0, const char* edgeName = 0) - { - if (!buffer || visited(buffer)) - return; - countObjectSize(buffer, ownerObjectType, size); - reportLinkToBuffer(buffer, ownerObjectType, size, className, edgeName); - } - void reportLinkToBuffer(const void* buffer, MemoryObjectType ownerObjectType, size_t, const char* nodeName, const char* edgeName); - - template<typename T> - struct MemberTypeTraits { // Default ReferenceMember implementation. - static void addObject(MemoryInstrumentation* instrumentation, const T& t, MemoryObjectInfo* ownerObjectInfo, const char* edgeName, MemberType) - { - instrumentation->addObjectImpl(&t, ownerObjectInfo, ReferenceMember, edgeName); - } - - static void addRootObject(MemoryInstrumentation* instrumentation, const T& t, MemoryObjectType objectType) - { - Wrapper<T>(&t, objectType).processRootObjectRef(instrumentation); - } - }; - - template<typename T> - struct MemberTypeTraits<T*> { // Custom PointerMember implementation. - static void addObject(MemoryInstrumentation* instrumentation, const T* const& t, MemoryObjectInfo* ownerObjectInfo, const char* edgeName, MemberType memberType) - { - instrumentation->addObjectImpl(t, ownerObjectInfo, memberType != LastMemberTypeEntry ? memberType : PointerMember, edgeName); - } - - static void addRootObject(MemoryInstrumentation* instrumentation, const T* const& t, MemoryObjectType objectType) - { - if (t && !instrumentation->visited(t)) - Wrapper<T>(t, objectType).processPointer(instrumentation, true); - } - }; - - template<typename T> void addObjectImpl(const T*, MemoryObjectInfo*, MemberType, const char* edgeName); - template<typename T> void addObjectImpl(const OwnPtr<T>*, MemoryObjectInfo*, MemberType, const char* edgeName); - template<typename T> void addObjectImpl(const RefPtr<T>*, MemoryObjectInfo*, MemberType, const char* edgeName); - - MemoryInstrumentationClient* m_client; -}; - -// We are trying to keep the signature of the function as small as possible -// because it significantly affects the binary size. -// We caluclates class name for 624 classes at the moment. -// So one extra byte of the function signature increases the binary size to 624 extra bytes. -#if COMPILER(MSVC) -template <typename T> struct FN { - static char* fn() { return const_cast<char*>(__FUNCTION__); } -}; - -template <typename T> char* fn() { return FN<T>::fn(); } -#else -template <typename T> char* fn() { return const_cast<char*>(__PRETTY_FUNCTION__); } -#endif - -class WTF_EXPORT MemoryClassInfo { -public: - template<typename T> - MemoryClassInfo(MemoryObjectInfo* memoryObjectInfo, const T* pointer, MemoryObjectType objectType = 0, size_t actualSize = sizeof(T)) - : m_memoryObjectInfo(memoryObjectInfo) - , m_memoryInstrumentation(0) - , m_objectType(0) - , m_skipMembers(false) - { - init(pointer, fn<T>(), objectType, actualSize); - } - - template<typename M> void addMember(const M& member, const char* edgeName = 0, MemberType memberType = LastMemberTypeEntry) - { - if (!m_skipMembers) - m_memoryInstrumentation->addObject(member, m_memoryObjectInfo, edgeName, memberType); - } - - void addRawBuffer(const void* buffer, size_t, const char* className = 0, const char* edgeName = 0); - void addPrivateBuffer(size_t, MemoryObjectType ownerObjectType = 0, const char* className = 0, const char* edgeName = 0); - void setCustomAllocation(bool); - - void addWeakPointer(void*) { } - template<typename M> void ignoreMember(const M&) { } - - static void callReportObjectInfo(MemoryObjectInfo*, const void* pointer, const char* stringWithClassName, MemoryObjectType, size_t actualSize); - -private: - void init(const void* pointer, const char* stringWithClassName, MemoryObjectType, size_t actualSize); - - MemoryObjectInfo* m_memoryObjectInfo; - MemoryInstrumentation* m_memoryInstrumentation; - MemoryObjectType m_objectType; - bool m_skipMembers; -}; - -template <> -template <typename T> -void MemoryInstrumentation::InstrumentationSelector<true>::reportObjectMemoryUsage(const T* object, MemoryObjectInfo* memoryObjectInfo) -{ - object->reportMemoryUsage(memoryObjectInfo); -} - -template <> -template <typename T> -void MemoryInstrumentation::InstrumentationSelector<false>::reportObjectMemoryUsage(const T* object, MemoryObjectInfo* memoryObjectInfo) -{ - MemoryClassInfo::callReportObjectInfo(memoryObjectInfo, object, fn<T>(), 0, sizeof(T)); -} - -template <typename T> -typename EnableIf<IsBaseOf<MemoryReporterTag, T>::value, void>::Type reportMemoryUsage(const T* object, MemoryObjectInfo* memoryObjectInfo) -{ - COMPILE_ASSERT(sizeof(T), WTF_MemoryInstrumentation_Need_Complete_Type); - object->reportMemoryUsage(memoryObjectInfo); -} - -template <typename T> -typename EnableIf<!IsBaseOf<MemoryReporterTag, T>::value, void>::Type reportMemoryUsage(const T* object, MemoryObjectInfo* memoryObjectInfo) -{ - COMPILE_ASSERT(sizeof(T), WTF_MemoryInstrumentation_Need_Complete_Type); - MemoryInstrumentation::InstrumentationSelector<MemoryInstrumentation::IsInstrumented<T>::result>::reportObjectMemoryUsage(object, memoryObjectInfo); -} - -template<typename T> -void MemoryInstrumentation::addObjectImpl(const T* object, MemoryObjectInfo* ownerObjectInfo, MemberType memberType, const char* edgeName) -{ - if (memberType == PointerMember) - return; - if (memberType == ReferenceMember) - reportMemoryUsage(object, ownerObjectInfo); - else { - if (!object) - return; - reportEdge(object, edgeName, memberType); - if (visited(object)) - return; - deferObject(adoptPtr(new Wrapper<T>(object, getObjectType(ownerObjectInfo)))); - } -} - -template<typename T> -void MemoryInstrumentation::addObjectImpl(const OwnPtr<T>* object, MemoryObjectInfo* ownerObjectInfo, MemberType memberType, const char* edgeName) -{ - if (memberType == PointerMember && !visited(object)) - countObjectSize(object, getObjectType(ownerObjectInfo), sizeof(*object)); - addObjectImpl(object->get(), ownerObjectInfo, RetainingPointer, edgeName); -} - -template<typename T> -void MemoryInstrumentation::addObjectImpl(const RefPtr<T>* object, MemoryObjectInfo* ownerObjectInfo, MemberType memberType, const char* edgeName) -{ - if (memberType == PointerMember && !visited(object)) - countObjectSize(object, getObjectType(ownerObjectInfo), sizeof(*object)); - addObjectImpl(object->get(), ownerObjectInfo, RetainingPointer, edgeName); -} - -template<typename T> -MemoryInstrumentation::Wrapper<T>::Wrapper(const T* pointer, MemoryObjectType ownerObjectType) - : WrapperBase(ownerObjectType, pointer) -{ -} - -template<typename T> -void MemoryInstrumentation::Wrapper<T>::callReportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) -{ - reportMemoryUsage(static_cast<const T*>(m_pointer), memoryObjectInfo); -} - -// Link time guard for classes with external memory instrumentation. -template<typename T, size_t inlineCapacity> class Vector; -template<typename T, size_t inlineCapacity> void reportMemoryUsage(const Vector<T, inlineCapacity>*, MemoryObjectInfo*); - -template<typename KeyArg, typename MappedArg, typename HashArg, typename KeyTraitsArg, typename MappedTraitsArg> class HashMap; -template<typename KeyArg, typename MappedArg, typename HashArg, typename KeyTraitsArg, typename MappedTraitsArg> void reportMemoryUsage(const HashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg>*, MemoryObjectInfo*); - -template<typename Value, typename HashArg, typename TraitsArg> class HashSet; -template<typename Value, typename HashArg, typename TraitsArg> void reportMemoryUsage(const HashSet<Value, HashArg, TraitsArg>*, MemoryObjectInfo*); - -template<typename ValueArg, typename HashArg, typename TraitsArg> class HashCountedSet; -template<typename ValueArg, typename HashArg, typename TraitsArg> void reportMemoryUsage(const HashCountedSet<ValueArg, HashArg, TraitsArg>*, MemoryObjectInfo*); - -template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSet; -template<typename ValueArg, size_t inlineCapacity, typename HashArg> void reportMemoryUsage(const ListHashSet<ValueArg, inlineCapacity, HashArg>*, MemoryObjectInfo*); - -class String; -void reportMemoryUsage(const String*, MemoryObjectInfo*); - -class StringImpl; -void reportMemoryUsage(const StringImpl*, MemoryObjectInfo*); - -class AtomicString; -void reportMemoryUsage(const AtomicString*, MemoryObjectInfo*); - -class CString; -void reportMemoryUsage(const CString*, MemoryObjectInfo*); - -class CStringBuffer; -void reportMemoryUsage(const CStringBuffer*, MemoryObjectInfo*); - -class ParsedURL; -void reportMemoryUsage(const ParsedURL*, MemoryObjectInfo*); - -class URLString; -void reportMemoryUsage(const URLString*, MemoryObjectInfo*); - -} // namespace WTF - -using WTF::MemoryReporterTag; - -#endif // !defined(MemoryInstrumentation_h) diff --git a/third_party/WebKit/Source/wtf/MemoryInstrumentationArrayBufferView.h b/third_party/WebKit/Source/wtf/MemoryInstrumentationArrayBufferView.h deleted file mode 100644 index 5a9da03..0000000 --- a/third_party/WebKit/Source/wtf/MemoryInstrumentationArrayBufferView.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MemoryInstrumentationArrayBufferView_h -#define MemoryInstrumentationArrayBufferView_h - -#include "wtf/ArrayBufferView.h" -#include "wtf/MemoryInstrumentation.h" - -namespace WTF { - -inline void reportMemoryUsage(const ArrayBufferView* arrayBufferView, MemoryObjectInfo* memoryObjectInfo) -{ - MemoryClassInfo info(memoryObjectInfo, arrayBufferView); - info.addMember(arrayBufferView->buffer().get(), "buffer", RetainingPointer); -} - -inline void reportMemoryUsage(const ArrayBuffer* arrayBuffer, MemoryObjectInfo* memoryObjectInfo) -{ - MemoryClassInfo info(memoryObjectInfo, arrayBuffer); - info.addRawBuffer(arrayBuffer->data(), arrayBuffer->byteLength(), "byte[]", "data"); -} - -} - -#endif // !defined(MemoryInstrumentationArrayBufferView_h) diff --git a/third_party/WebKit/Source/wtf/MemoryInstrumentationHashCountedSet.h b/third_party/WebKit/Source/wtf/MemoryInstrumentationHashCountedSet.h deleted file mode 100644 index 3ddbff3..0000000 --- a/third_party/WebKit/Source/wtf/MemoryInstrumentationHashCountedSet.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MemoryInstrumentationHashCountedSet_h -#define MemoryInstrumentationHashCountedSet_h - -#include "wtf/HashCountedSet.h" -#include "wtf/MemoryInstrumentationSequence.h" - -namespace WTF { - -template<typename ValueArg, typename HashArg, typename TraitsArg> -void reportMemoryUsage(const HashCountedSet<ValueArg, HashArg, TraitsArg>* hashSet, MemoryObjectInfo* memoryObjectInfo) -{ - MemoryClassInfo info(memoryObjectInfo, hashSet); - - typedef HashMap<ValueArg, unsigned, HashArg, TraitsArg> HashMapType; - info.addPrivateBuffer(sizeof(typename HashMapType::ValueType) * hashSet->capacity(), 0, "ValueType[]", "data"); - SequenceMemoryInstrumentationTraits<ValueArg>::reportMemoryUsage(hashSet->begin().keys(), hashSet->end().keys(), info); -} - -} - -#endif // !defined(MemoryInstrumentationHashCountedSet_h) diff --git a/third_party/WebKit/Source/wtf/MemoryInstrumentationHashMap.h b/third_party/WebKit/Source/wtf/MemoryInstrumentationHashMap.h deleted file mode 100644 index 8a2fbe2..0000000 --- a/third_party/WebKit/Source/wtf/MemoryInstrumentationHashMap.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MemoryInstrumentationHashMap_h -#define MemoryInstrumentationHashMap_h - -#include "wtf/HashMap.h" -#include "wtf/MemoryInstrumentationSequence.h" - -namespace WTF { - -template<typename KeyArg, typename MappedArg, typename HashArg, typename KeyTraitsArg, typename MappedTraitsArg> -void reportMemoryUsage(const HashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg>* hashMap, MemoryObjectInfo* memoryObjectInfo) -{ - MemoryClassInfo info(memoryObjectInfo, hashMap); - typedef HashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg> HashMapType; - info.addPrivateBuffer(sizeof(typename HashMapType::ValueType) * hashMap->capacity(), 0, "ValueType[]", "data"); - - SequenceMemoryInstrumentationTraits<KeyArg>::reportMemoryUsage(hashMap->begin().keys(), hashMap->end().keys(), info); - SequenceMemoryInstrumentationTraits<MappedArg>::reportMemoryUsage(hashMap->begin().values(), hashMap->end().values(), info); -} - -} - -#endif // !defined(MemoryInstrumentationHashMap_h) diff --git a/third_party/WebKit/Source/wtf/MemoryInstrumentationHashSet.h b/third_party/WebKit/Source/wtf/MemoryInstrumentationHashSet.h deleted file mode 100644 index 2a3588a..0000000 --- a/third_party/WebKit/Source/wtf/MemoryInstrumentationHashSet.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MemoryInstrumentationHashSet_h -#define MemoryInstrumentationHashSet_h - -#include "wtf/HashSet.h" -#include "wtf/MemoryInstrumentationSequence.h" - -namespace WTF { - -template<typename ValueArg, typename HashArg, typename TraitsArg> -void reportMemoryUsage(const HashSet<ValueArg, HashArg, TraitsArg>* hashSet, MemoryObjectInfo* memoryObjectInfo) -{ - MemoryClassInfo info(memoryObjectInfo, hashSet); - info.addPrivateBuffer(sizeof(typename HashTable<ValueArg, ValueArg, IdentityExtractor, HashArg, TraitsArg, TraitsArg>::ValueType) * hashSet->capacity(), 0, "ValueType[]", "data"); - SequenceMemoryInstrumentationTraits<ValueArg>::reportMemoryUsage(hashSet->begin(), hashSet->end(), info); -} - -} - -#endif // !defined(MemoryInstrumentationHashSet_h) diff --git a/third_party/WebKit/Source/wtf/MemoryInstrumentationListHashSet.h b/third_party/WebKit/Source/wtf/MemoryInstrumentationListHashSet.h deleted file mode 100644 index 8d7502e..0000000 --- a/third_party/WebKit/Source/wtf/MemoryInstrumentationListHashSet.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MemoryInstrumentationListHashSet_h -#define MemoryInstrumentationListHashSet_h - -#include "wtf/ListHashSet.h" -#include "wtf/MemoryInstrumentationSequence.h" - -namespace WTF { - -template<typename ValueArg, size_t inlineCapacity, typename HashArg> -void reportMemoryUsage(const ListHashSet<ValueArg, inlineCapacity, HashArg>* set, MemoryObjectInfo* memoryObjectInfo) -{ - MemoryClassInfo info(memoryObjectInfo, set); - info.addPrivateBuffer(set->sizeInBytes() - sizeof(*set), 0, "ValueType[]", "data"); - SequenceMemoryInstrumentationTraits<ValueArg>::reportMemoryUsage(set->begin(), set->end(), info); -} - -} - -#endif // !defined(MemoryInstrumentationListHashSet_h) diff --git a/third_party/WebKit/Source/wtf/MemoryInstrumentationSequence.h b/third_party/WebKit/Source/wtf/MemoryInstrumentationSequence.h deleted file mode 100644 index 6165a43..0000000 --- a/third_party/WebKit/Source/wtf/MemoryInstrumentationSequence.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MemoryInstrumentationSequence_h -#define MemoryInstrumentationSequence_h - -#include "wtf/MemoryInstrumentation.h" -#include "wtf/TypeTraits.h" - -namespace WTF { - -template <typename T> struct NotConvertibleToInteger { -}; - -// Default implementation with integer type filter. -template<typename ValueType> -struct SequenceMemoryInstrumentationTraits { - template <typename I> static void reportMemoryUsage(I begin, I end, MemoryClassInfo& info) - { - // Check if type is convertible to integer to handle iteration through enum values. - typedef SequenceMemoryInstrumentationTraits<typename Conditional<IsConvertibleToInteger<ValueType>::value, int, NotConvertibleToInteger<ValueType> >::Type> SequenceTraits; - SequenceTraits::reportMemoryUsage(begin, end, info); - } - -}; - -// Specialization for the types which can't be converted to int. -template<typename ValueType> -struct SequenceMemoryInstrumentationTraits<NotConvertibleToInteger<ValueType> > { - template <typename I> - static void reportMemoryUsage(I iterator, I end, MemoryClassInfo& info) - { - while (iterator != end) { - info.addMember(*iterator, "item"); - ++iterator; - } - } -}; - -template<> struct SequenceMemoryInstrumentationTraits<int> { - template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&) { } -}; - -template<> struct SequenceMemoryInstrumentationTraits<void*> { - template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&) { } -}; - -template<> struct SequenceMemoryInstrumentationTraits<char*> { - template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&) { } -}; - -template<> struct SequenceMemoryInstrumentationTraits<const char*> { - template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&) { } -}; - -template<> struct SequenceMemoryInstrumentationTraits<const void*> { - template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&) { } -}; - -} - -#endif // !defined(MemoryInstrumentationSequence_h) diff --git a/third_party/WebKit/Source/wtf/MemoryInstrumentationString.h b/third_party/WebKit/Source/wtf/MemoryInstrumentationString.h deleted file mode 100644 index 1aecd03..0000000 --- a/third_party/WebKit/Source/wtf/MemoryInstrumentationString.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MemoryInstrumentationString_h -#define MemoryInstrumentationString_h - -#include "wtf/MemoryInstrumentation.h" -#include "wtf/text/AtomicString.h" -#include "wtf/text/CString.h" -#include "wtf/text/StringBuilder.h" -#include "wtf/text/WTFString.h" - -namespace WTF { - -inline void reportMemoryUsage(const StringImpl* stringImpl, MemoryObjectInfo* memoryObjectInfo) -{ - size_t selfSize = sizeof(StringImpl); - - size_t length = stringImpl->length(); - size_t bufferSize = length * (stringImpl->is8Bit() ? sizeof(LChar) : sizeof(UChar)); - const void* buffer = stringImpl->is8Bit() ? static_cast<const void*>(stringImpl->characters8()) : static_cast<const void*>(stringImpl->characters16()); - - // Count size used by internal buffer but skip strings that were constructed from literals. - if (stringImpl->hasInternalBuffer() && buffer == stringImpl + 1) - selfSize += bufferSize; - - MemoryClassInfo info(memoryObjectInfo, stringImpl, 0, selfSize); - - if (StringImpl* baseString = stringImpl->baseString()) - info.addMember(baseString, "baseString", RetainingPointer); - else { - if (stringImpl->hasOwnedBuffer()) - info.addRawBuffer(buffer, bufferSize, "char[]", "ownedBuffer"); - - if (stringImpl->has16BitShadow()) - info.addRawBuffer(stringImpl->bloatedCharacters(), length * sizeof(UChar), "UChar[]", "16bitShadow"); - } -} - -inline void reportMemoryUsage(const String* string, MemoryObjectInfo* memoryObjectInfo) -{ - MemoryClassInfo info(memoryObjectInfo, string); - info.addMember(string->impl(), "stringImpl", RetainingPointer); -} - -template <typename CharType> class StringBuffer; -template <typename CharType> -inline void reportMemoryUsage(const StringBuffer<CharType>* stringBuffer, MemoryObjectInfo* memoryObjectInfo) -{ - MemoryClassInfo info(memoryObjectInfo, stringBuffer); - info.addRawBuffer(stringBuffer->characters(), sizeof(CharType) * stringBuffer->length(), "CharType[]", "data"); -} - -inline void reportMemoryUsage(const AtomicString* atomicString, MemoryObjectInfo* memoryObjectInfo) -{ - MemoryClassInfo info(memoryObjectInfo, atomicString); - info.addMember(atomicString->string(), "string"); -} - -inline void reportMemoryUsage(const CStringBuffer* cStringBuffer, MemoryObjectInfo* memoryObjectInfo) -{ - MemoryClassInfo info(memoryObjectInfo, cStringBuffer, 0, sizeof(*cStringBuffer) + cStringBuffer->length()); -} - -inline void reportMemoryUsage(const CString* cString, MemoryObjectInfo* memoryObjectInfo) -{ - MemoryClassInfo info(memoryObjectInfo, cString); - info.addMember(cString->buffer(), "buffer", RetainingPointer); -} - -} - -#endif // !defined(MemoryInstrumentationVector_h) diff --git a/third_party/WebKit/Source/wtf/MemoryInstrumentationVector.h b/third_party/WebKit/Source/wtf/MemoryInstrumentationVector.h deleted file mode 100644 index f33ce7b..0000000 --- a/third_party/WebKit/Source/wtf/MemoryInstrumentationVector.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MemoryInstrumentationVector_h -#define MemoryInstrumentationVector_h - -#include "wtf/MemoryInstrumentationSequence.h" -#include "wtf/Vector.h" - -namespace WTF { - -template<typename T, size_t inlineCapacity> -void reportMemoryUsage(const Vector<T, inlineCapacity>* vector, MemoryObjectInfo* memoryObjectInfo) -{ - MemoryClassInfo info(memoryObjectInfo, vector); - if (inlineCapacity < vector->capacity()) - info.addRawBuffer(vector->data(), vector->capacity() * sizeof(T), "ValueType[]", "data"); - SequenceMemoryInstrumentationTraits<T>::reportMemoryUsage(vector->begin(), vector->end(), info); -} - -} - -#endif // !defined(MemoryInstrumentationVector_h) diff --git a/third_party/WebKit/Source/wtf/MemoryObjectInfo.h b/third_party/WebKit/Source/wtf/MemoryObjectInfo.h deleted file mode 100644 index 3bf1224..0000000 --- a/third_party/WebKit/Source/wtf/MemoryObjectInfo.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MemoryObjectInfo_h -#define MemoryObjectInfo_h - -#include "wtf/MemoryInstrumentation.h" - -namespace WTF { - -class MemoryClassInfo; -class MemoryInstrumentation; - -typedef const char* MemoryObjectType; - -class MemoryObjectInfo { -public: - MemoryObjectInfo(MemoryInstrumentation* memoryInstrumentation, MemoryObjectType ownerObjectType, const void* pointer) - : m_memoryInstrumentation(memoryInstrumentation) - , m_objectType(ownerObjectType) - , m_objectSize(0) - , m_pointer(pointer) - , m_firstVisit(true) - , m_customAllocation(false) - , m_isRoot(false) - , m_classNameId(0) - , m_nameId(0) - { } - - typedef MemoryClassInfo ClassInfo; - - MemoryObjectType objectType() const { return m_objectType; } - size_t objectSize() const { return m_objectSize; } - const void* reportedPointer() const { return m_pointer; } - bool firstVisit() const { return m_firstVisit; } - bool customAllocation() const { return m_customAllocation; } - void setCustomAllocation(bool customAllocation) { m_customAllocation = customAllocation; } - - void setClassName(const char* className) - { - if (!m_classNameId) - m_classNameId = m_memoryInstrumentation->m_client->registerString(className); - } - int classNameId() const { return m_classNameId; } - void setName(const char* name) - { - if (!m_nameId) - m_nameId = m_memoryInstrumentation->m_client->registerString(name); - } - int nameId() const { return m_nameId; } - bool isRoot() const { return m_isRoot; } - void markAsRoot() { m_isRoot = true; } - - MemoryInstrumentation* memoryInstrumentation() { return m_memoryInstrumentation; } - -private: - friend class MemoryClassInfo; - friend class MemoryInstrumentation; - - void reportObjectInfo(const void* pointer, MemoryObjectType objectType, size_t objectSize) - { - if (!m_objectSize) { - if (m_pointer != pointer && m_pointer && m_memoryInstrumentation->visited(pointer)) - m_firstVisit = false; - m_pointer = pointer; - m_objectSize = objectSize; - if (objectType) - m_objectType = objectType; - } - } - - MemoryInstrumentation* m_memoryInstrumentation; - MemoryObjectType m_objectType; - size_t m_objectSize; - const void* m_pointer; - bool m_firstVisit; - bool m_customAllocation; - bool m_isRoot; - int m_classNameId; - int m_nameId; -}; - -} // namespace WTF - -#endif // !defined(MemoryObjectInfo_h) diff --git a/third_party/WebKit/Source/wtf/tests/MemoryInstrumentationTest.cpp b/third_party/WebKit/Source/wtf/tests/MemoryInstrumentationTest.cpp deleted file mode 100644 index 331d96a..0000000 --- a/third_party/WebKit/Source/wtf/tests/MemoryInstrumentationTest.cpp +++ /dev/null @@ -1,922 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" - -#include "wtf/ArrayBuffer.h" -#include "wtf/HashCountedSet.h" -#include "wtf/HashMap.h" -#include "wtf/HashSet.h" -#include "wtf/ListHashSet.h" -#include "wtf/MemoryInstrumentation.h" -#include "wtf/MemoryInstrumentationArrayBufferView.h" -#include "wtf/MemoryInstrumentationHashCountedSet.h" -#include "wtf/MemoryInstrumentationHashMap.h" -#include "wtf/MemoryInstrumentationHashSet.h" -#include "wtf/MemoryInstrumentationListHashSet.h" -#include "wtf/MemoryInstrumentationString.h" -#include "wtf/MemoryInstrumentationVector.h" -#include "wtf/MemoryObjectInfo.h" -#include "wtf/RefCounted.h" -#include "wtf/Vector.h" -#include "wtf/text/AtomicString.h" -#include "wtf/text/CString.h" -#include "wtf/text/StringBuffer.h" -#include "wtf/text/StringHash.h" -#include "wtf/text/StringImpl.h" -#include "wtf/text/WTFString.h" -#include <gtest/gtest.h> - -namespace { -enum TestEnum { ONE = 1, TWO, THREE, MY_ENUM_MAX }; -} - -namespace WTF { - -template<> struct DefaultHash<TestEnum> { - typedef IntHash<unsigned> Hash; -}; - -template<> struct HashTraits<TestEnum> : GenericHashTraits<TestEnum> { - static const bool emptyValueIsZero = true; - static const bool needsDestruction = false; - static void constructDeletedValue(TestEnum& slot) { slot = static_cast<TestEnum>(MY_ENUM_MAX + 1); } - static bool isDeletedValue(TestEnum value) { return value == (MY_ENUM_MAX + 1); } -}; - -} - -namespace { - -using WTF::MemoryObjectInfo; -using WTF::MemoryClassInfo; -using WTF::MemoryObjectType; -using WTF::MemberType; - -MemoryObjectType TestType = "TestType"; - -class MemoryInstrumentationTestClient : public WTF::MemoryInstrumentationClient { -public: - MemoryInstrumentationTestClient() : m_links(WTF::LastMemberTypeEntry) - { - m_links[WTF::PointerMember] = 0; - m_links[WTF::ReferenceMember] = 0; - m_links[WTF::RetainingPointer] = 0; - } - - virtual void countObjectSize(const void*, MemoryObjectType objectType, size_t size) - { - TypeToSizeMap::AddResult result = m_totalSizes.add(objectType, size); - if (!result.isNewEntry) - result.iterator->value += size; - } - virtual bool visited(const void* object) { return !m_visitedObjects.add(object).isNewEntry; } - virtual bool checkCountedObject(const void*) { return true; } - virtual void reportNode(const MemoryObjectInfo&) OVERRIDE { } - virtual void reportEdge(const void*, const char*, MemberType memberType) OVERRIDE - { - ++m_links[memberType]; - } - virtual void reportLeaf(const MemoryObjectInfo&, const char*) OVERRIDE - { - ++m_links[WTF::RetainingPointer]; - } - virtual void reportBaseAddress(const void*, const void*) OVERRIDE { } - virtual int registerString(const char*) OVERRIDE { return -1; } - - size_t visitedObjects() const { return m_visitedObjects.size(); } - size_t totalSize(const MemoryObjectType objectType) const - { - TypeToSizeMap::const_iterator i = m_totalSizes.find(objectType); - return i == m_totalSizes.end() ? 0 : i->value; - } - - size_t linksCount(const WTF::MemberType memberType) const - { - return m_links[memberType]; - } - - size_t reportedSizeForAllTypes() const - { - size_t size = 0; - for (TypeToSizeMap::const_iterator i = m_totalSizes.begin(); i != m_totalSizes.end(); ++i) - size += i->value; - return size; - } - -private: - typedef HashMap<MemoryObjectType, size_t> TypeToSizeMap; - TypeToSizeMap m_totalSizes; - WTF::HashSet<const void*> m_visitedObjects; - WTF::Vector<size_t, WTF::LastMemberTypeEntry> m_links; -}; - -class InstrumentationTestImpl : public WTF::MemoryInstrumentation { -public: - explicit InstrumentationTestImpl(MemoryInstrumentationTestClient* client) - : MemoryInstrumentation(client) - , m_client(client) { } - - virtual void processDeferredObjects(); - virtual void deferObject(PassOwnPtr<WrapperBase>); - - size_t visitedObjects() const { return m_client->visitedObjects(); } - size_t reportedSizeForAllTypes() const { return m_client->reportedSizeForAllTypes(); } - size_t totalSize(const MemoryObjectType objectType) const { return m_client->totalSize(objectType); } - size_t linksCount(const WTF::MemberType memberType) const { return m_client->linksCount(memberType); } - -private: - MemoryInstrumentationTestClient* m_client; - Vector<OwnPtr<WrapperBase> > m_deferredObjects; -}; - -class InstrumentationTestHelper : public InstrumentationTestImpl { -public: - InstrumentationTestHelper() : InstrumentationTestImpl(&m_client) { } - -private: - MemoryInstrumentationTestClient m_client; -}; - -void InstrumentationTestImpl::processDeferredObjects() -{ - while (!m_deferredObjects.isEmpty()) { - OwnPtr<WrapperBase> pointer = m_deferredObjects.last().release(); - m_deferredObjects.removeLast(); - pointer->process(this); - } -} - -void InstrumentationTestImpl::deferObject(PassOwnPtr<WrapperBase> pointer) -{ - m_deferredObjects.append(pointer); -} - -class NotInstrumented { -public: - NotInstrumented(const char* = 0) { } - char m_data[42]; -}; - -class Instrumented { -public: - Instrumented() : m_notInstrumented(new NotInstrumented) { } - virtual ~Instrumented() { disposeOwnedObject(); } - - virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, TestType); - memoryObjectInfo->setClassName("Instrumented"); - info.addMember(m_notInstrumented, "m_notInstrumented", WTF::RetainingPointer); - } - - void disposeOwnedObject() - { - delete m_notInstrumented; - m_notInstrumented = 0; - } - - NotInstrumented* m_notInstrumented; -}; - -TEST(MemoryInstrumentationTest, sizeOf) -{ - InstrumentationTestHelper helper; - Instrumented instrumented; - helper.addRootObject(instrumented); - EXPECT_EQ(sizeof(NotInstrumented), helper.reportedSizeForAllTypes()); - EXPECT_EQ(1u, helper.visitedObjects()); - EXPECT_EQ(1u, helper.linksCount(WTF::RetainingPointer)); -} - -TEST(MemoryInstrumentationTest, nullCheck) -{ - InstrumentationTestHelper helper; - Instrumented* instrumented = 0; - helper.addRootObject(instrumented); - EXPECT_EQ(0u, helper.reportedSizeForAllTypes()); - EXPECT_EQ(0u, helper.visitedObjects()); - EXPECT_EQ(0u, helper.linksCount(WTF::RetainingPointer)); -} - -TEST(MemoryInstrumentationTest, ptrVsRef) -{ - { - InstrumentationTestHelper helper; - Instrumented instrumented; - helper.addRootObject(&instrumented); - EXPECT_EQ(sizeof(Instrumented) + sizeof(NotInstrumented), helper.reportedSizeForAllTypes()); - EXPECT_EQ(2u, helper.visitedObjects()); - EXPECT_EQ(1u, helper.linksCount(WTF::RetainingPointer)); - } - { - InstrumentationTestHelper helper; - Instrumented instrumented; - helper.addRootObject(instrumented); - EXPECT_EQ(sizeof(NotInstrumented), helper.reportedSizeForAllTypes()); - EXPECT_EQ(1u, helper.visitedObjects()); - EXPECT_EQ(1u, helper.linksCount(WTF::RetainingPointer)); - } -} - -class InstrumentedWithOwnPtr : public Instrumented { -public: - InstrumentedWithOwnPtr() : m_notInstrumentedOwnPtr(adoptPtr(new NotInstrumented)) { } - - virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, TestType); - Instrumented::reportMemoryUsage(memoryObjectInfo); - info.addMember(m_notInstrumentedOwnPtr); - } - OwnPtr<NotInstrumented> m_notInstrumentedOwnPtr; -}; - -TEST(MemoryInstrumentationTest, ownPtrNotInstrumented) -{ - InstrumentationTestHelper helper; - InstrumentedWithOwnPtr instrumentedWithOwnPtr; - helper.addRootObject(instrumentedWithOwnPtr); - EXPECT_EQ(2u * sizeof(NotInstrumented), helper.reportedSizeForAllTypes()); - EXPECT_EQ(2u, helper.visitedObjects()); - EXPECT_EQ(2u, helper.linksCount(WTF::RetainingPointer)); -} - -class InstrumentedUndefined { -public: - InstrumentedUndefined() : m_data(0) { } - - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this); - } - int m_data; -}; - -class InstrumentedDOM { -public: - InstrumentedDOM() : m_instrumentedUndefined(adoptPtr(new InstrumentedUndefined)) { } - - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, TestType); - info.addMember(m_instrumentedUndefined); - } - OwnPtr<InstrumentedUndefined> m_instrumentedUndefined; -}; - -TEST(MemoryInstrumentationTest, ownerTypePropagation) -{ - InstrumentationTestHelper helper; - OwnPtr<InstrumentedDOM> instrumentedDOM(adoptPtr(new InstrumentedDOM)); - helper.addRootObject(instrumentedDOM.get()); - EXPECT_EQ(sizeof(InstrumentedDOM) + sizeof(InstrumentedUndefined), helper.reportedSizeForAllTypes()); - EXPECT_EQ(sizeof(InstrumentedDOM) + sizeof(InstrumentedUndefined), helper.totalSize(TestType)); - EXPECT_EQ(2u, helper.visitedObjects()); -} - -class NonVirtualInstrumented { -public: - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, TestType); - info.addMember(m_instrumented); - } - - Instrumented m_instrumented; -}; - -TEST(MemoryInstrumentationTest, visitFirstMemberInNonVirtualClass) -{ - InstrumentationTestHelper helper; - NonVirtualInstrumented nonVirtualInstrumented; - helper.addRootObject(&nonVirtualInstrumented); - EXPECT_EQ(sizeof(NonVirtualInstrumented) + sizeof(NotInstrumented), helper.reportedSizeForAllTypes()); - EXPECT_EQ(2u, helper.visitedObjects()); -} - -template<typename T> -class InstrumentedOwner { -public: - template<typename V> - InstrumentedOwner(const V& value) : m_value(value) { } - InstrumentedOwner() { } - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, TestType); - info.addMember(m_value, "value", WTF::RetainingPointer); - } - - T m_value; -}; - -TEST(MemoryInstrumentationTest, visitStrings) -{ - { // 8-bit string. - InstrumentationTestHelper helper; - InstrumentedOwner<String> stringInstrumentedOwner("String"); - helper.addRootObject(stringInstrumentedOwner); - EXPECT_EQ(sizeof(StringImpl) + stringInstrumentedOwner.m_value.length(), helper.reportedSizeForAllTypes()); - EXPECT_EQ(1u, helper.visitedObjects()); - } - - { // 8-bit string with 16bit shadow. - InstrumentationTestHelper helper; - InstrumentedOwner<String> stringInstrumentedOwner("String"); - stringInstrumentedOwner.m_value.bloatedCharacters(); - helper.addRootObject(stringInstrumentedOwner); - EXPECT_EQ(sizeof(StringImpl) + stringInstrumentedOwner.m_value.length() * (sizeof(LChar) + sizeof(UChar)), helper.reportedSizeForAllTypes()); - EXPECT_EQ(2u, helper.visitedObjects()); - } - - { // 16 bit string. - InstrumentationTestHelper helper; - String string("String"); - InstrumentedOwner<String> stringInstrumentedOwner(String(string.bloatedCharacters(), string.length())); - helper.addRootObject(stringInstrumentedOwner); - EXPECT_EQ(sizeof(StringImpl) + stringInstrumentedOwner.m_value.length() * sizeof(UChar), helper.reportedSizeForAllTypes()); - EXPECT_EQ(1u, helper.visitedObjects()); - } - - { // ASCIILiteral - InstrumentationTestHelper helper; - ASCIILiteral literal("String"); - InstrumentedOwner<String> stringInstrumentedOwner(literal); - helper.addRootObject(stringInstrumentedOwner); - EXPECT_EQ(sizeof(StringImpl), helper.reportedSizeForAllTypes()); - EXPECT_EQ(1u, helper.visitedObjects()); - } - - { // Substring - InstrumentationTestHelper helper; - String baseString("String"); - baseString.bloatedCharacters(); // Force 16 shadow creation. - InstrumentedOwner<String> stringInstrumentedOwner(baseString.substringSharingImpl(1, 4)); - helper.addRootObject(stringInstrumentedOwner); - EXPECT_EQ(sizeof(StringImpl) * 2 + baseString.length() * (sizeof(LChar) + sizeof(UChar)), helper.reportedSizeForAllTypes()); - EXPECT_EQ(3u, helper.visitedObjects()); - } - - { // Owned buffer. - InstrumentationTestHelper helper; - StringBuffer<LChar> buffer(6); - InstrumentedOwner<String> stringInstrumentedOwner(String::adopt(buffer)); - helper.addRootObject(stringInstrumentedOwner); - EXPECT_EQ(sizeof(StringImpl) + stringInstrumentedOwner.m_value.length(), helper.reportedSizeForAllTypes()); - EXPECT_EQ(2u, helper.visitedObjects()); - } - - { - InstrumentationTestHelper helper; - InstrumentedOwner<AtomicString> atomicStringInstrumentedOwner("AtomicString"); - atomicStringInstrumentedOwner.m_value.string().bloatedCharacters(); // Force 16bit shadow creation. - helper.addRootObject(atomicStringInstrumentedOwner); - EXPECT_EQ(sizeof(StringImpl) + atomicStringInstrumentedOwner.m_value.length() * (sizeof(LChar) + sizeof(UChar)), helper.reportedSizeForAllTypes()); - EXPECT_EQ(2u, helper.visitedObjects()); - } - - { - InstrumentationTestHelper helper; - InstrumentedOwner<CString> cStringInstrumentedOwner("CString"); - helper.addRootObject(cStringInstrumentedOwner); - EXPECT_EQ(sizeof(WTF::CStringBuffer) + cStringInstrumentedOwner.m_value.length(), helper.reportedSizeForAllTypes()); - EXPECT_EQ(1u, helper.visitedObjects()); - } -} - -class TwoPointersToRefPtr { -public: - TwoPointersToRefPtr(const RefPtr<StringImpl>& value) : m_ptr1(&value), m_ptr2(&value) { } - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, TestType); - info.addMember(m_ptr1); - info.addMember(m_ptr2); - } - - const RefPtr<StringImpl>* m_ptr1; - const RefPtr<StringImpl>* m_ptr2; -}; - -TEST(MemoryInstrumentationTest, refPtrPtr) -{ - InstrumentationTestHelper helper; - RefPtr<StringImpl> refPtr; - TwoPointersToRefPtr root(refPtr); - helper.addRootObject(root); - EXPECT_EQ(sizeof(RefPtr<StringImpl>), helper.reportedSizeForAllTypes()); - EXPECT_EQ(1u, helper.visitedObjects()); -} - -class TwoPointersToOwnPtr { -public: - TwoPointersToOwnPtr(const OwnPtr<NotInstrumented>& value) : m_ptr1(&value), m_ptr2(&value) { } - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, TestType); - info.addMember(m_ptr1); - info.addMember(m_ptr2); - } - - const OwnPtr<NotInstrumented>* m_ptr1; - const OwnPtr<NotInstrumented>* m_ptr2; -}; - -TEST(MemoryInstrumentationTest, ownPtrPtr) -{ - InstrumentationTestHelper helper; - OwnPtr<NotInstrumented> ownPtr; - TwoPointersToOwnPtr root(ownPtr); - helper.addRootObject(root); - EXPECT_EQ(sizeof(OwnPtr<NotInstrumented>), helper.reportedSizeForAllTypes()); - EXPECT_EQ(1u, helper.visitedObjects()); -} - -template<typename T> -class InstrumentedTemplate { -public: - template<typename V> - InstrumentedTemplate(const V& value) : m_value(value) { } - - template<typename MemoryObjectInfo> - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - typename MemoryObjectInfo::ClassInfo info(memoryObjectInfo, this, TestType); - info.addMember(m_value); - } - - T m_value; -}; - -TEST(MemoryInstrumentationTest, detectReportMemoryUsageMethod) -{ - { - InstrumentationTestHelper helper; - - OwnPtr<InstrumentedTemplate<String> > value(adoptPtr(new InstrumentedTemplate<String>(""))); - InstrumentedOwner<InstrumentedTemplate<String>* > root(value.get()); - helper.addRootObject(root); - EXPECT_EQ(sizeof(InstrumentedTemplate<String>) + sizeof(StringImpl), helper.reportedSizeForAllTypes()); - // FIXME: it is failing on Chromium Canary bots but works fine locally. - // EXPECT_EQ(2, helper.visitedObjects()); - } - { - InstrumentationTestHelper helper; - - OwnPtr<InstrumentedTemplate<NotInstrumented> > value(adoptPtr(new InstrumentedTemplate<NotInstrumented>(""))); - InstrumentedOwner<InstrumentedTemplate<NotInstrumented>* > root(value.get()); - helper.addRootObject(root); - EXPECT_EQ(sizeof(InstrumentedTemplate<NotInstrumented>), helper.reportedSizeForAllTypes()); - EXPECT_EQ(1u, helper.visitedObjects()); - } -} - -TEST(MemoryInstrumentationTest, vectorZeroInlineCapacity) -{ - InstrumentationTestHelper helper; - InstrumentedOwner<Vector<int> > vectorOwner(16); - helper.addRootObject(vectorOwner); - EXPECT_EQ(16 * sizeof(int), helper.reportedSizeForAllTypes()); - EXPECT_EQ(1u, helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, vectorFieldWithInlineCapacity) -{ - InstrumentationTestHelper helper; - InstrumentedOwner<Vector<int, 4> > vectorOwner; - helper.addRootObject(vectorOwner); - EXPECT_EQ(static_cast<size_t>(0), helper.reportedSizeForAllTypes()); - EXPECT_EQ(0u, helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, vectorFieldWithInlineCapacityResized) -{ - InstrumentationTestHelper helper; - InstrumentedOwner<Vector<int, 4> > vectorOwner; - vectorOwner.m_value.reserveCapacity(8); - helper.addRootObject(vectorOwner); - EXPECT_EQ(8u * sizeof(int), helper.reportedSizeForAllTypes()); - EXPECT_EQ(1u, helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, heapAllocatedVectorWithInlineCapacity) -{ - InstrumentationTestHelper helper; - InstrumentedOwner<OwnPtr<Vector<int, 4> > > vectorOwner; - vectorOwner.m_value = adoptPtr(new Vector<int, 4>()); - helper.addRootObject(vectorOwner); - EXPECT_EQ(sizeof(Vector<int, 4>), helper.reportedSizeForAllTypes()); - EXPECT_EQ(1u, helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, heapAllocatedVectorWithInlineCapacityResized) -{ - InstrumentationTestHelper helper; - InstrumentedOwner<OwnPtr<Vector<int, 4> > > vectorOwner; - vectorOwner.m_value = adoptPtr(new Vector<int, 4>()); - vectorOwner.m_value->reserveCapacity(8); - helper.addRootObject(vectorOwner); - EXPECT_EQ(8u * sizeof(int) + sizeof(Vector<int, 4>), helper.reportedSizeForAllTypes()); - EXPECT_EQ(2u, helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, vectorWithInstrumentedType) -{ - InstrumentationTestHelper helper; - - typedef Vector<String> StringVector; - OwnPtr<StringVector> value = adoptPtr(new StringVector()); - size_t count = 10; - for (size_t i = 0; i < count; ++i) - value->append("string"); - InstrumentedOwner<StringVector* > root(value.get()); - helper.addRootObject(root); - EXPECT_EQ(sizeof(StringVector) + sizeof(String) * value->capacity() + (sizeof(StringImpl) + 6) * value->size(), helper.reportedSizeForAllTypes()); - EXPECT_EQ(count + 2, (size_t)helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, hashSetWithInstrumentedType) -{ - InstrumentationTestHelper helper; - - typedef HashSet<String> ValueType; - OwnPtr<ValueType> value = adoptPtr(new ValueType()); - size_t count = 10; - for (size_t i = 0; i < count; ++i) - value->add(String::number(i)); - InstrumentedOwner<ValueType* > root(value.get()); - helper.addRootObject(root); - EXPECT_EQ(sizeof(ValueType) + sizeof(String) * value->capacity() + (sizeof(StringImpl) + 1) * value->size(), helper.reportedSizeForAllTypes()); - EXPECT_EQ(count + 1, (size_t)helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, hashMapWithNotInstrumentedKeysAndValues) -{ - InstrumentationTestHelper helper; - - typedef HashMap<int, int> IntToIntMap; - OwnPtr<IntToIntMap> value = adoptPtr(new IntToIntMap()); - size_t count = 10; - for (size_t i = 1; i <= count; ++i) - value->set(i, i); - InstrumentedOwner<IntToIntMap* > root(value.get()); - helper.addRootObject(root); - EXPECT_EQ(sizeof(IntToIntMap) + sizeof(IntToIntMap::ValueType) * value->capacity(), helper.reportedSizeForAllTypes()); - EXPECT_EQ(1u, helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, hashMapWithInstrumentedKeys) -{ - InstrumentationTestHelper helper; - - typedef HashMap<String, int> StringToIntMap; - OwnPtr<StringToIntMap> value = adoptPtr(new StringToIntMap()); - size_t count = 10; - for (size_t i = 10; i < 10 + count; ++i) - value->set(String::number(i), i); - InstrumentedOwner<StringToIntMap* > root(value.get()); - helper.addRootObject(root); - EXPECT_EQ(sizeof(StringToIntMap) + sizeof(StringToIntMap::ValueType) * value->capacity() + (sizeof(StringImpl) + 2) * value->size(), helper.reportedSizeForAllTypes()); - EXPECT_EQ(count + 1, helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, hashMapWithInstrumentedValues) -{ - InstrumentationTestHelper helper; - - typedef HashMap<int, String> IntToStringMap; - OwnPtr<IntToStringMap> value = adoptPtr(new IntToStringMap()); - size_t count = 10; - for (size_t i = 10; i < 10 + count; ++i) - value->set(i, String::number(i)); - InstrumentedOwner<IntToStringMap* > root(value.get()); - helper.addRootObject(root); - EXPECT_EQ(sizeof(IntToStringMap) + sizeof(IntToStringMap::ValueType) * value->capacity() + (sizeof(StringImpl) + 2) * value->size(), helper.reportedSizeForAllTypes()); - EXPECT_EQ(count + 1, helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, hashMapWithInstrumentedKeysAndValues) -{ - InstrumentationTestHelper helper; - - typedef HashMap<String, String> StringToStringMap; - OwnPtr<StringToStringMap> value = adoptPtr(new StringToStringMap()); - size_t count = 10; - for (size_t i = 10; i < 10 + count; ++i) - value->set(String::number(count + i), String::number(i)); - InstrumentedOwner<StringToStringMap* > root(value.get()); - helper.addRootObject(root); - EXPECT_EQ(sizeof(StringToStringMap) + sizeof(StringToStringMap::ValueType) * value->capacity() + 2 * (sizeof(StringImpl) + 2) * value->size(), helper.reportedSizeForAllTypes()); - EXPECT_EQ(2u * count + 1, helper.visitedObjects()); -} - -class InstrumentedRefCounted : public RefCounted<InstrumentedRefCounted> { -public: - InstrumentedRefCounted() : m_notInstrumented(new NotInstrumented) { } - ~InstrumentedRefCounted() { delete m_notInstrumented; } - - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, TestType); - info.addMember(m_notInstrumented, "m_notInstrumented", WTF::RetainingPointer); - } -private: - NotInstrumented* m_notInstrumented; -}; - -TEST(MemoryInstrumentationTest, hashMapWithInstrumentedPointerKeysAndPointerValues) -{ - InstrumentationTestHelper helper; - - typedef HashMap<RefPtr<InstrumentedRefCounted>, RefPtr<InstrumentedRefCounted> > InstrumentedToInstrumentedMap; - OwnPtr<InstrumentedToInstrumentedMap> value(adoptPtr(new InstrumentedToInstrumentedMap())); - size_t count = 10; - for (size_t i = 0; i < count; ++i) - value->set(adoptRef(new InstrumentedRefCounted()), adoptRef(new InstrumentedRefCounted())); - InstrumentedOwner<InstrumentedToInstrumentedMap* > root(value.get()); - helper.addRootObject(root); - EXPECT_EQ(sizeof(InstrumentedToInstrumentedMap) - + sizeof(InstrumentedToInstrumentedMap::ValueType) * value->capacity() - + 2 * (sizeof(InstrumentedRefCounted) + sizeof(NotInstrumented)) * value->size(), - helper.reportedSizeForAllTypes()); - EXPECT_EQ(2u * 2u * count + 1, helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, listHashSetWithInstrumentedType) -{ - InstrumentationTestHelper helper; - - typedef ListHashSet<String, 8> TestSet; - OwnPtr<TestSet> value = adoptPtr(new TestSet()); - size_t count = 10; - for (size_t i = 0; i < count; ++i) - value->add(String::number(i)); - InstrumentedOwner<TestSet* > root(value.get()); - helper.addRootObject(root); - EXPECT_EQ(sizeof(TestSet) + sizeof(String) * value->capacity() + (sizeof(StringImpl) + 1 * sizeof(LChar)) * count + - sizeof(WTF::ListHashSetNodeAllocator<String, 8>) + sizeof(WTF::ListHashSetNode<String, 8>) * (count - 8), - helper.reportedSizeForAllTypes()); - EXPECT_EQ(1 + count, helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, listHashSetWithInstrumentedTypeAfterValuesRemoval) -{ - InstrumentationTestHelper helper; - - typedef ListHashSet<String, 8> TestSet; - OwnPtr<TestSet> value = adoptPtr(new TestSet()); - size_t count = 20; - for (size_t i = 0; i < count; ++i) - value->add(String::number(i)); - // Remove 10 values, 8 of which were allocated in the internal buffer. - for (size_t i = 0; i < 10; ++i) - value->remove(String::number(i)); - InstrumentedOwner<TestSet* > root(value.get()); - helper.addRootObject(root); - EXPECT_EQ(sizeof(TestSet) + sizeof(String) * value->capacity() + (sizeof(StringImpl) + 2 * sizeof(LChar)) * (count - 10) + - sizeof(WTF::ListHashSetNodeAllocator<String, 8>) + sizeof(WTF::ListHashSetNode<String, 8>) * (count - 10), - helper.reportedSizeForAllTypes()); - EXPECT_EQ(1 + (count - 10), helper.visitedObjects()); -} - -class InstrumentedConvertibleToInt : public RefCounted<InstrumentedConvertibleToInt> { -public: - InstrumentedConvertibleToInt() : m_notInstrumented(new NotInstrumented) { } - virtual ~InstrumentedConvertibleToInt() { delete m_notInstrumented; } - - virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, TestType); - info.addMember(m_notInstrumented); - } - - operator int() const { return 2012; } - - NotInstrumented* m_notInstrumented; -}; - -// This test checks if reportMemoryUsage method will be called on a class -// that can be implicitly cast to int. Currently objects of such classes are -// treated as integers when they are stored in a HashMap by value and -// reportMemoryUsage will not be called on them. We may fix that later. -TEST(MemoryInstrumentationTest, hashMapWithValuesConvertibleToInt) -{ - InstrumentationTestHelper helper; - - typedef HashMap<RefPtr<InstrumentedConvertibleToInt>, int> TestMap; - OwnPtr<TestMap> value(adoptPtr(new TestMap())); - size_t count = 10; - for (size_t i = 0; i < count; ++i) - value->set(adoptRef(new InstrumentedConvertibleToInt()), 0); - InstrumentedOwner<TestMap* > root(value.get()); - helper.addRootObject(root); - EXPECT_EQ(sizeof(TestMap) + sizeof(TestMap::ValueType) * value->capacity() + - sizeof(InstrumentedConvertibleToInt) * count /* + sizeof(NotInstrumented) * count */, helper.reportedSizeForAllTypes()); - EXPECT_EQ(count + 1, helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, hashMapWithEnumKeysAndInstrumentedValues) -{ - InstrumentationTestHelper helper; - - typedef HashMap<TestEnum, String> EnumToStringMap; - OwnPtr<EnumToStringMap> value(adoptPtr(new EnumToStringMap())); - size_t count = MY_ENUM_MAX; - for (size_t i = ONE; i <= count; ++i) - value->set(static_cast<TestEnum>(i), String::number(i)); - InstrumentedOwner<EnumToStringMap* > root(value.get()); - helper.addRootObject(root); - EXPECT_EQ(sizeof(EnumToStringMap) - + sizeof(EnumToStringMap::ValueType) * value->capacity() - + (sizeof(StringImpl) + 1) * value->size(), - helper.reportedSizeForAllTypes()); - EXPECT_EQ(count + 1, helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, hashCountedSetWithInstrumentedValues) -{ - InstrumentationTestHelper helper; - - typedef HashCountedSet<RefPtr<InstrumentedRefCounted> > TestSet; - OwnPtr<TestSet> set(adoptPtr(new TestSet())); - size_t count = 10; - for (size_t i = 0; i < count; ++i) { - RefPtr<InstrumentedRefCounted> instrumentedRefCounted = adoptRef(new InstrumentedRefCounted()); - for (size_t j = 0; j <= i; j++) - set->add(instrumentedRefCounted); - } - InstrumentedOwner<TestSet* > root(set.get()); - helper.addRootObject(root); - EXPECT_EQ(sizeof(TestSet) - + sizeof(HashMap<RefPtr<InstrumentedRefCounted>, unsigned>::ValueType) * set->capacity() - + (sizeof(InstrumentedRefCounted) + sizeof(NotInstrumented)) * set->size(), - helper.reportedSizeForAllTypes()); - EXPECT_EQ(2u * count + 1, helper.visitedObjects()); -} - -TEST(MemoryInstrumentationTest, arrayBuffer) -{ - InstrumentationTestHelper helper; - - typedef InstrumentedTemplate<RefPtr<ArrayBuffer> > ValueType; - ValueType value(ArrayBuffer::create(1000, sizeof(int))); - helper.addRootObject(value); - EXPECT_EQ(sizeof(int) * 1000 + sizeof(ArrayBuffer), helper.reportedSizeForAllTypes()); - EXPECT_EQ(2u, helper.visitedObjects()); - EXPECT_EQ(2u, helper.linksCount(WTF::RetainingPointer)); -} - -class AncestorWithVirtualMethod { -public: - virtual char* data() { return m_data; } - -private: - char m_data[10]; -}; - -class ClassWithTwoAncestors : public AncestorWithVirtualMethod, public Instrumented { -public: - virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, TestType); - Instrumented::reportMemoryUsage(memoryObjectInfo); - } -}; - -TEST(MemoryInstrumentationTest, instrumentedWithMultipleAncestors) -{ - InstrumentationTestHelper helper; - OwnPtr<ClassWithTwoAncestors> instance = adoptPtr(new ClassWithTwoAncestors()); - ClassWithTwoAncestors* descendantPointer = instance.get(); - InstrumentedOwner<ClassWithTwoAncestors*> descendantPointerOwner(descendantPointer); - Instrumented* ancestorPointer = descendantPointer; - InstrumentedOwner<Instrumented*> ancestorPointerOwner(ancestorPointer); - EXPECT_NE(static_cast<void*>(ancestorPointer), static_cast<void*>(descendantPointer)); - - helper.addRootObject(descendantPointerOwner); - helper.addRootObject(ancestorPointerOwner); - EXPECT_EQ(sizeof(ClassWithTwoAncestors) + sizeof(NotInstrumented), helper.reportedSizeForAllTypes()); - EXPECT_EQ(3u, helper.visitedObjects()); -} - -class CheckCountedObjectsClient : public MemoryInstrumentationTestClient { -public: - CheckCountedObjectsClient(const void* expectedPointer) : m_expectedPointer(expectedPointer), m_expectedPointerFound(false) { } - virtual bool checkCountedObject(const void* pointer) - { - EXPECT_EQ(pointer, m_expectedPointer); - m_expectedPointerFound = true; - return true; - } - bool expectedPointerFound() { return m_expectedPointerFound; } - -private: - const void* m_expectedPointer; - bool m_expectedPointerFound; -}; - -TEST(MemoryInstrumentationTest, checkCountedObjectWithMultipleAncestors) -{ - OwnPtr<ClassWithTwoAncestors> instance = adoptPtr(new ClassWithTwoAncestors()); - instance->disposeOwnedObject(); - ClassWithTwoAncestors* descendantPointer = instance.get(); - InstrumentedOwner<ClassWithTwoAncestors*> descendantPointerOwner(descendantPointer); - Instrumented* ancestorPointer = descendantPointer; - InstrumentedOwner<Instrumented*> ancestorPointerOwner(ancestorPointer); - EXPECT_NE(static_cast<void*>(ancestorPointer), static_cast<void*>(descendantPointer)); - - CheckCountedObjectsClient client(instance.get()); - InstrumentationTestImpl instrumentation(&client); - instrumentation.addRootObject(descendantPointerOwner); - instrumentation.addRootObject(ancestorPointerOwner); - EXPECT_TRUE(client.expectedPointerFound()); -} - -class TwoPointersToSameInsrumented { -public: - TwoPointersToSameInsrumented() - : m_ownPtr(adoptPtr(new ClassWithTwoAncestors())) - , m_baseClassPtr(m_ownPtr.get()) - { - EXPECT_NE(static_cast<void*>(m_ownPtr.get()), static_cast<void*>(m_baseClassPtr)); - } - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, TestType); - info.addMember(m_ownPtr); - info.addMember(m_baseClassPtr); - } - -private: - OwnPtr<ClassWithTwoAncestors> m_ownPtr; - Instrumented* m_baseClassPtr; -}; - -class CountLinksFromInstrumentedObject : public MemoryInstrumentationTestClient { -public: - CountLinksFromInstrumentedObject() : m_linkCount(0) { } - virtual void reportEdge(const void*, const char* name, MemberType) OVERRIDE - { - if (name && !strcmp("m_notInstrumented", name)) - m_linkCount++; - } - int linkCount() const { return m_linkCount; } - -private: - int m_linkCount; -}; - - -TEST(MemoryInstrumentationTest, doNotReportEdgeTwice) -{ - OwnPtr<TwoPointersToSameInsrumented> instance = adoptPtr(new TwoPointersToSameInsrumented()); - - CountLinksFromInstrumentedObject client; - InstrumentationTestImpl instrumentation(&client); - instrumentation.addRootObject(instance.get()); - EXPECT_EQ(1, client.linkCount()); -} - -class DerivedClass : public Instrumented { -public: - size_t m_member; -}; - -TEST(MemoryInstrumentationTest, detectBaseClassInstrumentation) -{ - OwnPtr<DerivedClass> instance = adoptPtr(new DerivedClass()); - - InstrumentationTestHelper helper; - helper.addRootObject(instance.get(), TestType); - EXPECT_EQ(sizeof(Instrumented) + sizeof(NotInstrumented), helper.reportedSizeForAllTypes()); - EXPECT_EQ(2u, helper.visitedObjects()); -} - -} // namespace diff --git a/third_party/WebKit/Source/wtf/text/AtomicString.h b/third_party/WebKit/Source/wtf/text/AtomicString.h index 3a471d9..bfb5df5 100644 --- a/third_party/WebKit/Source/wtf/text/AtomicString.h +++ b/third_party/WebKit/Source/wtf/text/AtomicString.h @@ -36,7 +36,6 @@ namespace WTF { struct AtomicStringHash; -class MemoryObjectInfo; class WTF_EXPORT AtomicString { public: diff --git a/third_party/WebKit/Source/wtf/text/StringImpl.h b/third_party/WebKit/Source/wtf/text/StringImpl.h index b1bed18..5d90c51 100644 --- a/third_party/WebKit/Source/wtf/text/StringImpl.h +++ b/third_party/WebKit/Source/wtf/text/StringImpl.h @@ -47,7 +47,6 @@ template<typename CharacterType> struct HashAndCharactersTranslator; struct HashAndUTF8CharactersTranslator; struct LCharBufferTranslator; struct CharBufferFromLiteralDataTranslator; -class MemoryObjectInfo; struct SubstringTranslator; struct UCharBufferTranslator; template<typename> class RetainPtr; diff --git a/third_party/WebKit/Source/wtf/text/WTFString.h b/third_party/WebKit/Source/wtf/text/WTFString.h index 16975ba..29df8c1 100644 --- a/third_party/WebKit/Source/wtf/text/WTFString.h +++ b/third_party/WebKit/Source/wtf/text/WTFString.h @@ -36,7 +36,6 @@ namespace WTF { class CString; -class MemoryObjectInfo; struct StringHash; // Declarations of string operations diff --git a/third_party/WebKit/Source/wtf/wtf.gypi b/third_party/WebKit/Source/wtf/wtf.gypi index 492c781..87342f9 100644 --- a/third_party/WebKit/Source/wtf/wtf.gypi +++ b/third_party/WebKit/Source/wtf/wtf.gypi @@ -72,17 +72,6 @@ 'MainThread.h', 'MallocZoneSupport.h', 'MathExtras.h', - 'MemoryInstrumentation.cpp', - 'MemoryInstrumentation.h', - 'MemoryInstrumentationArrayBufferView.h', - 'MemoryInstrumentationHashCountedSet.h', - 'MemoryInstrumentationHashMap.h', - 'MemoryInstrumentationHashSet.h', - 'MemoryInstrumentationListHashSet.h', - 'MemoryInstrumentationSequence.h', - 'MemoryInstrumentationString.h', - 'MemoryInstrumentationVector.h', - 'MemoryObjectInfo.h', 'MessageQueue.h', 'NonCopyingSort.h', 'Noncopyable.h', @@ -233,7 +222,6 @@ 'tests/HashSet.cpp', 'tests/ListHashSet.cpp', 'tests/MathExtras.cpp', - 'tests/MemoryInstrumentationTest.cpp', 'tests/RunAllTests.cpp', 'tests/SaturatedArithmeticOperations.cpp', 'tests/StringBuilder.cpp', |