Index: third_party/WebKit/Source/modules/webaudio/AudioWorkletObjectProxy.h |
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletObjectProxy.h b/third_party/WebKit/Source/modules/webaudio/AudioWorkletObjectProxy.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b021e1ee32312c0bab7360f1c426b6df2a9ef303 |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletObjectProxy.h |
@@ -0,0 +1,64 @@ |
+// Copyright 2017 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 AudioWorkletObjectProxy_h |
+#define AudioWorkletObjectProxy_h |
+ |
+#include "bindings/core/v8/SourceLocation.h" |
+#include "core/CoreExport.h" |
+#include "core/dom/MessagePort.h" |
+#include "core/workers/ThreadedObjectProxyBase.h" |
+#include "core/workers/WorkerReportingProxy.h" |
+ |
+namespace blink { |
+ |
+class AudioWorkletHandler; |
+class AudioWorkletMessagingProxy; |
+class WaitableEvent; |
+class WorkerThread; |
+ |
+// This class is a duplication of ThreadedWorkletObjectProxy, in order to match |
+// the implementation of AudioWorkletMessagingProxy. |
+class CORE_EXPORT AudioWorkletObjectProxy : public ThreadedObjectProxyBase { |
+ USING_FAST_MALLOC(AudioWorkletObjectProxy); |
+ WTF_MAKE_NONCOPYABLE(AudioWorkletObjectProxy); |
+ |
+ public: |
+ static std::unique_ptr<AudioWorkletObjectProxy> Create( |
+ const WeakPtr<AudioWorkletMessagingProxy>&, |
+ ParentFrameTaskRunners*); |
+ ~AudioWorkletObjectProxy() override; |
+ |
+ void EvaluateScript(const String& source, |
+ const KURL& script_url, |
+ WorkerThread*); |
+ |
+ void CreateProcessorInstance(const String& name, |
+ AudioWorkletHandler*, |
+ WaitableEvent*, |
+ WorkerThread*); |
+ |
+ // ThreadedObjectProxyBase overrides. |
+ void ReportException(const String& error_message, |
+ std::unique_ptr<SourceLocation>, |
+ int exception_id) final {} |
+ void DidEvaluateWorkerScript(bool success) final {} |
+ void WillDestroyWorkerGlobalScope() final {} |
+ |
+ protected: |
+ AudioWorkletObjectProxy(const WeakPtr<AudioWorkletMessagingProxy>&, |
+ ParentFrameTaskRunners*); |
+ |
+ WeakPtr<ThreadedMessagingProxyBase> MessagingProxyWeakPtr() final; |
+ |
+ private: |
+ // No guarantees about the lifetimes of tasks posted by this proxy wrt the |
+ // AudioWorkletMessagingProxy so a weak pointer must be used when posting |
+ // the tasks. |
+ WeakPtr<AudioWorkletMessagingProxy> messaging_proxy_weak_ptr_; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // AudioWorkletObjectProxy_h |