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 #ifndef AudioWorkletProcessorDefinition_h | 5 #ifndef AudioWorkletProcessorDefinition_h |
6 #define AudioWorkletProcessorDefinition_h | 6 #define AudioWorkletProcessorDefinition_h |
7 | 7 |
8 #include "modules/ModulesExport.h" | 8 #include "modules/ModulesExport.h" |
9 #include "modules/webaudio/AudioParamDescriptor.h" | 9 #include "modules/webaudio/AudioParamDescriptor.h" |
10 #include "platform/bindings/ScriptWrappable.h" | 10 #include "platform/bindings/ScriptWrappable.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 const String& name, | 31 const String& name, |
32 v8::Local<v8::Function> constructor, | 32 v8::Local<v8::Function> constructor, |
33 v8::Local<v8::Function> process); | 33 v8::Local<v8::Function> process); |
34 | 34 |
35 virtual ~AudioWorkletProcessorDefinition(); | 35 virtual ~AudioWorkletProcessorDefinition(); |
36 | 36 |
37 const String& GetName() const { return name_; } | 37 const String& GetName() const { return name_; } |
38 v8::Local<v8::Function> ConstructorLocal(v8::Isolate*); | 38 v8::Local<v8::Function> ConstructorLocal(v8::Isolate*); |
39 v8::Local<v8::Function> ProcessLocal(v8::Isolate*); | 39 v8::Local<v8::Function> ProcessLocal(v8::Isolate*); |
40 void SetAudioParamDescriptors(const HeapVector<AudioParamDescriptor>&); | 40 void SetAudioParamDescriptors(const HeapVector<AudioParamDescriptor>&); |
| 41 const HeapVector<AudioParamDescriptor>& GetAudioParamDescriptors() const; |
41 const Vector<String> GetAudioParamDescriptorNames() const; | 42 const Vector<String> GetAudioParamDescriptorNames() const; |
42 const AudioParamDescriptor* GetAudioParamDescriptor(const String& key) const; | 43 const AudioParamDescriptor* GetAudioParamDescriptor(const String& key) const; |
43 | 44 |
44 DEFINE_INLINE_TRACE() { visitor->Trace(audio_param_descriptors_); }; | 45 DEFINE_INLINE_TRACE() { visitor->Trace(audio_param_descriptors_); }; |
45 DECLARE_TRACE_WRAPPERS(); | 46 DECLARE_TRACE_WRAPPERS(); |
46 | 47 |
47 private: | 48 private: |
48 AudioWorkletProcessorDefinition( | 49 AudioWorkletProcessorDefinition( |
49 v8::Isolate*, | 50 v8::Isolate*, |
50 const String& name, | 51 const String& name, |
51 v8::Local<v8::Function> constructor, | 52 v8::Local<v8::Function> constructor, |
52 v8::Local<v8::Function> process); | 53 v8::Local<v8::Function> process); |
53 | 54 |
54 const String name_; | 55 const String name_; |
55 | 56 |
56 // The definition is per global scope. The active instance of | 57 // The definition is per global scope. The active instance of |
57 // |AudioProcessorWorklet| should be passed into these to perform JS function. | 58 // |AudioProcessorWorklet| should be passed into these to perform JS function. |
58 TraceWrapperV8Reference<v8::Function> constructor_; | 59 TraceWrapperV8Reference<v8::Function> constructor_; |
59 TraceWrapperV8Reference<v8::Function> process_; | 60 TraceWrapperV8Reference<v8::Function> process_; |
60 | 61 |
| 62 // A container for AudioParamDescriptor objects. |
61 HeapVector<AudioParamDescriptor> audio_param_descriptors_; | 63 HeapVector<AudioParamDescriptor> audio_param_descriptors_; |
62 }; | 64 }; |
63 | 65 |
64 } // namespace blink | 66 } // namespace blink |
65 | 67 |
66 #endif // AudioWorkletProcessorDefinition_h | 68 #endif // AudioWorkletProcessorDefinition_h |
OLD | NEW |