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

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

Issue 1978063002: [DO NOT SUBMIT] AudioWorklet FS2a: AudioWorkletThread on OfflineAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@FS2-audiorendersink-audioworkletthread
Patch Set: Created 4 years, 7 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/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

Powered by Google App Engine
This is Rietveld 408576698