Title: [141876] trunk/Source/WebCore
Revision
141876
Author
[email protected]
Date
2013-02-05 02:10:18 -0800 (Tue, 05 Feb 2013)

Log Message

Web Inspector:  introduce Memory.getDOMCounters
https://bugs.webkit.org/show_bug.cgi?id=108822

Reviewed by Pavel Feldman.

Introduced Memory.getDOMCounters command that returns number of Documents, Nodes
and JS event listeners in the inspected process.

* inspector/Inspector.json:
* inspector/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::getDOMCounters):
(WebCore):
* inspector/InspectorMemoryAgent.h:
(InspectorMemoryAgent):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (141875 => 141876)


--- trunk/Source/WebCore/ChangeLog	2013-02-05 09:57:27 UTC (rev 141875)
+++ trunk/Source/WebCore/ChangeLog	2013-02-05 10:10:18 UTC (rev 141876)
@@ -1,3 +1,20 @@
+2013-02-05  Yury Semikhatsky  <[email protected]>
+
+        Web Inspector:  introduce Memory.getDOMCounters
+        https://bugs.webkit.org/show_bug.cgi?id=108822
+
+        Reviewed by Pavel Feldman.
+
+        Introduced Memory.getDOMCounters command that returns number of Documents, Nodes
+        and JS event listeners in the inspected process.
+
+        * inspector/Inspector.json:
+        * inspector/InspectorMemoryAgent.cpp:
+        (WebCore::InspectorMemoryAgent::getDOMCounters):
+        (WebCore):
+        * inspector/InspectorMemoryAgent.h:
+        (InspectorMemoryAgent):
+
 2013-02-04  Ilya Tikhonovsky  <[email protected]>
 
         Web Inspector: Native Memory Instrumentation: rename Image m_data member to m_encodedImageData for the consistency

Modified: trunk/Source/WebCore/inspector/Inspector.json (141875 => 141876)


--- trunk/Source/WebCore/inspector/Inspector.json	2013-02-05 09:57:27 UTC (rev 141875)
+++ trunk/Source/WebCore/inspector/Inspector.json	2013-02-05 10:10:18 UTC (rev 141876)
@@ -100,6 +100,14 @@
                 ]
             },
             {
+                "name": "getDOMCounters",
+                "returns": [
+                    { "name": "documents", "type": "integer" },
+                    { "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." }

Modified: trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp (141875 => 141876)


--- trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp	2013-02-05 09:57:27 UTC (rev 141875)
+++ trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp	2013-02-05 10:10:18 UTC (rev 141876)
@@ -429,6 +429,13 @@
     strings = counterVisitor.strings();
 }
 
+void InspectorMemoryAgent::getDOMCounters(ErrorString*, int* documents, int* nodes, int* jsEventListeners)
+{
+    *documents = InspectorCounters::counterValue(InspectorCounters::DocumentCounter);
+    *nodes = InspectorCounters::counterValue(InspectorCounters::NodeCounter);
+    *jsEventListeners = ThreadLocalInspectorCounters::current().counterValue(ThreadLocalInspectorCounters::JSEventListenerCounter);
+}
+
 static void reportJSHeapInfo(WTF::MemoryInstrumentationClient& memoryInstrumentationClient)
 {
     HeapInfo info;

Modified: trunk/Source/WebCore/inspector/InspectorMemoryAgent.h (141875 => 141876)


--- trunk/Source/WebCore/inspector/InspectorMemoryAgent.h	2013-02-05 09:57:27 UTC (rev 141875)
+++ trunk/Source/WebCore/inspector/InspectorMemoryAgent.h	2013-02-05 10:10:18 UTC (rev 141876)
@@ -59,6 +59,7 @@
     virtual ~InspectorMemoryAgent();
 
     virtual void getDOMNodeCount(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Memory::DOMGroup> >& domGroups, RefPtr<TypeBuilder::Memory::StringStatistics>& strings);
+    virtual void getDOMCounters(ErrorString*, int* documents, int* nodes, int* jsEventListeners);
     virtual void getProcessMemoryDistribution(ErrorString*, const bool* reportGraph, RefPtr<TypeBuilder::Memory::MemoryBlock>& processMemory, RefPtr<InspectorObject>& graph);
 
     virtual void reportMemoryUsage(MemoryObjectInfo*) const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to