diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/script/modulator.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/script/modulator.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/chromium/third_party/blink/renderer/core/script/modulator.cc b/chromium/third_party/blink/renderer/core/script/modulator.cc index 69c0b52742f..dfaba2eac1d 100644 --- a/chromium/third_party/blink/renderer/core/script/modulator.cc +++ b/chromium/third_party/blink/renderer/core/script/modulator.cc @@ -43,20 +43,20 @@ Modulator* Modulator::From(ScriptState* script_state) { // See comment in LocalDOMWindow::modulator_ for this workaround. LocalDOMWindow* window = document->ExecutingWindow(); window->SetModulator(modulator); - } else if (execution_context->IsWorkletGlobalScope()) { + } else if (auto* scope = DynamicTo<WorkletGlobalScope>(execution_context)) { modulator = WorkletModulatorImpl::Create(script_state); Modulator::SetModulator(script_state, modulator); // See comment in WorkerOrWorkletGlobalScope::modulator_ for this // workaround. - ToWorkletGlobalScope(execution_context)->SetModulator(modulator); - } else if (execution_context->IsWorkerGlobalScope()) { + scope->SetModulator(modulator); + } else if (auto* scope = DynamicTo<WorkerGlobalScope>(execution_context)) { modulator = WorkerModulatorImpl::Create(script_state); Modulator::SetModulator(script_state, modulator); // See comment in WorkerOrWorkletGlobalScope::modulator_ for this // workaround. - ToWorkerGlobalScope(execution_context)->SetModulator(modulator); + scope->SetModulator(modulator); } else { NOTREACHED(); } |