Title: [128451] trunk/Source/WebCore
Revision
128451
Author
[email protected]
Date
2012-09-13 06:22:40 -0700 (Thu, 13 Sep 2012)

Log Message

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):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (128450 => 128451)


--- trunk/Source/WebCore/CMakeLists.txt	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/CMakeLists.txt	2012-09-13 13:22:40 UTC (rev 128451)
@@ -1768,6 +1768,7 @@
     platform/MemoryPressureHandler.cpp
     platform/PlatformEvent.cpp
     platform/PlatformInstrumentation.cpp
+    platform/PlatformMemoryInstrumentation.cpp
     platform/RunLoop.cpp
     platform/RuntimeApplicationChecks.cpp
     platform/ScrollAnimator.cpp

Modified: trunk/Source/WebCore/ChangeLog (128450 => 128451)


--- trunk/Source/WebCore/ChangeLog	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/ChangeLog	2012-09-13 13:22:40 UTC (rev 128451)
@@ -1,5 +1,57 @@
 2012-09-13  Ilya Tikhonovsky  <[email protected]>
 
+        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  <[email protected]>
+
         Web Inspector: NMI: instrument KURL directly.
         https://bugs.webkit.org/show_bug.cgi?id=96624
 

Modified: trunk/Source/WebCore/GNUmakefile.list.am (128450 => 128451)


--- trunk/Source/WebCore/GNUmakefile.list.am	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2012-09-13 13:22:40 UTC (rev 128451)
@@ -4689,6 +4689,8 @@
 	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 \

Modified: trunk/Source/WebCore/Target.pri (128450 => 128451)


--- trunk/Source/WebCore/Target.pri	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/Target.pri	2012-09-13 13:22:40 UTC (rev 128451)
@@ -1046,6 +1046,7 @@
     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 @@
     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 \

Modified: trunk/Source/WebCore/WebCore.gypi (128450 => 128451)


--- trunk/Source/WebCore/WebCore.gypi	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/WebCore.gypi	2012-09-13 13:22:40 UTC (rev 128451)
@@ -4494,6 +4494,8 @@
             'platform/MIMETypeRegistry.cpp',
             'platform/Pasteboard.h',
             'platform/PlatformGestureCurve.h',
+            'platform/PlatformMemoryInstrumentation.cpp',
+            'platform/PlatformMemoryInstrumentation.h',
             'platform/PlatformStrategies.cpp',
             'platform/PlatformTouchEvent.h',
             'platform/PlatformTouchPoint.h',

Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (128450 => 128451)


--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-09-13 13:22:40 UTC (rev 128451)
@@ -28611,6 +28611,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\platform\PlatformMemoryInstrumentation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\platform\PlatformMemoryInstrumentation.h"
+				>
+			</File>
+			<File
 				RelativePath="..\platform\PlatformMenuDescription.h"
 				>
 			</File>

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (128450 => 128451)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-09-13 13:22:40 UTC (rev 128451)
@@ -1451,6 +1451,7 @@
 		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 */; };
@@ -1461,6 +1462,7 @@
 		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 */; };
@@ -8622,6 +8624,8 @@
 		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>"; };
@@ -20838,6 +20842,8 @@
 				49182B5015DCE6F000548418 /* PlatformInstrumentation.cpp */,
 				49182B5115DCE6F000548418 /* PlatformInstrumentation.h */,
 				935C476609AC4D4300A6AAB4 /* PlatformKeyboardEvent.h */,
+				4F1D118915FF361B0026E908 /* PlatformMemoryInstrumentation.cpp */,
+				4F1D118A15FF361B0026E908 /* PlatformMemoryInstrumentation.h */,
 				932871BF0B20DEB70049035A /* PlatformMenuDescription.h */,
 				935C476709AC4D4300A6AAB4 /* PlatformMouseEvent.h */,
 				C5BAC16F14E30E4700008837 /* PlatformPasteboard.h */,
@@ -25554,6 +25560,7 @@
 				E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
 				977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
 				FD537353137B651800008DCE /* ZeroPole.h in Headers */,
+				4F7B4A6615FF6D6A006B5F22 /* PlatformMemoryInstrumentation.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -28651,6 +28658,7 @@
 				E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
 				977E2E0E12F0FC9C00C13379 /* XSSAuditor.cpp in Sources */,
 				FD537352137B651800008DCE /* ZeroPole.cpp in Sources */,
