OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 ThreadedWorklet_h | 5 #ifndef ThreadedWorklet_h |
6 #define ThreadedWorklet_h | 6 #define ThreadedWorklet_h |
7 | 7 |
8 #include "core/workers/Worklet.h" | 8 #include "core/workers/Worklet.h" |
9 | 9 |
10 #include "bindings/core/v8/ScriptPromiseResolver.h" | 10 #include "bindings/core/v8/ScriptPromiseResolver.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 // class once threaded worklets are also ready to use module loading. | 23 // class once threaded worklets are also ready to use module loading. |
24 class CORE_EXPORT ThreadedWorklet : public Worklet, | 24 class CORE_EXPORT ThreadedWorklet : public Worklet, |
25 public WorkletScriptLoader::Client { | 25 public WorkletScriptLoader::Client { |
26 USING_GARBAGE_COLLECTED_MIXIN(ThreadedWorklet); | 26 USING_GARBAGE_COLLECTED_MIXIN(ThreadedWorklet); |
27 WTF_MAKE_NONCOPYABLE(ThreadedWorklet); | 27 WTF_MAKE_NONCOPYABLE(ThreadedWorklet); |
28 | 28 |
29 public: | 29 public: |
30 virtual ~ThreadedWorklet() = default; | 30 virtual ~ThreadedWorklet() = default; |
31 | 31 |
32 // Worklet | 32 // Worklet |
33 ScriptPromise import(ScriptState*, const String& url) final; | 33 ScriptPromise addModule(ScriptState*, const String& url) final; |
34 | 34 |
35 // WorkletScriptLoader::Client | 35 // WorkletScriptLoader::Client |
36 void NotifyWorkletScriptLoadingFinished(WorkletScriptLoader*, | 36 void NotifyWorkletScriptLoadingFinished(WorkletScriptLoader*, |
37 const ScriptSourceCode&) final; | 37 const ScriptSourceCode&) final; |
38 | 38 |
39 // ContextLifecycleObserver | 39 // ContextLifecycleObserver |
40 void ContextDestroyed(ExecutionContext*) final; | 40 void ContextDestroyed(ExecutionContext*) final; |
41 | 41 |
42 DECLARE_VIRTUAL_TRACE(); | 42 DECLARE_VIRTUAL_TRACE(); |
43 | 43 |
44 protected: | 44 protected: |
45 explicit ThreadedWorklet(LocalFrame*); | 45 explicit ThreadedWorklet(LocalFrame*); |
46 | 46 |
47 private: | 47 private: |
48 HeapHashMap<Member<WorkletScriptLoader>, Member<ScriptPromiseResolver>> | 48 HeapHashMap<Member<WorkletScriptLoader>, Member<ScriptPromiseResolver>> |
49 loader_to_resolver_map_; | 49 loader_to_resolver_map_; |
50 }; | 50 }; |
51 | 51 |
52 } // namespace blink | 52 } // namespace blink |
53 | 53 |
54 #endif // ThreadedWorklet_h | 54 #endif // ThreadedWorklet_h |
OLD | NEW |