| 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/IDLTypes.h" | 7 #include "bindings/core/v8/IDLTypes.h" |
| 8 #include "bindings/core/v8/NativeValueTraitsImpl.h" | 8 #include "bindings/core/v8/NativeValueTraitsImpl.h" |
| 9 #include "bindings/core/v8/ToV8ForCore.h" | 9 #include "bindings/core/v8/ToV8ForCore.h" |
| 10 #include "bindings/core/v8/V8BindingForCore.h" | 10 #include "bindings/core/v8/V8BindingForCore.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // constructor() and process() functions are successfully parsed from the | 114 // constructor() and process() functions are successfully parsed from the |
| 115 // script code, thus create the definition. The rest of parsing process | 115 // script code, thus create the definition. The rest of parsing process |
| 116 // (i.e. parameterDescriptors) is optional. | 116 // (i.e. parameterDescriptors) is optional. |
| 117 AudioWorkletProcessorDefinition* definition = | 117 AudioWorkletProcessorDefinition* definition = |
| 118 AudioWorkletProcessorDefinition::Create( | 118 AudioWorkletProcessorDefinition::Create( |
| 119 isolate, name, class_definition_local, process_function_local); | 119 isolate, name, class_definition_local, process_function_local); |
| 120 DCHECK(definition); | 120 DCHECK(definition); |
| 121 | 121 |
| 122 v8::Local<v8::Value> parameter_descriptors_value_local; | 122 v8::Local<v8::Value> parameter_descriptors_value_local; |
| 123 bool did_get_parameter_descriptor = | 123 bool did_get_parameter_descriptor = |
| 124 class_definition_local->Get(context, | 124 class_definition_local |
| 125 V8String(isolate, "parameterDescriptors")) | 125 ->Get(context, V8String(isolate, "parameterDescriptors")) |
| 126 .ToLocal(¶meter_descriptors_value_local); | 126 .ToLocal(¶meter_descriptors_value_local); |
| 127 | 127 |
| 128 // If parameterDescriptor() is parsed and has a valid value, create a vector | 128 // If parameterDescriptor() is parsed and has a valid value, create a vector |
| 129 // of |AudioParamDescriptor| and pass it to the definition. | 129 // of |AudioParamDescriptor| and pass it to the definition. |
| 130 if (did_get_parameter_descriptor && | 130 if (did_get_parameter_descriptor && |
| 131 !parameter_descriptors_value_local->IsNullOrUndefined()) { | 131 !parameter_descriptors_value_local->IsNullOrUndefined()) { |
| 132 HeapVector<AudioParamDescriptor> audio_param_descriptors = | 132 HeapVector<AudioParamDescriptor> audio_param_descriptors = |
| 133 NativeValueTraits<IDLSequence<AudioParamDescriptor>>::NativeValue( | 133 NativeValueTraits<IDLSequence<AudioParamDescriptor>>::NativeValue( |
| 134 isolate, parameter_descriptors_value_local, exception_state); | 134 isolate, parameter_descriptors_value_local, exception_state); |
| 135 | 135 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 for (auto definition : processor_definition_map_) | 221 for (auto definition : processor_definition_map_) |
| 222 visitor->TraceWrappers(definition.value); | 222 visitor->TraceWrappers(definition.value); |
| 223 | 223 |
| 224 for (auto processor : processor_instances_) | 224 for (auto processor : processor_instances_) |
| 225 visitor->TraceWrappers(processor); | 225 visitor->TraceWrappers(processor); |
| 226 | 226 |
| 227 ThreadedWorkletGlobalScope::TraceWrappers(visitor); | 227 ThreadedWorkletGlobalScope::TraceWrappers(visitor); |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace blink | 230 } // namespace blink |
| OLD | NEW |