| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // (or 0, if outermost.) Upon return from evaluate(), the | 95 // (or 0, if outermost.) Upon return from evaluate(), the |
| 96 // WorkerOrWorkletScriptController's ExecutionState is popped and the | 96 // WorkerOrWorkletScriptController's ExecutionState is popped and the |
| 97 // previous one restored (see above dtor.) | 97 // previous one restored (see above dtor.) |
| 98 // | 98 // |
| 99 // With Oilpan, |m_outerState| isn't traced. It'll be "up the stack" | 99 // With Oilpan, |m_outerState| isn't traced. It'll be "up the stack" |
| 100 // and its fields will be traced when scanning the stack. | 100 // and its fields will be traced when scanning the stack. |
| 101 Member<WorkerOrWorkletScriptController> m_controller; | 101 Member<WorkerOrWorkletScriptController> m_controller; |
| 102 ExecutionState* m_outerState; | 102 ExecutionState* m_outerState; |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 RawPtr<WorkerOrWorkletScriptController> WorkerOrWorkletScriptController::create(
WorkerOrWorkletGlobalScope* globalScope, v8::Isolate* isolate) | 105 WorkerOrWorkletScriptController* WorkerOrWorkletScriptController::create(WorkerO
rWorkletGlobalScope* globalScope, v8::Isolate* isolate) |
| 106 { | 106 { |
| 107 return new WorkerOrWorkletScriptController(globalScope, isolate); | 107 return new WorkerOrWorkletScriptController(globalScope, isolate); |
| 108 } | 108 } |
| 109 | 109 |
| 110 WorkerOrWorkletScriptController::WorkerOrWorkletScriptController(WorkerOrWorklet
GlobalScope* globalScope, v8::Isolate* isolate) | 110 WorkerOrWorkletScriptController::WorkerOrWorkletScriptController(WorkerOrWorklet
GlobalScope* globalScope, v8::Isolate* isolate) |
| 111 : m_globalScope(globalScope) | 111 : m_globalScope(globalScope) |
| 112 , m_isolate(isolate) | 112 , m_isolate(isolate) |
| 113 , m_executionForbidden(false) | 113 , m_executionForbidden(false) |
| 114 , m_executionScheduledToTerminate(false) | 114 , m_executionScheduledToTerminate(false) |
| 115 , m_rejectedPromises(RejectedPromises::create()) | 115 , m_rejectedPromises(RejectedPromises::create()) |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 { | 305 { |
| 306 ASSERT(m_globalScope->isContextThread()); | 306 ASSERT(m_globalScope->isContextThread()); |
| 307 return m_executionForbidden; | 307 return m_executionForbidden; |
| 308 } | 308 } |
| 309 | 309 |
| 310 void WorkerOrWorkletScriptController::disableEval(const String& errorMessage) | 310 void WorkerOrWorkletScriptController::disableEval(const String& errorMessage) |
| 311 { | 311 { |
| 312 m_disableEvalPending = errorMessage; | 312 m_disableEvalPending = errorMessage; |
| 313 } | 313 } |
| 314 | 314 |
| 315 void WorkerOrWorkletScriptController::rethrowExceptionFromImportedScript(RawPtr<
ErrorEvent> errorEvent, ExceptionState& exceptionState) | 315 void WorkerOrWorkletScriptController::rethrowExceptionFromImportedScript(ErrorEv
ent* errorEvent, ExceptionState& exceptionState) |
| 316 { | 316 { |
| 317 const String& errorMessage = errorEvent->message(); | 317 const String& errorMessage = errorEvent->message(); |
| 318 if (m_executionState) | 318 if (m_executionState) |
| 319 m_executionState->m_errorEventFromImportedScript = errorEvent; | 319 m_executionState->m_errorEventFromImportedScript = errorEvent; |
| 320 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(m_iso
late, errorMessage)); | 320 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(m_iso
late, errorMessage)); |
| 321 } | 321 } |
| 322 | 322 |
| 323 DEFINE_TRACE(WorkerOrWorkletScriptController) | 323 DEFINE_TRACE(WorkerOrWorkletScriptController) |
| 324 { | 324 { |
| 325 visitor->trace(m_globalScope); | 325 visitor->trace(m_globalScope); |
| 326 } | 326 } |
| 327 | 327 |
| 328 } // namespace blink | 328 } // namespace blink |
| OLD | NEW |