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 #include "core/dom/Modulator.h" | 5 #include "core/dom/Modulator.h" |
6 #include "core/workers/WorkletPendingTasks.h" | 6 #include "core/workers/WorkletPendingTasks.h" |
| 7 #include "platform/WebTaskRunner.h" |
7 #include "platform/heap/GarbageCollected.h" | 8 #include "platform/heap/GarbageCollected.h" |
8 | 9 |
9 namespace blink { | 10 namespace blink { |
10 | 11 |
11 class ModuleScript; | 12 class ModuleScript; |
12 | 13 |
| 14 // A ModuleTreeClient that lives on the worklet context's thread. |
13 class WorkletModuleTreeClient final | 15 class WorkletModuleTreeClient final |
14 : public GarbageCollectedFinalized<WorkletModuleTreeClient>, | 16 : public GarbageCollectedFinalized<WorkletModuleTreeClient>, |
15 public ModuleTreeClient { | 17 public ModuleTreeClient { |
16 USING_GARBAGE_COLLECTED_MIXIN(WorkletModuleTreeClient); | 18 USING_GARBAGE_COLLECTED_MIXIN(WorkletModuleTreeClient); |
17 | 19 |
18 public: | 20 public: |
19 WorkletModuleTreeClient(Modulator*, WorkletPendingTasks*); | 21 WorkletModuleTreeClient(Modulator*, |
| 22 RefPtr<WebTaskRunner> parent_frame_task_runner, |
| 23 WorkletPendingTasks*); |
20 | 24 |
21 // Implements ModuleTreeClient. | 25 // Implements ModuleTreeClient. |
22 void NotifyModuleTreeLoadFinished(ModuleScript*) final; | 26 void NotifyModuleTreeLoadFinished(ModuleScript*) final; |
23 | 27 |
24 DECLARE_VIRTUAL_TRACE(); | 28 DECLARE_VIRTUAL_TRACE(); |
25 | 29 |
26 private: | 30 private: |
27 Member<Modulator> modulator_; | 31 Member<Modulator> modulator_; |
28 Member<WorkletPendingTasks> pending_tasks_; | 32 RefPtr<WebTaskRunner> parent_frame_task_runner_; |
| 33 CrossThreadPersistent<WorkletPendingTasks> pending_tasks_; |
29 }; | 34 }; |
30 | 35 |
31 } // namespace blink | 36 } // namespace blink |
OLD | NEW |