示例#1
0
void FrameConsole::addMessageFromWorker(
    MessageLevel level,
    const String& message,
    std::unique_ptr<SourceLocation> location,
    const String& workerId) {
  reportMessageToClient(WorkerMessageSource, level, message, location.get());
  addMessageToStorage(ConsoleMessage::createFromWorker(
      level, message, std::move(location), workerId));
}
示例#2
0
void ConsoleBase::internalAddMessage(MessageType type, MessageLevel level, ScriptState* state, PassRefPtr<ScriptArguments> scriptArguments, bool acceptNoArguments, bool printTrace)
{
    if (!context())
        return;

    RefPtr<ScriptArguments> arguments = scriptArguments;
    if (!acceptNoArguments && !arguments->argumentCount())
        return;

    size_t stackSize = printTrace ? ScriptCallStack::maxCallStackSizeToCapture : 1;
    RefPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(stackSize));

    String message;
    bool gotStringMessage = arguments->getFirstArgumentAsString(message);
    InspectorInstrumentation::addMessageToConsole(context(), ConsoleAPIMessageSource, type, level, message, state, arguments);
    if (gotStringMessage)
        reportMessageToClient(level, message, callStack);
}
示例#3
0
void FrameConsole::addMessage(ConsoleMessage* consoleMessage) {
  if (addMessageToStorage(consoleMessage))
    reportMessageToClient(consoleMessage->source(), consoleMessage->level(),
                          consoleMessage->message(),
                          consoleMessage->location());
}