+				4F1D11BF15FF37200026E908 /* PlatformMemoryInstrumentation.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: trunk/Source/WebCore/dom/WebCoreMemoryInstrumentation.cpp (128450 => 128451)


--- trunk/Source/WebCore/dom/WebCoreMemoryInstrumentation.cpp	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/dom/WebCoreMemoryInstrumentation.cpp	2012-09-13 13:22:40 UTC (rev 128451)
@@ -37,7 +37,6 @@
 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";

Modified: trunk/Source/WebCore/dom/WebCoreMemoryInstrumentation.h (128450 => 128451)


--- trunk/Source/WebCore/dom/WebCoreMemoryInstrumentation.h	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/dom/WebCoreMemoryInstrumentation.h	2012-09-13 13:22:40 UTC (rev 128451)
@@ -31,20 +31,19 @@
 #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;

Modified: trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp (128450 => 128451)


--- trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp	2012-09-13 13:22:40 UTC (rev 128451)
@@ -481,6 +481,7 @@
 
         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);

Modified: trunk/Source/WebCore/platform/KURL.cpp (128450 => 128451)


--- trunk/Source/WebCore/platform/KURL.cpp	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/platform/KURL.cpp	2012-09-13 13:22:40 UTC (rev 128451)
@@ -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)

Modified: trunk/Source/WebCore/platform/KURLGoogle.cpp (128450 => 128451)


--- trunk/Source/WebCore/platform/KURLGoogle.cpp	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/platform/KURLGoogle.cpp	2012-09-13 13:22:40 UTC (rev 128451)
@@ -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>

Copied: trunk/Source/WebCore/platform/PlatformMemoryInstrumentation.cpp (from rev 128450, trunk/Source/WebCore/platform/graphics/GeneratedImage.cpp) (0 => 128451)


--- trunk/Source/WebCore/platform/PlatformMemoryInstrumentation.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/PlatformMemoryInstrumentation.cpp	2012-09-13 13:22:40 UTC (rev 128451)
@@ -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

Copied: trunk/Source/WebCore/platform/PlatformMemoryInstrumentation.h (from rev 128450, trunk/Source/WebCore/platform/graphics/GeneratedImage.cpp) (0 => 128451)


--- trunk/Source/WebCore/platform/PlatformMemoryInstrumentation.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/PlatformMemoryInstrumentation.h	2012-09-13 13:22:40 UTC (rev 128451)
@@ -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)

Modified: trunk/Source/WebCore/platform/SharedBuffer.cpp (128450 => 128451)


--- trunk/Source/WebCore/platform/SharedBuffer.cpp	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/platform/SharedBuffer.cpp	2012-09-13 13:22:40 UTC (rev 128451)
@@ -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>

Modified: trunk/Source/WebCore/platform/TreeShared.h (128450 => 128451)


--- trunk/Source/WebCore/platform/TreeShared.h	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/platform/TreeShared.h	2012-09-13 13:22:40 UTC (rev 128451)
@@ -113,7 +113,7 @@
 
     void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     {
-        MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM);
+        MemoryClassInfo info(memoryObjectInfo, this);
         info.addInstrumentedMember(m_parent);
     }
 

Modified: trunk/Source/WebCore/platform/graphics/BitmapImage.cpp (128450 => 128451)


--- trunk/Source/WebCore/platform/graphics/BitmapImage.cpp	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/platform/graphics/BitmapImage.cpp	2012-09-13 13:22:40 UTC (rev 128451)
@@ -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 @@
 
 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);

Modified: trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp (128450 => 128451)


--- trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp	2012-09-13 13:22:40 UTC (rev 128451)
@@ -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::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);

Modified: trunk/Source/WebCore/platform/graphics/GeneratedImage.cpp (128450 => 128451)


--- trunk/Source/WebCore/platform/graphics/GeneratedImage.cpp	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/platform/graphics/GeneratedImage.cpp	2012-09-13 13:22:40 UTC (rev 128451)
@@ -32,7 +32,7 @@
 #include "GeneratedImage.h"
 
 #include "FloatSize.h"
-#include "WebCoreMemoryInstrumentation.h"
+#include "PlatformMemoryInstrumentation.h"
 
 
 namespace WebCore {
@@ -45,7 +45,7 @@
 
 void GeneratedImage::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
-    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResourceImage);
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image);
     Image::reportMemoryUsage(memoryObjectInfo);
 }
 

Modified: trunk/Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp (128450 => 128451)


--- trunk/Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp	2012-09-13 13:22:40 UTC (rev 128451)
@@ -29,6 +29,7 @@
 #include "FloatRect.h"
 #include "GraphicsContext.h"
 #include "Length.h"
+#include "PlatformMemoryInstrumentation.h"
 
 namespace WebCore {
 
@@ -87,7 +88,7 @@
 
 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);

Modified: trunk/Source/WebCore/platform/graphics/GeneratorGeneratedImage.h (128450 => 128451)


--- trunk/Source/WebCore/platform/graphics/GeneratorGeneratedImage.h	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/platform/graphics/GeneratorGeneratedImage.h	2012-09-13 13:22:40 UTC (rev 128451)
@@ -32,7 +32,6 @@
 #include "ImageBuffer.h"
 #include "IntSize.h"
 #include "Timer.h"
-#include "WebCoreMemoryInstrumentation.h"
 #include <wtf/RefPtr.h>
 
 namespace WebCore {

Modified: trunk/Source/WebCore/platform/graphics/Image.cpp (128450 => 128451)


--- trunk/Source/WebCore/platform/graphics/Image.cpp	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/platform/graphics/Image.cpp	2012-09-13 13:22:40 UTC (rev 128451)
@@ -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::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
-    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResourceImage);
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image);
     info.addInstrumentedMember(m_data);
     info.addMember(m_imageObserver);
 }

Modified: trunk/Source/WebCore/platform/network/FormData.cpp (128450 => 128451)


--- trunk/Source/WebCore/platform/network/FormData.cpp	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/platform/network/FormData.cpp	2012-09-13 13:22:40 UTC (rev 128451)
@@ -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::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
-    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Loader);
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Loader);
     info.addVector(m_boundary);
 }
 

Modified: trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp (128450 => 128451)


--- trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp	2012-09-13 13:22:40 UTC (rev 128451)
@@ -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 @@
 
 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);

Modified: trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp (128450 => 128451)


--- trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp	2012-09-13 12:39:46 UTC (rev 128450)
+++ trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp	2012-09-13 13:22:40 UTC (rev 128451)
@@ -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::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);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to