/*
- * 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
#define Profile_h
#include "ProfileNode.h"
-#include <runtime/UString.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
namespace JSC {
- class Profile : public RefCounted<Profile> {
- public:
- static PassRefPtr<Profile> create(const UString& title, unsigned uid);
- virtual ~Profile();
+class JS_EXPORT_PRIVATE Profile : public RefCounted<Profile> {
+public:
+ static PassRefPtr<Profile> create(const String& title, unsigned uid);
+ virtual ~Profile();
- const UString& 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; }
- void forEach(void (ProfileNode::*)());
- void sortTotalTimeDescending() { forEach(&ProfileNode::sortTotalTimeDescending); }
- void sortTotalTimeAscending() { forEach(&ProfileNode::sortTotalTimeAscending); }
- void sortSelfTimeDescending() { forEach(&ProfileNode::sortSelfTimeDescending); }
- void sortSelfTimeAscending() { forEach(&ProfileNode::sortSelfTimeAscending); }
- void sortCallsDescending() { forEach(&ProfileNode::sortCallsDescending); }
- void sortCallsAscending() { forEach(&ProfileNode::sortCallsAscending); }
- void sortFunctionNameDescending() { forEach(&ProfileNode::sortFunctionNameDescending); }
- void sortFunctionNameAscending() { forEach(&ProfileNode::sortFunctionNameAscending); }
+ ProfileNode* head() const { return m_head.get(); }
+ void setHead(PassRefPtr<ProfileNode> head) { m_head = head; }
- void focus(const ProfileNode*);
- void exclude(const ProfileNode*);
- void restoreAll();
+ double totalTime() const { return m_head->totalTime(); }
- virtual Profile* heavyProfile() = 0;
- virtual Profile* treeProfile() = 0;
+ double idleTime() const { return m_idleTime; }
+ void setIdleTime(double idleTime) { m_idleTime = idleTime; }
+
+ void forEach(void (ProfileNode::*)());
#ifndef NDEBUG
- void debugPrintData() const;
- void debugPrintDataSampleStyle() const;
+ void debugPrintData() const;
+ void debugPrintDataSampleStyle() const;
#endif
- protected:
- Profile(const UString& title, unsigned uid);
+protected:
+ Profile(const String& title, unsigned uid);
- private:
- void removeProfileStart();
- void removeProfileEnd();
-
- UString m_title;
- RefPtr<ProfileNode> m_head;
- unsigned int m_uid;
- };
+private:
+ void removeProfileStart();
+ void removeProfileEnd();
+
+ String m_title;
+ RefPtr<ProfileNode> m_head;
+ unsigned m_uid;
+ double m_idleTime;
+};
} // namespace JSC