/*
- * 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