Chromium Code Reviews| Index: Source/core/workers/WorkerGlobalScope.cpp |
| diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp |
| index b355f28e92bcff44fba64c7b7b7406189f7e0b68..5e62870ecd83e680d3fc88443e31e25c88f33741 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,15 @@ ConsoleMessageStorage* WorkerGlobalScope::messageStorage() |
| return m_messageStorage.get(); |
| } |
| +void WorkerGlobalScope::exceptionHandled(int exceptionId, bool isHandled) |
| +{ |
| + RefPtr<ConsoleMessage> consoleMessage = m_pendingMessages.take(exceptionId); |
| + if (!isHandled) { |
| + thread()->workerReportingProxy().reportConsoleMessage(consoleMessage); |
| + addMessageToWorkerConsole(consoleMessage.release()); |
|
vsevik
2014/12/01 15:06:03
Let's call addConsoleMessage instead.
kozy
2014/12/01 16:17:05
Done.
|
| + } |
| +} |
| + |
| void WorkerGlobalScope::trace(Visitor* visitor) |
| { |
| #if ENABLE(OILPAN) |