| Index: third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
|
| diff --git a/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp b/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
|
| index 8f7d53f68da6255f6cd2f1f92f758ed886094ff9..80129d3d546136f46fb6788412a1e793e986bc38 100644
|
| --- a/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
|
| +++ b/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
|
| @@ -31,7 +31,10 @@
|
| #include "core/inspector/WorkerThreadDebugger.h"
|
|
|
| #include "bindings/core/v8/ScriptState.h"
|
| +#include "bindings/core/v8/SourceLocation.h"
|
| #include "bindings/core/v8/V8ScriptRunner.h"
|
| +#include "core/inspector/ConsoleMessage.h"
|
| +#include "core/workers/WorkerReportingProxy.h"
|
| #include "core/workers/WorkerThread.h"
|
| #include <v8.h>
|
|
|
| @@ -89,21 +92,18 @@ bool WorkerThreadDebugger::callingContextCanAccessContext(v8::Local<v8::Context>
|
| return true;
|
| }
|
|
|
| -int WorkerThreadDebugger::ensureDefaultContextInGroup(int contextGroupId)
|
| +v8::Local<v8::Context> WorkerThreadDebugger::ensureDefaultContextInGroup(int contextGroupId)
|
| {
|
| ASSERT(contextGroupId == workerContextGroupId);
|
| ScriptState* scriptState = m_workerThread->workerGlobalScope()->scriptController()->getScriptState();
|
| - if (!scriptState)
|
| - return 0;
|
| - v8::HandleScope scopes(scriptState->isolate());
|
| - return V8Debugger::contextId(scriptState->context());
|
| + return scriptState ? scriptState->context() : v8::Local<v8::Context>();
|
| }
|
|
|
| -void WorkerThreadDebugger::reportMessageToConsole(v8::Local<v8::Context> context, ConsoleMessage* message)
|
| +void WorkerThreadDebugger::messageAddedToConsole(int contextGroupId, MessageSource source, MessageLevel level, const String16& message, const String16& url, unsigned lineNumber, unsigned columnNumber, V8StackTrace* stackTrace)
|
| {
|
| - ExecutionContext* executionContext = toExecutionContext(context);
|
| - ASSERT(executionContext->isWorkerGlobalScope());
|
| - executionContext->addConsoleMessage(message);
|
| + DCHECK(contextGroupId == workerContextGroupId);
|
| + ConsoleMessage* consoleMessage = ConsoleMessage::create(source, level, message, SourceLocation::create(url, lineNumber, columnNumber, stackTrace ? stackTrace->clone() : nullptr, 0));
|
| + m_workerThread->workerReportingProxy().reportConsoleMessage(consoleMessage);
|
| }
|
|
|
| v8::MaybeLocal<v8::Value> WorkerThreadDebugger::memoryInfo(v8::Isolate*, v8::Local<v8::Context>)
|
|
|