Index: third_party/WebKit/Source/modules/webaudio/AudioWorkletThread.h |
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletThread.h b/third_party/WebKit/Source/modules/webaudio/AudioWorkletThread.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5a6e8fa57022cfaf83ae22e1d9d5063440384dd6 |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletThread.h |
@@ -0,0 +1,55 @@ |
+// Copyright 2016 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 AudioWorkletThread_h |
+#define AudioWorkletThread_h |
+ |
+#include "core/dom/MessagePort.h" |
+#include "platform/WebThreadSupportingGC.h" |
+#include "platform/heap/Handle.h" |
+#include "wtf/text/WTFString.h" |
+ |
+namespace blink { |
+ |
+class SerializedScriptValue; |
+class AudioDestinationHandler; |
+class AudioWorkletGlobalScope; |
+// class AudioWorkletMessagingProxy; |
+class AudioWorkletThreadStartupData; |
+ |
+class AudioWorkletThread : public RefCounted<AudioWorkletThread> { |
+public: |
+ static PassRefPtr<AudioWorkletThread> create(AudioDestinationHandler&); |
+ virtual ~AudioWorkletThread(); |
+ |
+ bool isCurrentThread(); |
+ void initialize(LocalFrame*, PassOwnPtr<AudioWorkletThreadStartupData>); |
+ void shutdown(); |
+ void evaluate(const String& sourceCode, const KURL& scriptURL); |
+ |
+ WebThreadSupportingGC& audioRenderThread(); |
+ v8::Isolate* isolate() const { return m_isolate; } |
+ |
+private: |
+ explicit AudioWorkletThread(AudioDestinationHandler&); |
+ |
+ void initializeInternal(LocalFrame*, PassOwnPtr<AudioWorkletThreadStartupData>); |
+ void shutdownInternal(); |
+ void evaluateInternal(const String& sourceCode, const KURL& scriptURL); |
+ void performShutdownTask(); |
+ |
+ OwnPtr<WebThread::TaskObserver> m_microtaskRunner; |
+ |
+ bool m_shutdown; |
+ bool m_initialized = false; |
+ Mutex m_threadStateMutex; |
+ |
+ Persistent<AudioWorkletGlobalScope> m_audioWorkletGlobalScope; |
+ AudioDestinationHandler& m_destinationHandler; |
+ v8::Isolate* m_isolate; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // AudioWorkletThread_h |