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 26 matching lines...) Expand all Loading... |
37 void ContextDestroyed(ExecutionContext*) final; | 37 void ContextDestroyed(ExecutionContext*) final; |
38 | 38 |
39 DECLARE_VIRTUAL_TRACE(); | 39 DECLARE_VIRTUAL_TRACE(); |
40 | 40 |
41 protected: | 41 protected: |
42 explicit ThreadedWorklet(LocalFrame*); | 42 explicit ThreadedWorklet(LocalFrame*); |
43 | 43 |
44 private: | 44 private: |
45 // Worklet | 45 // Worklet |
46 void FetchAndInvokeScript(const KURL& module_url_record, | 46 void FetchAndInvokeScript(const KURL& module_url_record, |
| 47 const WorkletOptions&, |
47 ScriptPromiseResolver*) override; | 48 ScriptPromiseResolver*) override; |
48 | 49 |
49 // Called when addModule() is called for the first time. | 50 // Called when addModule() is called for the first time. |
50 virtual void Initialize() = 0; | 51 virtual void Initialize() = 0; |
51 virtual bool IsInitialized() const = 0; | 52 virtual bool IsInitialized() const = 0; |
52 | 53 |
53 Member<LocalFrame> frame_; | 54 Member<LocalFrame> frame_; |
54 | 55 |
55 HeapHashMap<Member<WorkletScriptLoader>, Member<ScriptPromiseResolver>> | 56 HeapHashMap<Member<WorkletScriptLoader>, Member<ScriptPromiseResolver>> |
56 loader_to_resolver_map_; | 57 loader_to_resolver_map_; |
57 }; | 58 }; |
58 | 59 |
59 } // namespace blink | 60 } // namespace blink |
60 | 61 |
61 #endif // ThreadedWorklet_h | 62 #endif // ThreadedWorklet_h |
OLD | NEW |