]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - profiler/Profile.h
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / profiler / Profile.h
index c1c69193cc2bc118349909572ce32b1354fc058f..41cb670cae7ca9eb17ae464dac3ee31c1a1f1f92 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2014 Apple Inc. All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 namespace JSC {
 
-    class Profile : public RefCounted<Profile> {
-    public:
-        static PassRefPtr<Profile> create(const String& title, unsigned uid);
-        virtual ~Profile();
+class JS_EXPORT_PRIVATE Profile : public RefCounted<Profile> {
+public:
+    static Ref<Profile> create(const String& title, unsigned uid, double);
+    virtual ~Profile();
 
-        const String& title() const { return m_title; }
-        ProfileNode* head() const { return m_head.get(); }
-        void setHead(PassRefPtr<ProfileNode> head) { m_head = head; }
-        double totalTime() const { return m_head->totalTime(); }
-        unsigned int uid() const { return m_uid; }
+    const String& title() const { return m_title; }
+    unsigned uid() const { return m_uid; }
 
-        JS_EXPORT_PRIVATE void forEach(void (ProfileNode::*)());
-
-        JS_EXPORT_PRIVATE void focus(const ProfileNode*);
-        JS_EXPORT_PRIVATE void exclude(const ProfileNode*);
-        JS_EXPORT_PRIVATE void restoreAll();
+    ProfileNode* rootNode() const { return m_rootNode.get(); }
+    void setRootNode(PassRefPtr<ProfileNode> rootNode) { m_rootNode = rootNode; }
 
 #ifndef NDEBUG
-        void debugPrintData() const;
-        void debugPrintDataSampleStyle() const;
+    void debugPrint();
+    void debugPrintSampleStyle();
 #endif
 
-    protected:
-        Profile(const String& title, unsigned uid);
+protected:
+    Profile(const String& title, unsigned uid, double startTime);
 
-    private:
-        void removeProfileStart();
-        void removeProfileEnd();
-        String m_title;
-        RefPtr<ProfileNode> m_head;
-        unsigned int m_uid;
-    };
+private:
+    void removeProfileStart();
+    void removeProfileEnd();
+
+    String m_title;
+    RefPtr<ProfileNode> m_rootNode;
+    unsigned m_uid;
+};
 
 } // namespace JSC