| Index: Source/core/workers/WorkerGlobalScope.cpp
|
| diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp
|
| index b355f28e92bcff44fba64c7b7b7406189f7e0b68..588bf496b6621328c21ed12e5d22f4f75cf6145c 100644
|
| --- a/Source/core/workers/WorkerGlobalScope.cpp
|
| +++ b/Source/core/workers/WorkerGlobalScope.cpp
|
| @@ -60,6 +60,14 @@
|
| #include "platform/weborigin/SecurityOrigin.h"
|
| #include "public/platform/WebURLRequest.h"
|
|
|
| +namespace {
|
| + unsigned long createWorkerExceptionUniqueIdentifier()
|
| + {
|
| + static unsigned long s_workerExceptionUniqueIdentifier = 0;
|
| + return ++s_workerExceptionUniqueIdentifier;
|
| + }
|
| +}
|
| +
|
| namespace blink {
|
|
|
| class CloseWorkerGlobalScopeTask : public ExecutionContextTask {
|
| @@ -267,9 +275,14 @@ EventTarget* WorkerGlobalScope::errorEventTarget()
|
| return this;
|
| }
|
|
|
| -void WorkerGlobalScope::logExceptionToConsole(const String& errorMessage, int, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallStack>)
|
| +void WorkerGlobalScope::logExceptionToConsole(const String& errorMessage, int, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack)
|
| {
|
| - thread()->workerReportingProxy().reportException(errorMessage, lineNumber, columnNumber, sourceURL);
|
| + unsigned long exceptionId = createWorkerExceptionUniqueIdentifier();
|
| + RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber);
|
| + consoleMessage->setCallStack(callStack);
|
| + m_pendingMessages.set(exceptionId, consoleMessage);
|
| +
|
| + thread()->workerReportingProxy().reportException(errorMessage, lineNumber, columnNumber, sourceURL, exceptionId);
|
| }
|
|
|
| void WorkerGlobalScope::reportBlockedScriptExecutionToInspector(const String& directiveText)
|
| @@ -329,6 +342,13 @@ ConsoleMessageStorage* WorkerGlobalScope::messageStorage()
|
| return m_messageStorage.get();
|
| }
|
|
|
| +void WorkerGlobalScope::exceptionHandled(int exceptionId, bool isHandled)
|
| +{
|
| + RefPtr<ConsoleMessage> consoleMessage = m_pendingMessages.take(exceptionId);
|
| + if (!isHandled)
|
| + addConsoleMessage(consoleMessage.release());
|
| +}
|
| +
|
| void WorkerGlobalScope::trace(Visitor* visitor)
|
| {
|
| #if ENABLE(OILPAN)
|
|
|