Index: Source/core/workers/WorkerMessagingProxy.cpp |
diff --git a/Source/core/workers/WorkerMessagingProxy.cpp b/Source/core/workers/WorkerMessagingProxy.cpp |
index 081a68272cb06abb18d032731482785d41c54941..77d81832c90d86572f35b82f64d570604b0feae4 100644 |
--- a/Source/core/workers/WorkerMessagingProxy.cpp |
+++ b/Source/core/workers/WorkerMessagingProxy.cpp |
@@ -33,8 +33,10 @@ |
#include "core/dom/Document.h" |
#include "core/events/ErrorEvent.h" |
#include "core/events/MessageEvent.h" |
+#include "core/frame/Console.h" |
#include "core/frame/LocalDOMWindow.h" |
#include "core/frame/csp/ContentSecurityPolicy.h" |
+#include "core/inspector/InspectorConsoleInstrumentation.h" |
#include "core/inspector/InspectorInstrumentation.h" |
#include "core/inspector/ScriptCallStack.h" |
#include "core/inspector/WorkerDebuggerAgent.h" |
@@ -176,7 +178,15 @@ void WorkerMessagingProxy::reportConsoleMessage(MessageSource source, MessageLev |
{ |
if (m_askedToTerminate) |
return; |
- m_executionContext->addConsoleMessage(ConsoleMessage::create(source, level, message, sourceURL, lineNumber)); |
+ |
+ // FIXME: In case of nested workers, this should go directly to the root Document context. |
+ ASSERT(m_executionContext->isDocument()); |
+ Document* document = toDocument(m_executionContext.get()); |
+ LocalDOMWindow* domWindow = document->domWindow(); |
+ if (!domWindow) |
+ return; |
vsevik
2014/08/12 14:25:13
Let's use something like pseudo code below:
Conso
sergeyv
2014/08/12 15:37:53
Done.
|
+ domWindow->console().reportMessageToClient(level, message, nullptr); |
+ InspectorInstrumentation::addMessageToConsoleFromWorker(m_executionContext.get(), this, ConsoleMessage::create(source, level, message, sourceURL, lineNumber).get()); |
} |
void WorkerMessagingProxy::workerThreadCreated(PassRefPtr<DedicatedWorkerThread> workerThread) |