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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 public: | 59 public: |
60 explicit ExecutionState(WorkerOrWorkletScriptController* controller) | 60 explicit ExecutionState(WorkerOrWorkletScriptController* controller) |
61 : hadException(false), | 61 : hadException(false), |
62 m_controller(controller), | 62 m_controller(controller), |
63 m_outerState(controller->m_executionState) { | 63 m_outerState(controller->m_executionState) { |
64 m_controller->m_executionState = this; | 64 m_controller->m_executionState = this; |
65 } | 65 } |
66 | 66 |
67 ~ExecutionState() { m_controller->m_executionState = m_outerState; } | 67 ~ExecutionState() { m_controller->m_executionState = m_outerState; } |
68 | 68 |
69 DEFINE_INLINE_TRACE() { | |
70 visitor->trace(m_errorEventFromImportedScript); | |
71 visitor->trace(m_controller); | |
72 } | |
73 | |
74 bool hadException; | 69 bool hadException; |
75 String errorMessage; | 70 String errorMessage; |
76 std::unique_ptr<SourceLocation> m_location; | 71 std::unique_ptr<SourceLocation> m_location; |
77 ScriptValue exception; | 72 ScriptValue exception; |
78 Member<ErrorEvent> m_errorEventFromImportedScript; | 73 Member<ErrorEvent> m_errorEventFromImportedScript; |
79 | 74 |
80 // A ExecutionState context is stack allocated by | 75 // A ExecutionState context is stack allocated by |
81 // WorkerOrWorkletScriptController::evaluate(), with the contoller using it | 76 // WorkerOrWorkletScriptController::evaluate(), with the contoller using it |
82 // during script evaluation. To handle nested evaluate() uses, | 77 // during script evaluation. To handle nested evaluate() uses, |
83 // ExecutionStates are chained together; | 78 // ExecutionStates are chained together; |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 m_executionState->m_errorEventFromImportedScript = errorEvent; | 352 m_executionState->m_errorEventFromImportedScript = errorEvent; |
358 exceptionState.rethrowV8Exception( | 353 exceptionState.rethrowV8Exception( |
359 V8ThrowException::createError(m_isolate, errorMessage)); | 354 V8ThrowException::createError(m_isolate, errorMessage)); |
360 } | 355 } |
361 | 356 |
362 DEFINE_TRACE(WorkerOrWorkletScriptController) { | 357 DEFINE_TRACE(WorkerOrWorkletScriptController) { |
363 visitor->trace(m_globalScope); | 358 visitor->trace(m_globalScope); |
364 } | 359 } |
365 | 360 |
366 } // namespace blink | 361 } // namespace blink |
OLD | NEW |