JSGlobalObjectConsoleClient.h [plain text]
#pragma once
#include "ConsoleClient.h"
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
namespace Inspector {
class InspectorConsoleAgent;
class InspectorDebuggerAgent;
class InspectorScriptProfilerAgent;
class JSGlobalObjectConsoleClient final : public JSC::ConsoleClient {
WTF_MAKE_FAST_ALLOCATED;
public:
explicit JSGlobalObjectConsoleClient(InspectorConsoleAgent*, InspectorDebuggerAgent*, InspectorScriptProfilerAgent*);
virtual ~JSGlobalObjectConsoleClient() { }
static bool logToSystemConsole();
static void setLogToSystemConsole(bool);
protected:
void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, RefPtr<ScriptArguments>&&) override;
void count(JSC::ExecState*, RefPtr<ScriptArguments>&&) override;
void profile(JSC::ExecState*, const String& title) override;
void profileEnd(JSC::ExecState*, const String& title) override;
void takeHeapSnapshot(JSC::ExecState*, const String& title) override;
void time(JSC::ExecState*, const String& title) override;
void timeEnd(JSC::ExecState*, const String& title) override;
void timeStamp(JSC::ExecState*, RefPtr<ScriptArguments>&&) override;
private:
void warnUnimplemented(const String& method);
void internalAddMessage(MessageType, MessageLevel, JSC::ExecState*, RefPtr<ScriptArguments>&&);
void startConsoleProfile();
void stopConsoleProfile();
InspectorConsoleAgent* m_consoleAgent;
InspectorDebuggerAgent* m_debuggerAgent;
InspectorScriptProfilerAgent* m_scriptProfilerAgent;
Vector<String> m_profiles;
bool m_profileRestoreBreakpointActiveValue { false };
};
}