PageConsoleClient.h [plain text]
#pragma once
#include <JavaScriptCore/ConsoleClient.h>
#include <JavaScriptCore/ScriptCallStack.h>
#include <wtf/Forward.h>
namespace Inspector {
class ConsoleMessage;
}
namespace JSC {
class ExecState;
}
namespace WebCore {
class Document;
class Page;
class WEBCORE_EXPORT PageConsoleClient final : public JSC::ConsoleClient {
WTF_MAKE_FAST_ALLOCATED;
public:
explicit PageConsoleClient(Page&);
virtual ~PageConsoleClient();
static bool shouldPrintExceptions();
static void setShouldPrintExceptions(bool);
static void mute();
static void unmute();
void addMessage(std::unique_ptr<Inspector::ConsoleMessage>&&);
void addMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<Inspector::ScriptCallStack>&& = nullptr, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0);
void addMessage(MessageSource, MessageLevel, const String& message, Ref<Inspector::ScriptCallStack>&&);
void addMessage(MessageSource, MessageLevel, const String& message, unsigned long requestIdentifier = 0, Document* = nullptr);
protected:
void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override;
void count(JSC::ExecState*, Ref<Inspector::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*, Ref<Inspector::ScriptArguments>&&) override;
void record(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override;
void recordEnd(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override;
private:
Page& m_page;
};
}