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

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

Issue 2727733002: Implement AudioWorkletProcessor interface (Closed)
Patch Set: Addressing feedback Created 3 years, 9 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..701d6f0cb1488a115f9f2535e870cd8e145d09c4
--- /dev/null
+++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h
@@ -0,0 +1,43 @@
+// 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 AudioWorkletProcessorDefinition;
+
+// AudioWorkletProcessor class represents the active instance created from
+// AudioWorkletProcessorDefinition. |AudioWorkletNodeHandler| invokes
+// process() method in this object upon graph rendering.
+//
+// This is constructed and destroyed on a worker thread, and all methods also
+// must be called on the worker thread.
+class AudioWorkletProcessor
+ : public GarbageCollectedFinalized<AudioWorkletProcessor> {
+ public:
+ static AudioWorkletProcessor* create(AudioWorkletProcessorDefinition*);
+ virtual ~AudioWorkletProcessor();
+
+ // TODO(hongchan): This method is simplified for prototyping purpose.
+ bool process(AudioBuffer* inputBuffer, AudioBuffer* outputBuffer);
+
+ DECLARE_TRACE();
+
+ private:
+ explicit AudioWorkletProcessor(AudioWorkletProcessorDefinition*);
+
+ Member<AudioWorkletProcessorDefinition> m_definition;
+ ScopedPersistent<v8::Object> m_instance;
+};
+
+} // namespace blink
+
+#endif // AudioWorkletProcessor_h

Powered by Google App Engine
This is Rietveld 408576698