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 Worklet_h | 5 #ifndef Worklet_h |
6 #define Worklet_h | 6 #define Worklet_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
10 #include "core/dom/ActiveDOMObject.h" | 10 #include "core/dom/ActiveDOMObject.h" |
11 #include "core/frame/csp/ContentSecurityPolicy.h" | 11 #include "core/frame/csp/ContentSecurityPolicy.h" |
12 #include "core/workers/WorkerScriptLoader.h" | 12 #include "core/workers/WorkerScriptLoader.h" |
| 13 #include "modules/ModulesExport.h" |
13 #include "modules/worklet/WorkletGlobalScope.h" | 14 #include "modules/worklet/WorkletGlobalScope.h" |
14 #include "platform/heap/Handle.h" | 15 #include "platform/heap/Handle.h" |
15 | 16 |
16 namespace blink { | 17 namespace blink { |
17 | 18 |
18 class ExecutionContext; | 19 class ExecutionContext; |
19 class ScriptPromiseResolver; | 20 class ScriptPromiseResolver; |
20 class WorkerScriptLoader; | 21 class WorkerScriptLoader; |
21 | 22 |
22 class Worklet : public GarbageCollectedFinalized<Worklet>, public ScriptWrappabl
e, public ActiveDOMObject { | 23 class MODULES_EXPORT Worklet : public GarbageCollectedFinalized<Worklet>, public
ScriptWrappable, public ActiveDOMObject { |
23 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
24 USING_GARBAGE_COLLECTED_MIXIN(Worklet); | 25 USING_GARBAGE_COLLECTED_MIXIN(Worklet); |
25 WTF_MAKE_NONCOPYABLE(Worklet); | 26 WTF_MAKE_NONCOPYABLE(Worklet); |
26 public: | 27 public: |
27 virtual WorkletGlobalScope* workletGlobalScope() const = 0; | 28 virtual WorkletGlobalScope* workletGlobalScope() const = 0; |
28 | 29 |
29 // Worklet | 30 // Worklet |
30 ScriptPromise import(ScriptState*, const String& url); | 31 ScriptPromise import(ScriptState*, const String& url); |
31 | 32 |
32 // ActiveDOMObject | 33 // ActiveDOMObject |
(...skipping 10 matching lines...) Expand all Loading... |
43 void onResponse(); | 44 void onResponse(); |
44 void onFinished(WorkerScriptLoader*, ScriptPromiseResolver*); | 45 void onFinished(WorkerScriptLoader*, ScriptPromiseResolver*); |
45 | 46 |
46 Vector<RefPtr<WorkerScriptLoader>> m_scriptLoaders; | 47 Vector<RefPtr<WorkerScriptLoader>> m_scriptLoaders; |
47 HeapVector<Member<ScriptPromiseResolver>> m_resolvers; | 48 HeapVector<Member<ScriptPromiseResolver>> m_resolvers; |
48 }; | 49 }; |
49 | 50 |
50 } // namespace blink | 51 } // namespace blink |
51 | 52 |
52 #endif // Worklet_h | 53 #endif // Worklet_h |
OLD | NEW |