Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(738)

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h

Issue 2727733002: Implement AudioWorkletProcessor interface (Closed)
Patch Set: Added AudioWorkletProcessor and AudioWorkletProcessorDefinition classes Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h
new file mode 100644
index 0000000000000000000000000000000000000000..ef0670be75f4e85b721e9711bdb632b62993a6bc
--- /dev/null
+++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h
@@ -0,0 +1,48 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef AudioWorkletProcessor_h
+#define AudioWorkletProcessor_h
+
+#include "bindings/core/v8/ScopedPersistent.h"
+#include "platform/heap/Handle.h"
+#include "v8/include/v8.h"
+
+namespace blink {
+
+class AudioBuffer;
+class AudioWorkletGlobalScope;
+class AudioWorkletProcessorDefinition;
+
+// AudioWorkletProcessor class represents the active instance created from
+// AudioWorkletProcessorDefinition. |AudioWorkletNodeHandler| invokes
+// process() method in this object upon graph rendering.
+class AudioWorkletProcessor
+ : public GarbageCollectedFinalized<AudioWorkletProcessor> {
+ public:
+ static AudioWorkletProcessor* create(const String& name,
+ AudioWorkletGlobalScope*);
+ virtual ~AudioWorkletProcessor();
+
+ // TODO: AudioWorkletHandler must serve
+ // - inputs: sequence<AudioBuffer>
+ // - outputs: sequence<AudioBuffer>
+ // - parameters: Object
+ bool process(AudioBuffer* inputBuffer, AudioBuffer* outputBuffer);
+
+ // TODO:
+ // Implement event handler and messaging features.
+
+ DECLARE_TRACE();
+
+ private:
+ AudioWorkletProcessor(AudioWorkletProcessorDefinition*);
haraken 2017/03/06 11:51:12 Add explicit.
hongchan 2017/03/06 20:06:12 Done.
+
+ Member<AudioWorkletProcessorDefinition> m_definition;
+ v8::Local<v8::Object> m_instance;
haraken 2017/03/06 11:51:12 You should not use v8::Local on a heap-allocated o
hongchan 2017/03/06 20:06:12 Done.
+};
+
+} // namespace blink
+
+#endif // AudioWorkletProcessor_h

Powered by Google App Engine
This is Rietveld 408576698