Chromium Code Reviews| Index: src/inspector/v8-console-message.cc |
| diff --git a/src/inspector/v8-console-message.cc b/src/inspector/v8-console-message.cc |
| index e37738ebe43954f5591dc0d9d3b0268ad2f61108..8a6981579ef7158752d6d8ee7389bfaa2f0a9af5 100644 |
| --- a/src/inspector/v8-console-message.cc |
| +++ b/src/inspector/v8-console-message.cc |
| @@ -50,9 +50,9 @@ String16 consoleAPITypeValue(ConsoleAPIType type) { |
| case ConsoleAPIType::kAssert: |
| return protocol::Runtime::ConsoleAPICalled::TypeEnum::Assert; |
| case ConsoleAPIType::kTimeEnd: |
| - return protocol::Runtime::ConsoleAPICalled::TypeEnum::Debug; |
| + return protocol::Runtime::ConsoleAPICalled::TypeEnum::TimeEnd; |
| case ConsoleAPIType::kCount: |
| - return protocol::Runtime::ConsoleAPICalled::TypeEnum::Debug; |
| + return protocol::Runtime::ConsoleAPICalled::TypeEnum::Count; |
| } |
| return protocol::Runtime::ConsoleAPICalled::TypeEnum::Log; |
| } |
| @@ -378,22 +378,36 @@ std::unique_ptr<V8ConsoleMessage> V8ConsoleMessage::createForConsoleAPI( |
| message->m_message = V8ValueStringBuilder::toString(arguments[0], context); |
| V8ConsoleAPIType clientType = V8ConsoleAPIType::kLog; |
| + v8::Isolate::MessageErrorLevel clientLevel = v8::Isolate::kMessageInfo; |
| if (type == ConsoleAPIType::kDebug || type == ConsoleAPIType::kCount || |
| - type == ConsoleAPIType::kTimeEnd) |
| + type == ConsoleAPIType::kTimeEnd) { |
| clientType = V8ConsoleAPIType::kDebug; |
| - else if (type == ConsoleAPIType::kError || type == ConsoleAPIType::kAssert) |
| + clientLevel = v8::Isolate::kMessageDebug; |
| + } else if (type == ConsoleAPIType::kError || type == ConsoleAPIType::kAssert) { |
| clientType = V8ConsoleAPIType::kError; |
| - else if (type == ConsoleAPIType::kWarning) |
| + clientLevel = v8::Isolate::kMessageError; |
| + } else if (type == ConsoleAPIType::kWarning) { |
| clientType = V8ConsoleAPIType::kWarning; |
| - else if (type == ConsoleAPIType::kInfo) |
| + clientLevel = v8::Isolate::kMessageWarning; |
| + } else if (type == ConsoleAPIType::kInfo || type == ConsoleAPIType::kLog) { |
| clientType = V8ConsoleAPIType::kInfo; |
|
dgozman
2017/01/24 23:07:23
You are now reporting kInfo for console.log. That'
|
| - else if (type == ConsoleAPIType::kClear) |
| + clientLevel = v8::Isolate::kMessageInfo; |
| + } else if (type == ConsoleAPIType::kClear) { |
| clientType = V8ConsoleAPIType::kClear; |
| + } |
| + |
| inspector->client()->consoleAPIMessage( |
| contextGroupId, clientType, toStringView(message->m_message), |
| toStringView(message->m_url), message->m_lineNumber, |
| message->m_columnNumber, message->m_stackTrace.get()); |
| + if (type != ConsoleAPIType::kClear) { |
| + inspector->client()->consoleAPIMessage( |
| + contextGroupId, clientLevel, toStringView(message->m_message), |
| + toStringView(message->m_url), message->m_lineNumber, |
| + message->m_columnNumber, message->m_stackTrace.get()); |
| + } |
| + |
| return message; |
| } |