OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef AudioWorklet_h | 5 #ifndef AudioWorklet_h |
6 #define AudioWorklet_h | 6 #define AudioWorklet_h |
7 | 7 |
8 #include "core/workers/Worklet.h" | 8 #include "core/workers/ThreadedWorklet.h" |
9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class LocalFrame; | 14 class LocalFrame; |
15 class ThreadedWorkletMessagingProxy; | 15 class ThreadedWorkletMessagingProxy; |
16 class WorkletGlobalScopeProxy; | 16 class WorkletGlobalScopeProxy; |
17 | 17 |
18 class MODULES_EXPORT AudioWorklet final : public Worklet { | 18 class MODULES_EXPORT AudioWorklet final : public ThreadedWorklet { |
19 WTF_MAKE_NONCOPYABLE(AudioWorklet); | 19 WTF_MAKE_NONCOPYABLE(AudioWorklet); |
20 | 20 |
21 public: | 21 public: |
22 static AudioWorklet* Create(LocalFrame*); | 22 static AudioWorklet* Create(LocalFrame*); |
23 ~AudioWorklet() override; | 23 ~AudioWorklet() override; |
24 | 24 |
25 void Initialize() final; | 25 void Initialize() final; |
26 bool IsInitialized() const final; | 26 bool IsInitialized() const final; |
27 | 27 |
28 WorkletGlobalScopeProxy* GetWorkletGlobalScopeProxy() const final; | 28 WorkletGlobalScopeProxy* GetWorkletGlobalScopeProxy() const final; |
29 | 29 |
30 DECLARE_VIRTUAL_TRACE(); | 30 DECLARE_VIRTUAL_TRACE(); |
31 | 31 |
32 private: | 32 private: |
33 explicit AudioWorklet(LocalFrame*); | 33 explicit AudioWorklet(LocalFrame*); |
34 | 34 |
35 // The proxy outlives the worklet as it is used to perform thread shutdown, | 35 // The proxy outlives the worklet as it is used to perform thread shutdown, |
36 // it deletes itself once this has occurred. | 36 // it deletes itself once this has occurred. |
37 ThreadedWorkletMessagingProxy* worklet_messaging_proxy_; | 37 ThreadedWorkletMessagingProxy* worklet_messaging_proxy_; |
38 }; | 38 }; |
39 | 39 |
40 } // namespace blink | 40 } // namespace blink |
41 | 41 |
42 #endif // AudioWorklet_h | 42 #endif // AudioWorklet_h |
OLD | NEW |