Commit 82ef9f75 authored by pfeldman's avatar pfeldman Committed by Commit bot

V8 Inspector: complete migration to the standard message level enum.

BUG=chromium:682521

Review-Url: https://codereview.chromium.org/2659913002
Cr-Commit-Position: refs/heads/master@{#42747}
parent cd96c7cc
......@@ -156,8 +156,6 @@ class V8_EXPORT V8InspectorSession {
virtual void releaseObjectGroup(const StringView&) = 0;
};
enum class V8ConsoleAPIType { kClear, kDebug, kLog, kInfo, kWarning, kError };
class V8_EXPORT V8InspectorClient {
public:
virtual ~V8InspectorClient() {}
......@@ -189,11 +187,6 @@ class V8_EXPORT V8InspectorClient {
virtual void installAdditionalCommandLineAPI(v8::Local<v8::Context>,
v8::Local<v8::Object>) {}
// Deprecated, to be replaced with v8::Isolate::MessageErrorLevel version.
virtual void consoleAPIMessage(int contextGroupId, V8ConsoleAPIType,
const StringView& message,
const StringView& url, unsigned lineNumber,
unsigned columnNumber, V8StackTrace*) {}
virtual void consoleAPIMessage(int contextGroupId,
v8::Isolate::MessageErrorLevel level,
const StringView& message,
......
......@@ -377,31 +377,19 @@ std::unique_ptr<V8ConsoleMessage> V8ConsoleMessage::createForConsoleAPI(
if (arguments.size())
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) {
clientType = V8ConsoleAPIType::kDebug;
clientLevel = v8::Isolate::kMessageDebug;
} else if (type == ConsoleAPIType::kError ||
type == ConsoleAPIType::kAssert) {
clientType = V8ConsoleAPIType::kError;
clientLevel = v8::Isolate::kMessageError;
} else if (type == ConsoleAPIType::kWarning) {
clientType = V8ConsoleAPIType::kWarning;
clientLevel = v8::Isolate::kMessageWarning;
} else if (type == ConsoleAPIType::kInfo || type == ConsoleAPIType::kLog) {
clientType = V8ConsoleAPIType::kInfo;
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),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment