Web Inspector: NMI: remove the dependency of platform sources from WebCore header...
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Sep 2012 13:22:40 +0000 (13:22 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Sep 2012 13:22:40 +0000 (13:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=96367

Reviewed by Yury Semikhatsky.

the target is to move 'platform' specific instrumentation code
from WebCoreMemoryInstrumentation into the new PlatformMemoryInstrumentation.

Drive by fix: New type DOM.Image was introduced.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* dom/WebCoreMemoryInstrumentation.cpp:
(WebCore):
* dom/WebCoreMemoryInstrumentation.h:
(WebCoreMemoryTypes):
* inspector/InspectorMemoryAgent.cpp:
(WebCore):
* platform/KURL.cpp:
* platform/KURLGoogle.cpp:
* platform/PlatformMemoryInstrumentation.cpp: Copied from Source/WebCore/platform/graphics/GeneratedImage.cpp.
(WebCore):
* platform/PlatformMemoryInstrumentation.h: Copied from Source/WebCore/platform/graphics/GeneratedImage.cpp.
(WebCore):
(PlatformMemoryTypes):
* platform/SharedBuffer.cpp:
* platform/TreeShared.h:
(WebCore::TreeShared::reportMemoryUsage):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::reportMemoryUsage):
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::CrossfadeGeneratedImage::reportMemoryUsage):
* platform/graphics/GeneratedImage.cpp:
(WebCore::GeneratedImage::reportMemoryUsage):
* platform/graphics/GeneratorGeneratedImage.cpp:
(WebCore::GeneratorGeneratedImage::reportMemoryUsage):
* platform/graphics/GeneratorGeneratedImage.h:
* platform/graphics/Image.cpp:
(WebCore::Image::reportMemoryUsage):
* platform/network/FormData.cpp:
(WebCore::FormData::reportMemoryUsage):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::reportMemoryUsage):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::reportMemoryUsage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@128451 268f45cc-cd09-0410-ab3c-d52691b4dbfc

25 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/WebCoreMemoryInstrumentation.cpp
Source/WebCore/dom/WebCoreMemoryInstrumentation.h
Source/WebCore/inspector/InspectorMemoryAgent.cpp
Source/WebCore/platform/KURL.cpp
Source/WebCore/platform/KURLGoogle.cpp
Source/WebCore/platform/PlatformMemoryInstrumentation.cpp [new file with mode: 0644]
Source/WebCore/platform/PlatformMemoryInstrumentation.h [new file with mode: 0644]
Source/WebCore/platform/SharedBuffer.cpp
Source/WebCore/platform/TreeShared.h
Source/WebCore/platform/graphics/BitmapImage.cpp
Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp
Source/WebCore/platform/graphics/GeneratedImage.cpp
Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp
Source/WebCore/platform/graphics/GeneratorGeneratedImage.h
Source/WebCore/platform/graphics/Image.cpp
Source/WebCore/platform/network/FormData.cpp
Source/WebCore/platform/network/ResourceRequestBase.cpp
Source/WebCore/platform/network/ResourceResponseBase.cpp

