This source file includes following definitions.
- context
- reportMessageToClient
- memory
#include "config.h"
#include "core/frame/Console.h"
#include "bindings/v8/ScriptCallStackFactory.h"
#include "core/frame/ConsoleTypes.h"
#include "core/frame/FrameHost.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/PageConsole.h"
#include "core/inspector/ConsoleAPITypes.h"
#include "core/inspector/ScriptArguments.h"
#include "core/inspector/ScriptCallStack.h"
#include "core/page/Chrome.h"
#include "core/page/ChromeClient.h"
#include "core/timing/MemoryInfo.h"
#include "platform/TraceEvent.h"
#include "wtf/text/CString.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
Console::Console(LocalFrame* frame)
: DOMWindowProperty(frame)
{
ScriptWrappable::init(this);
}
Console::~Console()
{
}
ExecutionContext* Console::context()
{
if (!m_frame)
return 0;
return m_frame->document();
}
void Console::reportMessageToClient(MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> callStack)
{
if (!m_frame || !m_frame->host() || !callStack.get())
return;
String stackTrace;
if (m_frame->host()->chrome().client().shouldReportDetailedMessageForSource(callStack->at(0).sourceURL())) {
RefPtr<ScriptCallStack> fullStack = createScriptCallStack(ScriptCallStack::maxCallStackSizeToCapture);
stackTrace = PageConsole::formatStackTraceString(message, fullStack);
}
m_frame->host()->chrome().client().addMessageToConsole(ConsoleAPIMessageSource, level, message, callStack->at(0).lineNumber(), callStack->at(0).sourceURL(), stackTrace);
}
PassRefPtrWillBeRawPtr<MemoryInfo> Console::memory() const
{
return MemoryInfo::create(m_frame);
}
}