ProfileGenerator.h [plain text]
#ifndef ProfileGenerator_h
#define ProfileGenerator_h
#include "Profile.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
namespace JSC {
class ExecState;
class JSGlobalObject;
class Profile;
class ProfileNode;
struct CallIdentifier;
class ProfileGenerator : public RefCounted<ProfileGenerator> {
public:
static PassRefPtr<ProfileGenerator> create(ExecState*, const WTF::String& title, unsigned uid);
const WTF::String& title() const;
PassRefPtr<Profile> profile() const { return m_profile; }
JSGlobalObject* origin() const { return m_origin; }
unsigned profileGroup() const { return m_profileGroup; }
void willExecute(ExecState* callerCallFrame, const CallIdentifier&);
void didExecute(ExecState* callerCallFrame, const CallIdentifier&);
void exceptionUnwind(ExecState* handlerCallFrame, const CallIdentifier&);
void stopProfiling();
typedef void (ProfileGenerator::*ProfileFunction)(ExecState* callerOrHandlerCallFrame, const CallIdentifier& callIdentifier);
private:
ProfileGenerator(ExecState*, const WTF::String& title, unsigned uid);
void addParentForConsoleStart(ExecState*);
void removeProfileStart();
void removeProfileEnd();
RefPtr<Profile> m_profile;
JSGlobalObject* m_origin;
unsigned m_profileGroup;
RefPtr<ProfileNode> m_head;
RefPtr<ProfileNode> m_currentNode;
bool m_foundConsoleStartParent;
};
}
#endif // ProfileGenerator_h