index d0cea54..bb122d6 100644 (file)
@@ -1768,6 +1768,7 @@ SET(WebCore_SOURCES
     platform/MemoryPressureHandler.cpp
     platform/PlatformEvent.cpp
     platform/PlatformInstrumentation.cpp
+    platform/PlatformMemoryInstrumentation.cpp
     platform/RunLoop.cpp
     platform/RuntimeApplicationChecks.cpp
     platform/ScrollAnimator.cpp
index e6ee52e..5f8902d 100644 (file)
@@ -1,5 +1,57 @@
 2012-09-13  Ilya Tikhonovsky  <loislo@chromium.org>
 
+        Web Inspector: NMI: remove the dependency of platform sources from WebCore header introduced by NMI instrumentation.
+        https://bugs.webkit.org/show_bug.cgi?id=96367
+
+        Reviewed by Yury Semikhatsky.
+
+        the target is to move 'platform' specific instrumentation code
+        from WebCoreMemoryInstrumentation into the new PlatformMemoryInstrumentation.
+
+        Drive by fix: New type DOM.Image was introduced.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/WebCoreMemoryInstrumentation.cpp:
+        (WebCore):
+        * dom/WebCoreMemoryInstrumentation.h:
+        (WebCoreMemoryTypes):
+        * inspector/InspectorMemoryAgent.cpp:
+        (WebCore):
+        * platform/KURL.cpp:
+        * platform/KURLGoogle.cpp:
+        * platform/PlatformMemoryInstrumentation.cpp: Copied from Source/WebCore/platform/graphics/GeneratedImage.cpp.
+        (WebCore):
+        * platform/PlatformMemoryInstrumentation.h: Copied from Source/WebCore/platform/graphics/GeneratedImage.cpp.
+        (WebCore):
+        (PlatformMemoryTypes):
+        * platform/SharedBuffer.cpp:
+        * platform/TreeShared.h:
+        (WebCore::TreeShared::reportMemoryUsage):
+        * platform/graphics/BitmapImage.cpp:
+        (WebCore::BitmapImage::reportMemoryUsage):
+        * platform/graphics/CrossfadeGeneratedImage.cpp:
+        (WebCore::CrossfadeGeneratedImage::reportMemoryUsage):
+        * platform/graphics/GeneratedImage.cpp:
+        (WebCore::GeneratedImage::reportMemoryUsage):
+        * platform/graphics/GeneratorGeneratedImage.cpp:
+        (WebCore::GeneratorGeneratedImage::reportMemoryUsage):
+        * platform/graphics/GeneratorGeneratedImage.h:
+        * platform/graphics/Image.cpp:
+        (WebCore::Image::reportMemoryUsage):
+        * platform/network/FormData.cpp:
+        (WebCore::FormData::reportMemoryUsage):
+        * platform/network/ResourceRequestBase.cpp:
+        (WebCore::ResourceRequestBase::reportMemoryUsage):
+        * platform/network/ResourceResponseBase.cpp:
+        (WebCore::ResourceResponseBase::reportMemoryUsage):
+
+2012-09-13  Ilya Tikhonovsky  <loislo@chromium.org>
+
         Web Inspector: NMI: instrument KURL directly.
         https://bugs.webkit.org/show_bug.cgi?id=96624
 
index 7e8a372..39502bf 100644 (file)
@@ -4689,6 +4689,8 @@ webcore_sources += \
        Source/WebCore/platform/PlatformGestureCurve.h \
        Source/WebCore/platform/PlatformGestureEvent.h \
        Source/WebCore/platform/PlatformKeyboardEvent.h \
+       Source/WebCore/platform/PlatformMemoryInstrumentation.cpp \
+       Source/WebCore/platform/PlatformMemoryInstrumentation.h \
        Source/WebCore/platform/PlatformMenuDescription.h \
        Source/WebCore/platform/PlatformMouseEvent.h \
        Source/WebCore/platform/PlatformPasteboard.h \
index e5415c4..e92d92f 100644 (file)
@@ -1046,6 +1046,7 @@ SOURCES += \
     platform/text/RegularExpression.cpp \
     platform/PlatformEvent.cpp \
     platform/PlatformInstrumentation.cpp \
+    platform/PlatformMemoryInstrumentation.cpp \
     platform/RuntimeApplicationChecks.cpp \
     platform/RunLoop.cpp \
     platform/SchemeRegistry.cpp \
@@ -2216,6 +2217,7 @@ HEADERS += \
     platform/network/qt/DnsPrefetchHelper.h \
     platform/network/qt/NetworkStateNotifierPrivate.h \
     platform/PlatformExportMacros.h \
+    platform/PlatformMemoryInstrumentation.h \
     platform/PlatformTouchEvent.h \
     platform/PlatformTouchPoint.h \
     platform/PopupMenu.h \
index 58bc3a5..7f09777 100644 (file)
             'platform/MIMETypeRegistry.cpp',
             'platform/Pasteboard.h',
             'platform/PlatformGestureCurve.h',
+            'platform/PlatformMemoryInstrumentation.cpp',
+            'platform/PlatformMemoryInstrumentation.h',
             'platform/PlatformStrategies.cpp',
             'platform/PlatformTouchEvent.h',
             'platform/PlatformTouchPoint.h',
index 385d6a0..f3361cb 100755 (executable)
                                >
                        </File>
                        <File
+                               RelativePath="..\platform\PlatformMemoryInstrumentation.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\platform\PlatformMemoryInstrumentation.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\platform\PlatformMenuDescription.h"
                                >
                        </File>
index 675294f..1b02472 100644 (file)
                4E19592E0A39DACC00220FE5 /* MediaQueryExp.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959280A39DACC00220FE5 /* MediaQueryExp.h */; };
                4F1534DE11B532EC0021FD86 /* EditingBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F1534DD11B532EC0021FD86 /* EditingBehavior.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4F1534E011B533020021FD86 /* EditingBehaviorTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               4F1D11BF15FF37200026E908 /* PlatformMemoryInstrumentation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F1D118915FF361B0026E908 /* PlatformMemoryInstrumentation.cpp */; };
                4F2D205412EAE7B3005C2874 /* InspectorAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F2D205212EAE7B3005C2874 /* InspectorAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4F2D205512EAE7B3005C2874 /* InspectorAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F2D205312EAE7B3005C2874 /* InspectorAgent.cpp */; };
                4F3289B511A42AAB005ABE7E /* InspectorValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F3289B311A42AAB005ABE7E /* InspectorValues.cpp */; };
                4F6FDD651341DEDD001F8EE3 /* InspectorPageAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F6FDD631341DEDD001F8EE3 /* InspectorPageAgent.h */; };
                4F707A9911EF679400ACDA69 /* InspectorBackendDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F707A9711EF679400ACDA69 /* InspectorBackendDispatcher.cpp */; };
                4F707A9A11EF679400ACDA69 /* InspectorBackendDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F707A9811EF679400ACDA69 /* InspectorBackendDispatcher.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               4F7B4A6615FF6D6A006B5F22 /* PlatformMemoryInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F1D118A15FF361B0026E908 /* PlatformMemoryInstrumentation.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4F8565E91530356E00FAE776 /* MemoryInstrumentationImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F8565E71530356E00FAE776 /* MemoryInstrumentationImpl.cpp */; };
                4F8565EA1530356E00FAE776 /* MemoryInstrumentationImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F8565E81530356E00FAE776 /* MemoryInstrumentationImpl.h */; };
                4FA3B90A125CD12200300BAD /* InspectorState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FA3B908125CD12100300BAD /* InspectorState.cpp */; };
                4E1959280A39DACC00220FE5 /* MediaQueryExp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaQueryExp.h; sourceTree = "<group>"; };
                4F1534DD11B532EC0021FD86 /* EditingBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingBehavior.h; sourceTree = "<group>"; };
                4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingBehaviorTypes.h; sourceTree = "<group>"; };
+               4F1D118915FF361B0026E908 /* PlatformMemoryInstrumentation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformMemoryInstrumentation.cpp; sourceTree = "<group>"; };
+               4F1D118A15FF361B0026E908 /* PlatformMemoryInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformMemoryInstrumentation.h; sourceTree = "<group>"; };
                4F2D205212EAE7B3005C2874 /* InspectorAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAgent.h; sourceTree = "<group>"; };
                4F2D205312EAE7B3005C2874 /* InspectorAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorAgent.cpp; sourceTree = "<group>"; };
                4F3289B311A42AAB005ABE7E /* InspectorValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorValues.cpp; sourceTree = "<group>"; };
                                49182B5015DCE6F000548418 /* PlatformInstrumentation.cpp */,
                                49182B5115DCE6F000548418 /* PlatformInstrumentation.h */,
                                935C476609AC4D4300A6AAB4 /* PlatformKeyboardEvent.h */,
