Commit ad2731d8 authored by Devlin Cronin's avatar Devlin Cronin Committed by Commit Bot

[Blink] Retroactive nit fixes

Fix last nits from
https://chromium-review.googlesource.com/c/chromium/src/+/1501497

Bug: None
Change-Id: I845ee28bce4f9558254eb2680f976bf024f404a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1506118
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638274}
parent 924b8d11
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
#include "third_party/blink/public/web/web_console_message.h" #include "third_party/blink/public/web/web_console_message.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
namespace blink { namespace blink {
...@@ -16,8 +18,11 @@ void WebConsoleMessage::LogWebConsoleMessage(v8::Local<v8::Context> context, ...@@ -16,8 +18,11 @@ void WebConsoleMessage::LogWebConsoleMessage(v8::Local<v8::Context> context,
if (!execution_context) // Can happen in unittests. if (!execution_context) // Can happen in unittests.
return; return;
LocalFrame* frame = nullptr;
if (auto* document = DynamicTo<Document>(execution_context))
frame = document->GetFrame();
execution_context->AddConsoleMessage( execution_context->AddConsoleMessage(
ConsoleMessage::CreateFromWebConsoleMessage(message, nullptr)); ConsoleMessage::CreateFromWebConsoleMessage(message, frame));
} }
} // namespace blink } // namespace blink
...@@ -50,9 +50,8 @@ class CORE_EXPORT ConsoleMessage final ...@@ -50,9 +50,8 @@ class CORE_EXPORT ConsoleMessage final
WorkerThread*); WorkerThread*);
// Creates a ConsoleMessage from a similar WebConsoleMessage. // Creates a ConsoleMessage from a similar WebConsoleMessage.
static ConsoleMessage* CreateFromWebConsoleMessage( static ConsoleMessage* CreateFromWebConsoleMessage(const WebConsoleMessage&,
const WebConsoleMessage& message, LocalFrame*);
LocalFrame* local_frame);
ConsoleMessage(MessageSource, ConsoleMessage(MessageSource,
mojom::ConsoleMessageLevel, mojom::ConsoleMessageLevel,
......
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