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 m_workerGlobalScope.reportException(event, ConsoleMessage::create(JS
MessageSource, ErrorMessageLevel, event->messageForConsole(), event->filename(),
event->lineno(), event->colno())); |
221 } | 222 } |
222 } | 223 } |
223 } | 224 } |
224 | 225 |
225 void WorkerScriptController::scheduleExecutionTermination() | 226 void WorkerScriptController::scheduleExecutionTermination() |
226 { | 227 { |
227 // The mutex provides a memory barrier to ensure that once | 228 // The mutex provides a memory barrier to ensure that once |
228 // termination is scheduled, isExecutionTerminating will | 229 // termination is scheduled, isExecutionTerminating will |
229 // accurately reflect that state when called from another thread. | 230 // accurately reflect that state when called from another thread. |
230 { | 231 { |
(...skipping 27 matching lines...) Expand all Loading... |
258 m_disableEvalPending = errorMessage; | 259 m_disableEvalPending = errorMessage; |
259 } | 260 } |
260 | 261 |
261 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtrWillBe
RawPtr<ErrorEvent> errorEvent) | 262 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtrWillBe
RawPtr<ErrorEvent> errorEvent) |
262 { | 263 { |
263 m_errorEventFromImportedScript = errorEvent; | 264 m_errorEventFromImportedScript = errorEvent; |
264 throwError(V8ThrowException::createError(v8GeneralError, m_errorEventFromImp
ortedScript->message(), m_isolate), m_isolate); | 265 throwError(V8ThrowException::createError(v8GeneralError, m_errorEventFromImp
ortedScript->message(), m_isolate), m_isolate); |
265 } | 266 } |
266 | 267 |
267 } // namespace WebCore | 268 } // namespace WebCore |
OLD | NEW |