OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/webaudio/AudioWorkletGlobalScope.h" | 5 #include "modules/webaudio/AudioWorkletGlobalScope.h" |
6 | 6 |
7 #include "bindings/core/v8/ToV8ForCore.h" | 7 #include "bindings/core/v8/ToV8ForCore.h" |
8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
9 #include "bindings/core/v8/V8BindingMacros.h" | 9 #include "bindings/core/v8/V8BindingMacros.h" |
10 #include "bindings/core/v8/V8ObjectConstructor.h" | 10 #include "bindings/core/v8/V8ObjectConstructor.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // TODO(hongchan): Catch exceptions thrown in the process method. The verbose | 167 // TODO(hongchan): Catch exceptions thrown in the process method. The verbose |
168 // options forces the TryCatch object to save the exception location. The | 168 // options forces the TryCatch object to save the exception location. The |
169 // pending exception should be handled later. | 169 // pending exception should be handled later. |
170 v8::TryCatch block(isolate); | 170 v8::TryCatch block(isolate); |
171 block.SetVerbose(true); | 171 block.SetVerbose(true); |
172 | 172 |
173 // Perform JS function process() in AudioWorkletProcessor instance. The actual | 173 // Perform JS function process() in AudioWorkletProcessor instance. The actual |
174 // V8 operation happens here to make the AudioWorkletProcessor class a thin | 174 // V8 operation happens here to make the AudioWorkletProcessor class a thin |
175 // wrapper of v8::Object instance. | 175 // wrapper of v8::Object instance. |
176 V8ScriptRunner::CallFunction( | 176 V8ScriptRunner::CallFunction( |
177 definition->ProcessLocal(isolate), script_state->GetExecutionContext(), | 177 definition->ProcessLocal(isolate), ExecutionContext::From(script_state), |
178 processor->InstanceLocal(isolate), WTF_ARRAY_LENGTH(argv), argv, isolate); | 178 processor->InstanceLocal(isolate), WTF_ARRAY_LENGTH(argv), argv, isolate); |
179 | 179 |
180 return !block.HasCaught(); | 180 return !block.HasCaught(); |
181 } | 181 } |
182 | 182 |
183 AudioWorkletProcessorDefinition* AudioWorkletGlobalScope::FindDefinition( | 183 AudioWorkletProcessorDefinition* AudioWorkletGlobalScope::FindDefinition( |
184 const String& name) { | 184 const String& name) { |
185 return processor_definition_map_.at(name); | 185 return processor_definition_map_.at(name); |
186 } | 186 } |
187 | 187 |
188 DEFINE_TRACE(AudioWorkletGlobalScope) { | 188 DEFINE_TRACE(AudioWorkletGlobalScope) { |
189 visitor->Trace(processor_definition_map_); | 189 visitor->Trace(processor_definition_map_); |
190 visitor->Trace(processor_instances_); | 190 visitor->Trace(processor_instances_); |
191 ThreadedWorkletGlobalScope::Trace(visitor); | 191 ThreadedWorkletGlobalScope::Trace(visitor); |
192 } | 192 } |
193 | 193 |
194 } // namespace blink | 194 } // namespace blink |
OLD | NEW |