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 AudioWorkletThread_h |
| 6 #define AudioWorkletThread_h |
| 7 |
| 8 #include "core/dom/MessagePort.h" |
| 9 #include "platform/WebThreadSupportingGC.h" |
| 10 #include "platform/heap/Handle.h" |
| 11 #include "wtf/text/WTFString.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 class SerializedScriptValue; |
| 16 class AudioDestinationHandler; |
| 17 class AudioWorkletGlobalScope; |
| 18 // class AudioWorkletMessagingProxy; |
| 19 class AudioWorkletThreadStartupData; |
| 20 |
| 21 class AudioWorkletThread : public RefCounted<AudioWorkletThread> { |
| 22 public: |
| 23 static PassRefPtr<AudioWorkletThread> create(AudioDestinationHandler&); |
| 24 virtual ~AudioWorkletThread(); |
| 25 |
| 26 bool isCurrentThread(); |
| 27 void initialize(LocalFrame*, PassOwnPtr<AudioWorkletThreadStartupData>); |
| 28 void shutdown(); |
| 29 void evaluate(const String& sourceCode, const KURL& scriptURL); |
| 30 |
| 31 WebThreadSupportingGC& audioRenderThread(); |
| 32 v8::Isolate* isolate() const { return m_isolate; } |
| 33 |
| 34 private: |
| 35 explicit AudioWorkletThread(AudioDestinationHandler&); |
| 36 |
| 37 void initializeInternal(LocalFrame*, PassOwnPtr<AudioWorkletThreadStartupDat
a>); |
| 38 void shutdownInternal(); |
| 39 void evaluateInternal(const String& sourceCode, const KURL& scriptURL); |
| 40 void performShutdownTask(); |
| 41 |
| 42 OwnPtr<WebThread::TaskObserver> m_microtaskRunner; |
| 43 |
| 44 bool m_shutdown; |
| 45 bool m_initialized = false; |
| 46 Mutex m_threadStateMutex; |
| 47 |
| 48 Persistent<AudioWorkletGlobalScope> m_audioWorkletGlobalScope; |
| 49 AudioDestinationHandler& m_destinationHandler; |
| 50 v8::Isolate* m_isolate; |
| 51 }; |
| 52 |
| 53 } // namespace blink |
| 54 |
| 55 #endif // AudioWorkletThread_h |
OLD | NEW |