| 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 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" | 31 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" |
| 32 | 32 |
| 33 #include "bindings/core/v8/ScriptCallStack.h" | |
| 34 #include "bindings/core/v8/ScriptController.h" | 33 #include "bindings/core/v8/ScriptController.h" |
| 35 #include "bindings/core/v8/ScriptSourceCode.h" | 34 #include "bindings/core/v8/ScriptSourceCode.h" |
| 36 #include "bindings/core/v8/ScriptValue.h" | 35 #include "bindings/core/v8/ScriptValue.h" |
| 36 #include "bindings/core/v8/SourceLocation.h" |
| 37 #include "bindings/core/v8/V8DedicatedWorkerGlobalScope.h" | 37 #include "bindings/core/v8/V8DedicatedWorkerGlobalScope.h" |
| 38 #include "bindings/core/v8/V8ErrorHandler.h" | 38 #include "bindings/core/v8/V8ErrorHandler.h" |
| 39 #include "bindings/core/v8/V8Initializer.h" | 39 #include "bindings/core/v8/V8Initializer.h" |
| 40 #include "bindings/core/v8/V8ObjectConstructor.h" | 40 #include "bindings/core/v8/V8ObjectConstructor.h" |
| 41 #include "bindings/core/v8/V8ScriptRunner.h" | 41 #include "bindings/core/v8/V8ScriptRunner.h" |
| 42 #include "bindings/core/v8/V8SharedWorkerGlobalScope.h" | 42 #include "bindings/core/v8/V8SharedWorkerGlobalScope.h" |
| 43 #include "bindings/core/v8/V8WorkerGlobalScope.h" | 43 #include "bindings/core/v8/V8WorkerGlobalScope.h" |
| 44 #include "bindings/core/v8/WrapperTypeInfo.h" | 44 #include "bindings/core/v8/WrapperTypeInfo.h" |
| 45 #include "core/events/ErrorEvent.h" | 45 #include "core/events/ErrorEvent.h" |
| 46 #include "core/frame/DOMTimer.h" | 46 #include "core/frame/DOMTimer.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 else | 276 else |
| 277 *errorEvent = ErrorEvent::create(state.errorMessage, state.sourc
eURL, state.lineNumber, state.columnNumber, m_world.get()); | 277 *errorEvent = ErrorEvent::create(state.errorMessage, state.sourc
eURL, state.lineNumber, state.columnNumber, m_world.get()); |
| 278 V8ErrorHandler::storeExceptionOnErrorEventWrapper(m_scriptState.get(
), *errorEvent, state.exception.v8Value(), m_scriptState->context()->Global()); | 278 V8ErrorHandler::storeExceptionOnErrorEventWrapper(m_scriptState.get(
), *errorEvent, state.exception.v8Value(), m_scriptState->context()->Global()); |
| 279 } else { | 279 } else { |
| 280 ASSERT(!m_globalScope->shouldSanitizeScriptError(state.sourceURL, No
tSharableCrossOrigin)); | 280 ASSERT(!m_globalScope->shouldSanitizeScriptError(state.sourceURL, No
tSharableCrossOrigin)); |
| 281 ErrorEvent* event = nullptr; | 281 ErrorEvent* event = nullptr; |
| 282 if (state.m_errorEventFromImportedScript) | 282 if (state.m_errorEventFromImportedScript) |
| 283 event = state.m_errorEventFromImportedScript.release(); | 283 event = state.m_errorEventFromImportedScript.release(); |
| 284 else | 284 else |
| 285 event = ErrorEvent::create(state.errorMessage, state.sourceURL,
state.lineNumber, state.columnNumber, m_world.get()); | 285 event = ErrorEvent::create(state.errorMessage, state.sourceURL,
state.lineNumber, state.columnNumber, m_world.get()); |
| 286 m_globalScope->reportException(event, 0, nullptr, NotSharableCrossOr
igin); | 286 m_globalScope->reportException(event, SourceLocation::create(event->
filename(), event->lineno(), event->colno(), nullptr), NotSharableCrossOrigin); |
| 287 } | 287 } |
| 288 return false; | 288 return false; |
| 289 } | 289 } |
| 290 return true; | 290 return true; |
| 291 } | 291 } |
| 292 | 292 |
| 293 void WorkerOrWorkletScriptController::willScheduleExecutionTermination() | 293 void WorkerOrWorkletScriptController::willScheduleExecutionTermination() |
| 294 { | 294 { |
| 295 // The mutex provides a memory barrier to ensure that once | 295 // The mutex provides a memory barrier to ensure that once |
| 296 // termination is scheduled, isExecutionTerminating will | 296 // termination is scheduled, isExecutionTerminating will |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 m_executionState->m_errorEventFromImportedScript = errorEvent; | 330 m_executionState->m_errorEventFromImportedScript = errorEvent; |
| 331 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(m_iso
late, errorMessage)); | 331 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(m_iso
late, errorMessage)); |
| 332 } | 332 } |
| 333 | 333 |
| 334 DEFINE_TRACE(WorkerOrWorkletScriptController) | 334 DEFINE_TRACE(WorkerOrWorkletScriptController) |
| 335 { | 335 { |
| 336 visitor->trace(m_globalScope); | 336 visitor->trace(m_globalScope); |
| 337 } | 337 } |
| 338 | 338 |
| 339 } // namespace blink | 339 } // namespace blink |
| OLD | NEW |