X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..cb9aa2694aba0ae4f946ed34b8e0f6c99c1cfe44:/profiler/Profile.h diff --git a/profiler/Profile.h b/profiler/Profile.h index dd96f77..8984eaf 100644 --- a/profiler/Profile.h +++ b/profiler/Profile.h @@ -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 @@ -27,56 +27,47 @@ #define Profile_h #include "ProfileNode.h" -#include #include #include +#include namespace JSC { - class Profile : public RefCounted { - public: - static PassRefPtr create(const UString& title, unsigned uid); - virtual ~Profile(); +class JS_EXPORT_PRIVATE Profile : public RefCounted { +public: + static PassRefPtr 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 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 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 m_head; - unsigned int m_uid; - }; +private: + void removeProfileStart(); + void removeProfileEnd(); + + String m_title; + RefPtr m_head; + unsigned m_uid; + double m_idleTime; +}; } // namespace JSC