Title: [127443] trunk/Source/WebCore
Revision
127443
Author
[email protected]
Date
2012-09-04 01:19:02 -0700 (Tue, 04 Sep 2012)

Log Message

Web Inspector: NMI: cosmetic change, rename m_domMemoryUsage to m_memoryInstrumentation.
https://bugs.webkit.org/show_bug.cgi?id=95716

Also m_memoryInstrumentation became a reference to external object because it has other life time than domNodeVisitor.

Reviewed by Yury Semikhatsky.

* inspector/InspectorMemoryAgent.cpp:
(WebCore):
(WebCore::collectDomTreeInfo):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (127442 => 127443)


--- trunk/Source/WebCore/ChangeLog	2012-09-04 07:25:38 UTC (rev 127442)
+++ trunk/Source/WebCore/ChangeLog	2012-09-04 08:19:02 UTC (rev 127443)
@@ -1,3 +1,16 @@
+2012-09-04  Ilya Tikhonovsky  <[email protected]>
+
+        Web Inspector: NMI: cosmetic change, rename m_domMemoryUsage to m_memoryInstrumentation.
+        https://bugs.webkit.org/show_bug.cgi?id=95716
+
+        Also m_memoryInstrumentation became a reference to external object because it has other life time than domNodeVisitor.
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/InspectorMemoryAgent.cpp:
+        (WebCore):
+        (WebCore::collectDomTreeInfo):
+
 2012-08-31  Simon Hausmann  <[email protected]>
 
         [Qt] Port the Qt pixmap JS bindings to use the JSC C API

Modified: trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp (127442 => 127443)


--- trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp	2012-09-04 07:25:38 UTC (rev 127442)
+++ trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp	2012-09-04 08:19:02 UTC (rev 127443)
@@ -451,9 +451,9 @@
 
 class DOMTreesIterator : public NodeWrapperVisitor {
 public:
-    DOMTreesIterator(Page* page, VisitedObjects& visitedObjects)
+    DOMTreesIterator(Page* page, MemoryInstrumentationImpl& memoryInstrumentation)
         : m_page(page)
-        , m_domMemoryUsage(visitedObjects)
+        , m_memoryInstrumentation(memoryInstrumentation)
     {
     }
 
@@ -462,22 +462,22 @@
         if (node->document() && node->document()->frame() && m_page != node->document()->frame()->page())
             return;
 
-        m_domMemoryUsage.addRootObject(node);
+        m_memoryInstrumentation.addRootObject(node);
     }
 
     void visitFrame(Frame* frame)
     {
-        m_domMemoryUsage.addRootObject(frame);
+        m_memoryInstrumentation.addRootObject(frame);
     }
 
     void visitBindings()
     {
-        ScriptProfiler::collectBindingMemoryInfo(&m_domMemoryUsage);
+        ScriptProfiler::collectBindingMemoryInfo(&m_memoryInstrumentation);
     }
 
     void visitMemoryCache()
     {
-        m_domMemoryUsage.addRootObject(memoryCache());
+        m_memoryInstrumentation.addRootObject(memoryCache());
     }
 
     PassRefPtr<InspectorMemoryBlock> buildObjectForMemoryCache() const
@@ -486,18 +486,18 @@
 
         COMPILE_ASSERT(MemoryInstrumentation::LastTypeEntry == MemoryInstrumentation::CachedResourceXSLT + 1, object_type_enum_was_changed_please_fix_the_implementation);
         for (int i = MemoryInstrumentation::MemoryCacheStructures; i < MemoryInstrumentation::LastTypeEntry; ++i)
-            totalSize += m_domMemoryUsage.totalSize(static_cast<MemoryInstrumentation::ObjectType>(i));
+            totalSize += m_memoryInstrumentation.totalSize(static_cast<MemoryInstrumentation::ObjectType>(i));
 
         RefPtr<TypeBuilder::Array<InspectorMemoryBlock> > children = TypeBuilder::Array<InspectorMemoryBlock>::create();
