| OLD | NEW | 
|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/AudioWorkletProcessorDefinition.h" | 5 #include "modules/webaudio/AudioWorkletProcessorDefinition.h" | 
| 6 | 6 | 
| 7 namespace blink { | 7 namespace blink { | 
| 8 | 8 | 
| 9 AudioWorkletProcessorDefinition* AudioWorkletProcessorDefinition::Create( | 9 AudioWorkletProcessorDefinition* AudioWorkletProcessorDefinition::Create( | 
| 10     v8::Isolate* isolate, | 10     v8::Isolate* isolate, | 
| (...skipping 26 matching lines...) Expand all  Loading... | 
| 37     v8::Isolate* isolate) { | 37     v8::Isolate* isolate) { | 
| 38   DCHECK(!IsMainThread()); | 38   DCHECK(!IsMainThread()); | 
| 39   return process_.NewLocal(isolate); | 39   return process_.NewLocal(isolate); | 
| 40 } | 40 } | 
| 41 | 41 | 
| 42 void AudioWorkletProcessorDefinition::SetAudioParamDescriptors( | 42 void AudioWorkletProcessorDefinition::SetAudioParamDescriptors( | 
| 43     const HeapVector<AudioParamDescriptor>& descriptors) { | 43     const HeapVector<AudioParamDescriptor>& descriptors) { | 
| 44   audio_param_descriptors_ = descriptors; | 44   audio_param_descriptors_ = descriptors; | 
| 45 } | 45 } | 
| 46 | 46 | 
|  | 47 const HeapVector<AudioParamDescriptor>& | 
|  | 48     AudioWorkletProcessorDefinition::GetAudioParamDescriptors() const { | 
|  | 49   return audio_param_descriptors_; | 
|  | 50 } | 
|  | 51 | 
| 47 const Vector<String> | 52 const Vector<String> | 
| 48     AudioWorkletProcessorDefinition::GetAudioParamDescriptorNames() const { | 53     AudioWorkletProcessorDefinition::GetAudioParamDescriptorNames() const { | 
| 49   Vector<String> names; | 54   Vector<String> names; | 
| 50   for (const auto& descriptor : audio_param_descriptors_) { | 55   for (const auto& descriptor : audio_param_descriptors_) { | 
| 51     names.push_back(descriptor.name()); | 56     names.push_back(descriptor.name()); | 
| 52   } | 57   } | 
| 53   return names; | 58   return names; | 
| 54 } | 59 } | 
| 55 | 60 | 
| 56 const AudioParamDescriptor* | 61 const AudioParamDescriptor* | 
| 57     AudioWorkletProcessorDefinition::GetAudioParamDescriptor ( | 62     AudioWorkletProcessorDefinition::GetAudioParamDescriptor ( | 
| 58         const String& key) const { | 63         const String& key) const { | 
| 59   for (const auto& descriptor : audio_param_descriptors_) { | 64   for (const auto& descriptor : audio_param_descriptors_) { | 
| 60     if (descriptor.name() == key) | 65     if (descriptor.name() == key) | 
| 61       return &descriptor; | 66       return &descriptor; | 
| 62   } | 67   } | 
| 63   return nullptr; | 68   return nullptr; | 
| 64 } | 69 } | 
| 65 | 70 | 
| 66 DEFINE_TRACE_WRAPPERS(AudioWorkletProcessorDefinition) { | 71 DEFINE_TRACE_WRAPPERS(AudioWorkletProcessorDefinition) { | 
| 67   visitor->TraceWrappers(constructor_.Cast<v8::Value>()); | 72   visitor->TraceWrappers(constructor_.Cast<v8::Value>()); | 
| 68   visitor->TraceWrappers(process_.Cast<v8::Value>()); | 73   visitor->TraceWrappers(process_.Cast<v8::Value>()); | 
| 69 } | 74 } | 
| 70 | 75 | 
| 71 }  // namespace blink | 76 }  // namespace blink | 
| OLD | NEW | 
|---|