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 WorkletScriptLoader_h |
| 6 #define WorkletScriptLoader_h |
| 7 |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 9 #include "core/fetch/ResourceClient.h" |
| 10 #include "core/fetch/ScriptResource.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 class ScriptPromiseResolver; |
| 15 class Worklet; |
| 16 |
| 17 class WorkletScriptLoader final : public GarbageCollectedFinalized<WorkletScript
Loader>, public ScriptResourceClient { |
| 18 USING_GARBAGE_COLLECTED_MIXIN(WorkletScriptLoader); |
| 19 WTF_MAKE_NONCOPYABLE(WorkletScriptLoader); |
| 20 public: |
| 21 static WorkletScriptLoader* create(ScriptPromiseResolver* scriptPromiseResol
ver, Worklet* worklet) |
| 22 { |
| 23 return new WorkletScriptLoader(scriptPromiseResolver, worklet); |
| 24 } |
| 25 |
| 26 ~WorkletScriptLoader() override = default; |
| 27 |
| 28 DECLARE_TRACE(); |
| 29 |
| 30 private: |
| 31 WorkletScriptLoader(ScriptPromiseResolver*, Worklet* host); |
| 32 |
| 33 // ResourceClient |
| 34 void notifyFinished(Resource*) final; |
| 35 String debugName() const final { return "WorkletLoader"; } |
| 36 |
| 37 Member<ScriptPromiseResolver> m_resolver; |
| 38 Member<Worklet> m_host; |
| 39 }; |
| 40 |
| 41 } // namespace blink |
| 42 |
| 43 #endif // WorkletScriptLoader_h |
OLD | NEW |