OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef AudioWorkletGlobalScope_h |
| 6 #define AudioWorkletGlobalScope_h |
| 7 |
| 8 #include "bindings/core/v8/ScriptValue.h" |
| 9 #include "core/dom/ExecutionContext.h" |
| 10 #include "modules/ModulesExport.h" |
| 11 #include "modules/worklet/WorkletGlobalScope.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 class AudioWorkletProcessorDefinition; |
| 16 class ExceptionState; |
| 17 |
| 18 class MODULES_EXPORT AudioWorkletGlobalScope : public WorkletGlobalScope { |
| 19 DEFINE_WRAPPERTYPEINFO(); |
| 20 |
| 21 public: |
| 22 static AudioWorkletGlobalScope* create(LocalFrame*, const KURL&, const Strin
g& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*); |
| 23 ~AudioWorkletGlobalScope() override; |
| 24 void dispose() override; |
| 25 |
| 26 bool isAudioWorkletGlobalScope() const final { return true; } |
| 27 void registerAudioWorkletProcessor(const String& name, const ScriptValue& ct
or, ExceptionState&); |
| 28 |
| 29 AudioWorkletProcessorDefinition* findDefinition(const String& name); |
| 30 |
| 31 DECLARE_VIRTUAL_TRACE(); |
| 32 |
| 33 private: |
| 34 AudioWorkletGlobalScope(LocalFrame*, const KURL&, const String& userAgent, P
assRefPtr<SecurityOrigin>, v8::Isolate*); |
| 35 |
| 36 typedef HeapHashMap<String, Member<AudioWorkletProcessorDefinition>> Definit
ionMap; |
| 37 DefinitionMap m_processorDefinitions; |
| 38 }; |
| 39 |
| 40 DEFINE_TYPE_CASTS(AudioWorkletGlobalScope, ExecutionContext, context, context->i
sAudioWorkletGlobalScope(), context.isAudioWorkletGlobalScope()); |
| 41 |
| 42 } // namespace blink |
| 43 |
| 44 #endif // AudioWorkletGlobalScope_h |
OLD | NEW |