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

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.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/AudioWorkletGlobalScope.h
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h b/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h
index 590a3a3300b7a5496d6a87b6782cb93b1cc04045..eba79c34e901208cd5428fdcae2ee3d280fa2c75 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h
+++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h
@@ -5,11 +5,20 @@
#ifndef AudioWorkletGlobalScope_h
#define AudioWorkletGlobalScope_h
+#include "bindings/core/v8/ScriptValue.h"
+#include "core/dom/ExecutionContext.h"
#include "core/workers/ThreadedWorkletGlobalScope.h"
+#include "modules/ModulesExport.h"
namespace blink {
-class AudioWorkletGlobalScope final : public ThreadedWorkletGlobalScope {
+class ExceptionState;
+class AudioWorkletProcessorDefinition;
+
+// This is constructed and destroyed on a worker thread, and all methods also
+// must be called on the worker thread.
+class MODULES_EXPORT AudioWorkletGlobalScope final
+ : public ThreadedWorkletGlobalScope {
DEFINE_WRAPPERTYPEINFO();
public:
@@ -19,6 +28,15 @@ class AudioWorkletGlobalScope final : public ThreadedWorkletGlobalScope {
v8::Isolate*,
WorkerThread*);
~AudioWorkletGlobalScope() override;
+ void dispose() final;
+ bool isAudioWorkletGlobalScope() const final { return true; }
+ AudioWorkletProcessorDefinition* findDefinition(const String& name);
+ void registerProcessor(ScriptState*,
+ const String& name,
+ const ScriptValue& constructor,
+ ExceptionState&);
+
+ DECLARE_TRACE();
private:
AudioWorkletGlobalScope(const KURL&,
@@ -26,6 +44,10 @@ class AudioWorkletGlobalScope final : public ThreadedWorkletGlobalScope {
PassRefPtr<SecurityOrigin>,
v8::Isolate*,
WorkerThread*);
+
+ typedef HeapHashMap<String, Member<AudioWorkletProcessorDefinition>>
+ ProcessorDefinitionMap;
+ ProcessorDefinitionMap m_processorDefinitionMap;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698