-        addMemoryBlockFor(children.get(), m_domMemoryUsage.totalSize(MemoryInstrumentation::MemoryCacheStructures), MemoryBlockName::memoryCacheStructures);
-        addMemoryBlockFor(children.get(), m_domMemoryUsage.totalSize(MemoryInstrumentation::CachedResource), MemoryBlockName::cachedResource);
-        addMemoryBlockFor(children.get(), m_domMemoryUsage.totalSize(MemoryInstrumentation::CachedResourceCSS), MemoryBlockName::cachedResourceCSS);
-        addMemoryBlockFor(children.get(), m_domMemoryUsage.totalSize(MemoryInstrumentation::CachedResourceFont), MemoryBlockName::cachedResourceFont);
-        addMemoryBlockFor(children.get(), m_domMemoryUsage.totalSize(MemoryInstrumentation::CachedResourceImage), MemoryBlockName::cachedResourceImage);
-        addMemoryBlockFor(children.get(), m_domMemoryUsage.totalSize(MemoryInstrumentation::CachedResourceScript), MemoryBlockName::cachedResourceScript);
-        addMemoryBlockFor(children.get(), m_domMemoryUsage.totalSize(MemoryInstrumentation::CachedResourceSVG), MemoryBlockName::cachedResourceSVG);
-        addMemoryBlockFor(children.get(), m_domMemoryUsage.totalSize(MemoryInstrumentation::CachedResourceShader), MemoryBlockName::cachedResourceShader);
-        addMemoryBlockFor(children.get(), m_domMemoryUsage.totalSize(MemoryInstrumentation::CachedResourceXSLT), MemoryBlockName::cachedResourceXSLT);
+        addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::MemoryCacheStructures), MemoryBlockName::memoryCacheStructures);
+        addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResource), MemoryBlockName::cachedResource);
+        addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResourceCSS), MemoryBlockName::cachedResourceCSS);
+        addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResourceFont), MemoryBlockName::cachedResourceFont);
+        addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResourceImage), MemoryBlockName::cachedResourceImage);
+        addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResourceScript), MemoryBlockName::cachedResourceScript);
+        addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResourceSVG), MemoryBlockName::cachedResourceSVG);
+        addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResourceShader), MemoryBlockName::cachedResourceShader);
+        addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResourceXSLT), MemoryBlockName::cachedResourceXSLT);
 
         RefPtr<InspectorMemoryBlock> block = InspectorMemoryBlock::create().setName(MemoryBlockName::memoryCache);
         block->setSize(totalSize);
@@ -509,14 +509,14 @@
     {
         size_t totalSize = 0;
         for (int i = MemoryInstrumentation::Other; i < MemoryInstrumentation::MemoryCacheStructures; ++i)
-            totalSize += m_domMemoryUsage.totalSize(static_cast<MemoryInstrumentation::ObjectType>(i));
+            totalSize += m_memoryInstrumentation.totalSize(static_cast<MemoryInstrumentation::ObjectType>(i));
 
         RefPtr<TypeBuilder::Array<InspectorMemoryBlock> > domChildren = TypeBuilder::Array<InspectorMemoryBlock>::create();
-        addMemoryBlockFor(domChildren.get(), m_domMemoryUsage.totalSize(MemoryInstrumentation::Other), MemoryBlockName::domTreeOther);
-        addMemoryBlockFor(domChildren.get(), m_domMemoryUsage.totalSize(MemoryInstrumentation::DOM), MemoryBlockName::domTreeDOM);
-        addMemoryBlockFor(domChildren.get(), m_domMemoryUsage.totalSize(MemoryInstrumentation::CSS), MemoryBlockName::domTreeCSS);
-        addMemoryBlockFor(domChildren.get(), m_domMemoryUsage.totalSize(MemoryInstrumentation::Binding), MemoryBlockName::domTreeBinding);
-        addMemoryBlockFor(domChildren.get(), m_domMemoryUsage.totalSize(MemoryInstrumentation::Loader), MemoryBlockName::domTreeLoader);
+        addMemoryBlockFor(domChildren.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::Other), MemoryBlockName::domTreeOther);
+        addMemoryBlockFor(domChildren.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::DOM), MemoryBlockName::domTreeDOM);
+        addMemoryBlockFor(domChildren.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CSS), MemoryBlockName::domTreeCSS);
+        addMemoryBlockFor(domChildren.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::Binding), MemoryBlockName::domTreeBinding);
+        addMemoryBlockFor(domChildren.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::Loader), MemoryBlockName::domTreeLoader);
 
         RefPtr<InspectorMemoryBlock> dom = InspectorMemoryBlock::create().setName(MemoryBlockName::dom);
         dom->setSize(totalSize);
@@ -528,19 +528,20 @@
     {
         children->addItem(buildObjectForMemoryCache());
         children->addItem(buildObjectForDOM());
-        inspectorData->addComponent(MemoryBlockName::inspectorDOMData, m_domMemoryUsage.selfSize());
+        inspectorData->addComponent(MemoryBlockName::inspectorDOMData, m_memoryInstrumentation.selfSize());
     }
 
 private:
     Page* m_page;
-    MemoryInstrumentationImpl m_domMemoryUsage;
+    MemoryInstrumentationImpl& m_memoryInstrumentation;
 };
 
 }
 
 static void collectDomTreeInfo(Page* page, VisitedObjects& visitedObjects, TypeBuilder::Array<InspectorMemoryBlock>* children, InspectorDataCounter* inspectorData)
 {
-    DOMTreesIterator domTreesIterator(page, visitedObjects);
+    MemoryInstrumentationImpl memoryInstrumentation(visitedObjects);
+    DOMTreesIterator domTreesIterator(page, memoryInstrumentation);
 
     ScriptProfiler::visitNodeWrappers(&domTreesIterator);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to