Memory instrumentation: remove reportMemoryUsage method from ImageObserver
authoryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Nov 2012 11:21:33 +0000 (11:21 +0000)
committeryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Nov 2012 11:21:33 +0000 (11:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=102058

Reviewed by Pavel Feldman.

* bindings/v8/V8PerIsolateData.cpp:
(WebCore::V8PerIsolateData::reportMemoryUsage): drive-by fix, no need to report
each element of the vector as generic vector instrumentation will take care of it.
* platform/graphics/Image.cpp: the client is reported as weak pointer to make sure
we don't count its by the pointer to the base class which may differ from the actual
object address.
(WebCore::Image::reportMemoryUsage):
* platform/graphics/ImageObserver.h: removed reportMemoryUsage method from the interface.
(ImageObserver):

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

Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/V8PerIsolateData.cpp
Source/WebCore/platform/graphics/Image.cpp
Source/WebCore/platform/graphics/ImageObserver.h

index 06a8be1..b664703 100644 (file)
@@ -1,3 +1,20 @@
+2012-11-13  Yury Semikhatsky  <yurys@chromium.org>
+
+        Memory instrumentation: remove reportMemoryUsage method from ImageObserver
+        https://bugs.webkit.org/show_bug.cgi?id=102058
+
+        Reviewed by Pavel Feldman.
+
+        * bindings/v8/V8PerIsolateData.cpp:
+        (WebCore::V8PerIsolateData::reportMemoryUsage): drive-by fix, no need to report
+        each element of the vector as generic vector instrumentation will take care of it.
+        * platform/graphics/Image.cpp: the client is reported as weak pointer to make sure
+        we don't count its by the pointer to the base class which may differ from the actual
+        object address.
+        (WebCore::Image::reportMemoryUsage):
+        * platform/graphics/ImageObserver.h: removed reportMemoryUsage method from the interface.
+        (ImageObserver):
+
 2012-11-13  Eberhard Graether  <egraether@google.com>
 
         checkbox to toggle FPS counter in the inspector's settings
index f6330f1..b9b19ac 100644 (file)
@@ -108,9 +108,6 @@ void V8PerIsolateData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) con
     info.addMember(m_stringCache);
     info.addMember(m_domDataList);
 
-    for (size_t i = 0; i < m_domDataList.size(); i++)
-        info.addMember(m_domDataList[i]);
-
     info.addPrivateBuffer(ScriptProfiler::profilerSnapshotsSize(), WebCoreMemoryTypes::InspectorProfilerAgent);
 }
 
index 78e5e48..1cac997 100644 (file)
@@ -202,7 +202,7 @@ void Image::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
     MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image);
     info.addMember(m_data);
-    info.addMember(m_imageObserver);
+    info.addWeakPointer(m_imageObserver);
 }
 
 }
index 804cdeb..8b693d9 100644 (file)
@@ -26,8 +26,6 @@
 #ifndef ImageObserver_h
 #define ImageObserver_h
 
-#include <wtf/Forward.h>
-
 namespace WebCore {
 
 class Image;
@@ -46,8 +44,6 @@ public:
     virtual void animationAdvanced(const Image*) = 0;
 
     virtual void changedInRect(const Image*, const IntRect&) = 0;
-
-    virtual void reportMemoryUsage(MemoryObjectInfo*) const = 0;
 };
 
 }