| 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/ThreadedWorklet.h" | 8 #include "core/workers/Worklet.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; | |
| 16 class WorkletGlobalScopeProxy; | 15 class WorkletGlobalScopeProxy; |
| 17 | 16 |
| 18 class MODULES_EXPORT AudioWorklet final : public ThreadedWorklet { | 17 class MODULES_EXPORT AudioWorklet final : public Worklet { |
| 19 WTF_MAKE_NONCOPYABLE(AudioWorklet); | 18 WTF_MAKE_NONCOPYABLE(AudioWorklet); |
| 20 | 19 |
| 21 public: | 20 public: |
| 22 static AudioWorklet* Create(LocalFrame*); | 21 static AudioWorklet* Create(LocalFrame*); |
| 23 ~AudioWorklet() override; | 22 ~AudioWorklet() override; |
| 24 | 23 |
| 25 void Initialize() final; | |
| 26 bool IsInitialized() const final; | |
| 27 | |
| 28 WorkletGlobalScopeProxy* GetWorkletGlobalScopeProxy() const final; | |
| 29 | |
| 30 DECLARE_VIRTUAL_TRACE(); | 24 DECLARE_VIRTUAL_TRACE(); |
| 31 | 25 |
| 32 private: | 26 private: |
| 33 explicit AudioWorklet(LocalFrame*); | 27 explicit AudioWorklet(LocalFrame*); |
| 34 | 28 |
| 35 // The proxy outlives the worklet as it is used to perform thread shutdown, | 29 // Implements Worklet. |
| 36 // it deletes itself once this has occurred. | 30 bool NeedsToCreateGlobalScope(); |
| 37 ThreadedWorkletMessagingProxy* worklet_messaging_proxy_; | 31 std::unique_ptr<WorkletGlobalScopeProxy> CreateGlobalScope(); |
| 38 }; | 32 }; |
| 39 | 33 |
| 40 } // namespace blink | 34 } // namespace blink |
| 41 | 35 |
| 42 #endif // AudioWorklet_h | 36 #endif // AudioWorklet_h |
| OLD | NEW |