Web Inspector: Native Memory Instrumentation: reportLeaf method doesn't report the...
[WebKit-https.git] / Source / WebCore / inspector / HeapGraphSerializer.h
index 6d9c9264455f68fdca1897c53ffeb1ad982241b1..0f18bfb1926db0de0e3625228c805572f2091a42 100644 (file)
 
 namespace WebCore {
 
-class HeapGraphEdge;
-class HeapGraphNode;
-class InspectorObject;
-
 class HeapGraphSerializer {
     WTF_MAKE_NONCOPYABLE(HeapGraphSerializer);
 public:
-    explicit HeapGraphSerializer(InspectorFrontend::Memory*);
+
+    class Client {
+    public:
+        virtual ~Client() { }
+        virtual void addNativeSnapshotChunk(PassRefPtr<TypeBuilder::Memory::HeapSnapshotChunk>) = 0;
+    };
+
+    explicit HeapGraphSerializer(Client*);
     ~HeapGraphSerializer();
     void reportNode(const WTF::MemoryObjectInfo&);
     void reportEdge(const void*, const char*, WTF::MemberType);
@@ -73,7 +76,7 @@ private:
     void reportEdgeImpl(const int toNodeId, const char* name, int memberType);
     int reportNodeImpl(const WTF::MemoryObjectInfo&, int edgesCount);
 
-    InspectorFrontend::Memory* m_frontend;
+    Client* m_client;
 
     typedef HashMap<String, int> StringMap;
     StringMap m_stringToIndex;
@@ -100,6 +103,9 @@ private:
 
     size_t m_edgeTypes[WTF::LastMemberTypeEntry];
     int m_unknownClassNameId;
+    int m_leafCount;
+
+    static const int s_firstNodeId = 1;
 };
 
 } // namespace WebCore