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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1890513004: Remove dependency on the DevTools agent for console logs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reuse current console log call but removed devtools agent dependency. Created 4 years, 8 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 | « content/renderer/devtools/devtools_agent.cc ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 9c5ec1cac037061cbd3a1300bf5f7474f30f6221..6f8580a900ec987648ad7a92bc3c1ac46c473f1c 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -161,6 +161,7 @@
#include "third_party/WebKit/public/platform/WebURLResponse.h"
#include "third_party/WebKit/public/platform/WebVector.h"
#include "third_party/WebKit/public/web/WebColorSuggestion.h"
+#include "third_party/WebKit/public/web/WebConsoleMessage.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebFindOptions.h"
#include "third_party/WebKit/public/web/WebFrameSerializer.h"
@@ -2359,8 +2360,25 @@ void RenderFrameImpl::EnsureMojoBuiltinsAreAvailable(
void RenderFrameImpl::AddMessageToConsole(ConsoleMessageLevel level,
const std::string& message) {
- if (devtools_agent_)
- devtools_agent_->AddMessageToConsole(level, message);
+ blink::WebConsoleMessage::Level target_level =
+ blink::WebConsoleMessage::LevelLog;
+ switch (level) {
+ case CONSOLE_MESSAGE_LEVEL_DEBUG:
+ target_level = blink::WebConsoleMessage::LevelDebug;
+ break;
+ case CONSOLE_MESSAGE_LEVEL_LOG:
+ target_level = blink::WebConsoleMessage::LevelLog;
+ break;
+ case CONSOLE_MESSAGE_LEVEL_WARNING:
+ target_level = blink::WebConsoleMessage::LevelWarning;
+ break;
+ case CONSOLE_MESSAGE_LEVEL_ERROR:
+ target_level = blink::WebConsoleMessage::LevelError;
+ break;
+ }
+
+ blink::WebConsoleMessage wcm(target_level, WebString::fromUTF8(message));
+ frame_->addMessageToConsole(wcm);
}
bool RenderFrameImpl::IsUsingLoFi() const {
« no previous file with comments | « content/renderer/devtools/devtools_agent.cc ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698