| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "bindings/core/v8/V8GCController.h" | 39 #include "bindings/core/v8/V8GCController.h" |
| 40 #include "bindings/core/v8/V8Initializer.h" | 40 #include "bindings/core/v8/V8Initializer.h" |
| 41 #include "bindings/core/v8/V8ObjectConstructor.h" | 41 #include "bindings/core/v8/V8ObjectConstructor.h" |
| 42 #include "bindings/core/v8/V8ScriptRunner.h" | 42 #include "bindings/core/v8/V8ScriptRunner.h" |
| 43 #include "bindings/core/v8/V8SharedWorkerGlobalScope.h" | 43 #include "bindings/core/v8/V8SharedWorkerGlobalScope.h" |
| 44 #include "bindings/core/v8/V8WorkerGlobalScope.h" | 44 #include "bindings/core/v8/V8WorkerGlobalScope.h" |
| 45 #include "bindings/core/v8/WrapperTypeInfo.h" | 45 #include "bindings/core/v8/WrapperTypeInfo.h" |
| 46 #include "bindings/modules/v8/V8ServiceWorkerGlobalScope.h" | 46 #include "bindings/modules/v8/V8ServiceWorkerGlobalScope.h" |
| 47 #include "core/events/ErrorEvent.h" | 47 #include "core/events/ErrorEvent.h" |
| 48 #include "core/frame/DOMTimer.h" | 48 #include "core/frame/DOMTimer.h" |
| 49 #include "core/inspector/ConsoleMessage.h" |
| 49 #include "core/inspector/ScriptCallStack.h" | 50 #include "core/inspector/ScriptCallStack.h" |
| 50 #include "core/workers/SharedWorkerGlobalScope.h" | 51 #include "core/workers/SharedWorkerGlobalScope.h" |
| 51 #include "core/workers/WorkerGlobalScope.h" | 52 #include "core/workers/WorkerGlobalScope.h" |
| 52 #include "core/workers/WorkerObjectProxy.h" | 53 #include "core/workers/WorkerObjectProxy.h" |
| 53 #include "core/workers/WorkerThread.h" | 54 #include "core/workers/WorkerThread.h" |
| 54 #include "platform/heap/ThreadState.h" | 55 #include "platform/heap/ThreadState.h" |
| 55 #include "public/platform/Platform.h" | 56 #include "public/platform/Platform.h" |
| 56 #include "public/platform/WebWorkerRunLoop.h" | 57 #include "public/platform/WebWorkerRunLoop.h" |
| 57 #include <v8.h> | 58 #include <v8.h> |
| 58 | 59 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 ErrorEvent::createSanitizedError(m_world.get()) : ErrorEvent::cr
eate(state.errorMessage, state.sourceURL, state.lineNumber, state.columnNumber,
m_world.get()); | 211 ErrorEvent::createSanitizedError(m_world.get()) : ErrorEvent::cr
eate(state.errorMessage, state.sourceURL, state.lineNumber, state.columnNumber,
m_world.get()); |
| 211 V8ErrorHandler::storeExceptionOnErrorEventWrapper(errorEvent->get(),
state.exception.v8Value(), m_scriptState->context()->Global(), m_isolate); | 212 V8ErrorHandler::storeExceptionOnErrorEventWrapper(errorEvent->get(),
state.exception.v8Value(), m_scriptState->context()->Global(), m_isolate); |
| 212 } else { | 213 } else { |
| 213 ASSERT(!m_workerGlobalScope.shouldSanitizeScriptError(state.sourceUR
L, NotSharableCrossOrigin)); | 214 ASSERT(!m_workerGlobalScope.shouldSanitizeScriptError(state.sourceUR
L, NotSharableCrossOrigin)); |
| 214 RefPtrWillBeRawPtr<ErrorEvent> event = nullptr; | 215 RefPtrWillBeRawPtr<ErrorEvent> event = nullptr; |
| 215 if (m_errorEventFromImportedScript) { | 216 if (m_errorEventFromImportedScript) { |
| 216 event = m_errorEventFromImportedScript.release(); | 217 event = m_errorEventFromImportedScript.release(); |
| 217 } else { | 218 } else { |
| 218 event = ErrorEvent::create(state.errorMessage, state.sourceURL,
state.lineNumber, state.columnNumber, m_world.get()); | 219 event = ErrorEvent::create(state.errorMessage, state.sourceURL,
state.lineNumber, state.columnNumber, m_world.get()); |
| 219 } | 220 } |
| 220 m_workerGlobalScope.reportException(event, nullptr, NotSharableCross
Origin); | 221 RefPtrWillBeRawPtr<ConsoleMessage> consoleError = ConsoleMessage::cr
eate(); |
| 222 consoleError->setMessage(event->messageForConsole()); |
| 223 consoleError->setURL(event->filename()); |
| 224 consoleError->setLineNumber(event->lineno()); |
| 225 consoleError->setColumnNumber(event->colno()); |
| 226 consoleError->setCorsStatus(NotSharableCrossOrigin); |
| 227 m_workerGlobalScope.reportException(event, consoleError.release()); |
| 221 } | 228 } |
| 222 } | 229 } |
| 223 } | 230 } |
| 224 | 231 |
| 225 void WorkerScriptController::scheduleExecutionTermination() | 232 void WorkerScriptController::scheduleExecutionTermination() |
| 226 { | 233 { |
| 227 // The mutex provides a memory barrier to ensure that once | 234 // The mutex provides a memory barrier to ensure that once |
| 228 // termination is scheduled, isExecutionTerminating will | 235 // termination is scheduled, isExecutionTerminating will |
| 229 // accurately reflect that state when called from another thread. | 236 // accurately reflect that state when called from another thread. |
| 230 { | 237 { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 258 m_disableEvalPending = errorMessage; | 265 m_disableEvalPending = errorMessage; |
| 259 } | 266 } |
| 260 | 267 |
| 261 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtrWillBe
RawPtr<ErrorEvent> errorEvent) | 268 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtrWillBe
RawPtr<ErrorEvent> errorEvent) |
| 262 { | 269 { |
| 263 m_errorEventFromImportedScript = errorEvent; | 270 m_errorEventFromImportedScript = errorEvent; |
| 264 throwError(V8ThrowException::createError(v8GeneralError, m_errorEventFromImp
ortedScript->message(), m_isolate), m_isolate); | 271 throwError(V8ThrowException::createError(v8GeneralError, m_errorEventFromImp
ortedScript->message(), m_isolate), m_isolate); |
| 265 } | 272 } |
| 266 | 273 |
| 267 } // namespace WebCore | 274 } // namespace WebCore |
| OLD | NEW |