Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(866)

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8ConsoleMessage.cpp

Issue 2245283002: [DevTools] Send correct message level in deprecated Console domain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/v8_inspector/V8ConsoleMessage.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8ConsoleMessage.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8ConsoleMessage.cpp
index d6cfe135073f407bc5cb4745e0b8c2106531d361..761d64b5f4e0b0b41fbda6e48377ec65f8738825 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8ConsoleMessage.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8ConsoleMessage.cpp
@@ -203,10 +203,19 @@ void V8ConsoleMessage::setLocation(const String16& url, unsigned lineNumber, uns
void V8ConsoleMessage::reportToFrontend(protocol::Console::Frontend* frontend) const
{
DCHECK(m_origin == V8MessageOrigin::kConsole);
+ String16 level = protocol::Console::ConsoleMessage::LevelEnum::Log;
+ if (m_type == ConsoleAPIType::kDebug || m_type == ConsoleAPIType::kCount || m_type == ConsoleAPIType::kTimeEnd)
+ level = protocol::Console::ConsoleMessage::LevelEnum::Debug;
+ else if (m_type == ConsoleAPIType::kError || m_type == ConsoleAPIType::kAssert)
+ level = protocol::Console::ConsoleMessage::LevelEnum::Error;
+ else if (m_type == ConsoleAPIType::kWarning)
+ level = protocol::Console::ConsoleMessage::LevelEnum::Warning;
+ else if (m_type == ConsoleAPIType::kInfo)
+ level = protocol::Console::ConsoleMessage::LevelEnum::Info;
std::unique_ptr<protocol::Console::ConsoleMessage> result =
protocol::Console::ConsoleMessage::create()
.setSource(protocol::Console::ConsoleMessage::SourceEnum::ConsoleApi)
- .setLevel(protocol::Console::ConsoleMessage::LevelEnum::Log)
+ .setLevel(level)
.setText(m_message)
.build();
result->setLine(static_cast<int>(m_lineNumber));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698