+                               4F1D118915FF361B0026E908 /* PlatformMemoryInstrumentation.cpp */,
+                               4F1D118A15FF361B0026E908 /* PlatformMemoryInstrumentation.h */,
                                932871BF0B20DEB70049035A /* PlatformMenuDescription.h */,
                                935C476709AC4D4300A6AAB4 /* PlatformMouseEvent.h */,
                                C5BAC16F14E30E4700008837 /* PlatformPasteboard.h */,
                                E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
                                977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
                                FD537353137B651800008DCE /* ZeroPole.h in Headers */,
+                               4F7B4A6615FF6D6A006B5F22 /* PlatformMemoryInstrumentation.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
                                977E2E0E12F0FC9C00C13379 /* XSSAuditor.cpp in Sources */,
                                FD537352137B651800008DCE /* ZeroPole.cpp in Sources */,
+                               4F1D11BF15FF37200026E908 /* PlatformMemoryInstrumentation.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index b06c081..d86b257 100644 (file)
@@ -37,7 +37,6 @@ MemoryObjectType WebCoreMemoryTypes::Page = "Page";
 MemoryObjectType WebCoreMemoryTypes::DOM = "Page.DOM";
 MemoryObjectType WebCoreMemoryTypes::CSS = "Page.CSS";
 MemoryObjectType WebCoreMemoryTypes::Binding = "Page.Binding";
-MemoryObjectType WebCoreMemoryTypes::Loader = "Page.Loader";
 
 MemoryObjectType WebCoreMemoryTypes::MemoryCache = "MemoryCache";
 MemoryObjectType WebCoreMemoryTypes::MemoryCacheStructures = "MemoryCache.InternalStructures";
index 02e1ed1..44d6b1e 100644 (file)
 #ifndef WebCoreMemoryInstrumentation_h
 #define WebCoreMemoryInstrumentation_h
 
-#include <wtf/MemoryInstrumentation.h>
+#include "PlatformMemoryInstrumentation.h"
 
 namespace WebCore {
 
 using WTF::MemoryClassInfo;
 using WTF::MemoryObjectType;
 
-class WebCoreMemoryTypes {
+class WebCoreMemoryTypes : public PlatformMemoryTypes {
 public:
     static MemoryObjectType Page;
     static MemoryObjectType DOM;
     static MemoryObjectType CSS;
     static MemoryObjectType Binding;
-    static MemoryObjectType Loader;
 
     static MemoryObjectType MemoryCache;
     static MemoryObjectType MemoryCacheStructures;
index e8874cc..2cef9ad 100644 (file)
@@ -481,6 +481,7 @@ public:
 
         RefPtr<TypeBuilder::Array<InspectorMemoryBlock> > domChildren = TypeBuilder::Array<InspectorMemoryBlock>::create();
         totalSize += addMemoryBlockFor(domChildren.get(), WebCoreMemoryTypes::DOM);
+        totalSize += addMemoryBlockFor(domChildren.get(), WebCoreMemoryTypes::Image);
         totalSize += addMemoryBlockFor(domChildren.get(), WebCoreMemoryTypes::CSS);
         totalSize += addMemoryBlockFor(domChildren.get(), WebCoreMemoryTypes::Binding);
         totalSize += addMemoryBlockFor(domChildren.get(), WebCoreMemoryTypes::Loader);
index a969fff..86e2861 100644 (file)
@@ -28,8 +28,8 @@
 #include "KURL.h"
 
 #include "DecodeEscapeSequences.h"
+#include "PlatformMemoryInstrumentation.h"
 #include "TextEncoding.h"
-#include "WebCoreMemoryInstrumentation.h"
 #include <stdio.h>
 #include <wtf/HashMap.h>
 #if !USE(WTFURL)
index 6b78d59..ba80640 100644 (file)
@@ -41,8 +41,8 @@
 #include <algorithm>
 
 #include "NotImplemented.h"
+#include "PlatformMemoryInstrumentation.h"
 #include "TextEncoding.h"
-#include "WebCoreMemoryInstrumentation.h"
 #include <wtf/HashMap.h>
 #include <wtf/Vector.h>
 #include <wtf/StdLibExtras.h>
diff --git a/Source/WebCore/platform/PlatformMemoryInstrumentation.cpp b/Source/WebCore/platform/PlatformMemoryInstrumentation.cpp
new file mode 100644 (file)
index 0000000..d872ff0
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * 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 "PlatformMemoryInstrumentation.h"
+
+namespace WebCore {
+
+MemoryObjectType PlatformMemoryTypes::Image = "Page.Image";
+MemoryObjectType PlatformMemoryTypes::Loader = "Page.Loader";
+
+} // namespace WebCore
diff --git a/Source/WebCore/platform/PlatformMemoryInstrumentation.h b/Source/WebCore/platform/PlatformMemoryInstrumentation.h
new file mode 100644 (file)
index 0000000..22b9097
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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>
+
+namespace WebCore {
+
+using WTF::MemoryClassInfo;
+using WTF::MemoryObjectType;
+
+class PlatformMemoryTypes {
+public:
+    static MemoryObjectType Image;
+    static MemoryObjectType Loader;
+};
+
+} // namespace WebCore
+
+#endif // !defined(PlatformMemoryInstrumentation_h)
index b9dd3a3..68c3196 100644 (file)
@@ -27,8 +27,8 @@
 #include "config.h"
 #include "SharedBuffer.h"
 
+#include "PlatformMemoryInstrumentation.h"
 #include "PurgeableBuffer.h"
-#include "WebCoreMemoryInstrumentation.h"
 #include <wtf/PassOwnPtr.h>
 #include <wtf/unicode/UTF8.h>
 #include <wtf/unicode/Unicode.h>
index 6f652db..4b1291c 100644 (file)
@@ -113,7 +113,7 @@ public:
 
     void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     {
-        MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM);
+        MemoryClassInfo info(memoryObjectInfo, this);
         info.addInstrumentedMember(m_parent);
     }
 
index 448a282..56d38de 100644 (file)
@@ -31,8 +31,8 @@
 #include "ImageObserver.h"
 #include "IntRect.h"
 #include "MIMETypeRegistry.h"
+#include "PlatformMemoryInstrumentation.h"
 #include "Timer.h"
-#include "WebCoreMemoryInstrumentation.h"
 #include <wtf/CurrentTime.h>
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
@@ -574,7 +574,7 @@ Color BitmapImage::solidColor() const
 
 void BitmapImage::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
-    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResourceImage);
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image);
     Image::reportMemoryUsage(memoryObjectInfo);
     info.addMember(m_source);
     info.addMember(m_frameTimer);
index 178e424..bb7ccc2 100644 (file)
@@ -29,7 +29,7 @@
 #include "FloatRect.h"
 #include "GraphicsContext.h"
 #include "ImageBuffer.h"
-#include "WebCoreMemoryInstrumentation.h"
+#include "PlatformMemoryInstrumentation.h"
 
 using namespace std;
 
@@ -110,7 +110,7 @@ void CrossfadeGeneratedImage::drawPattern(GraphicsContext* context, const FloatR
 
 void CrossfadeGeneratedImage::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
-    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM);
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image);
     GeneratedImage::reportMemoryUsage(memoryObjectInfo);
     info.addInstrumentedMember(m_fromImage);
     info.addInstrumentedMember(m_toImage);
index 2d504a3..c105ca6 100644 (file)
@@ -32,7 +32,7 @@
 #include "GeneratedImage.h"
 
 #include "FloatSize.h"
-#include "WebCoreMemoryInstrumentation.h"
+#include "PlatformMemoryInstrumentation.h"
 
 
 namespace WebCore {
@@ -45,7 +45,7 @@ void GeneratedImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length&
 
 void GeneratedImage::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
-    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResourceImage);
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image);
     Image::reportMemoryUsage(memoryObjectInfo);
 }
 
index 0431cb9..c42f880 100644 (file)
@@ -29,6 +29,7 @@
 #include "FloatRect.h"
 #include "GraphicsContext.h"
 #include "Length.h"
+#include "PlatformMemoryInstrumentation.h"
 
 namespace WebCore {
 
@@ -87,7 +88,7 @@ void GeneratorGeneratedImage::invalidateCacheTimerFired(DeferrableOneShotTimer<G
 
 void GeneratorGeneratedImage::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
-    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM);
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image);
     GeneratedImage::reportMemoryUsage(memoryObjectInfo);
     info.addMember(m_generator);
     info.addMember(m_cachedImageBuffer);
index 96a315d..6110097 100644 (file)
@@ -32,7 +32,6 @@
 #include "ImageBuffer.h"
 #include "IntSize.h"
 #include "Timer.h"
-#include "WebCoreMemoryInstrumentation.h"
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
index 8e743ba..3c67b84 100644 (file)
@@ -34,8 +34,8 @@
 #include "IntRect.h"
 #include "Length.h"
 #include "MIMETypeRegistry.h"
+#include "PlatformMemoryInstrumentation.h"
 #include "SharedBuffer.h"
-#include "WebCoreMemoryInstrumentation.h"
 #include <math.h>
 #include <wtf/MainThread.h>
 #include <wtf/StdLibExtras.h>
@@ -200,7 +200,7 @@ void Image::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsic
 
 void Image::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
-    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResourceImage);
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image);
     info.addInstrumentedMember(m_data);
     info.addMember(m_imageObserver);
 }
index ab25e87..45f7302 100644 (file)
@@ -33,8 +33,8 @@
 #include "FormDataList.h"
 #include "MIMETypeRegistry.h"
 #include "Page.h"
+#include "PlatformMemoryInstrumentation.h"
 #include "TextEncoding.h"
-#include "WebCoreMemoryInstrumentation.h"
 #include <wtf/Decoder.h>
 #include <wtf/Encoder.h>
 
@@ -359,7 +359,7 @@ void FormData::removeGeneratedFilesIfNeeded()
 
 void FormData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
-    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Loader);
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Loader);
     info.addVector(m_boundary);
 }
 
index cbb74d4..b8193f0 100644 (file)
@@ -26,8 +26,8 @@
 #include "config.h"
 #include "ResourceRequestBase.h"
 
+#include "PlatformMemoryInstrumentation.h"
 #include "ResourceRequest.h"
-#include "WebCoreMemoryInstrumentation.h"
 
 using namespace std;
 
@@ -446,7 +446,7 @@ bool ResourceRequestBase::isConditional() const
 
 void ResourceRequestBase::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
-    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Loader);
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Loader);
     info.addInstrumentedMember(m_url);
     info.addInstrumentedMember(m_firstPartyForCookies);
     info.addInstrumentedMember(m_httpMethod);
index c22cf65..6235245 100644 (file)
@@ -28,8 +28,8 @@
 #include "ResourceResponseBase.h"
 
 #include "HTTPParsers.h"
+#include "PlatformMemoryInstrumentation.h"
 #include "ResourceResponse.h"
-#include "WebCoreMemoryInstrumentation.h"
 #include <wtf/CurrentTime.h>
 #include <wtf/MathExtras.h>
 #include <wtf/StdLibExtras.h>
@@ -570,7 +570,7 @@ void ResourceResponseBase::lazyInit(InitLevel initLevel) const
 
 void ResourceResponseBase::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
-    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Loader);
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Loader);
     info.addInstrumentedMember(m_url);
     info.addInstrumentedMember(m_mimeType);
     info.addInstrumentedMember(m_textEncodingName);