| 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 16 matching lines...) Expand all Loading... |
| 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 // Called when addModule() is called for the first time. | 32 // Called when addModule() is called for the first time. |
| 33 virtual void Initialize() = 0; | 33 virtual void Initialize() = 0; |
| 34 virtual bool IsInitialized() const = 0; | 34 virtual bool IsInitialized() const = 0; |
| 35 | 35 |
| 36 // Worklet | 36 // Worklet |
| 37 ScriptPromise addModule(ScriptState*, const String& url) final; | 37 ScriptPromise addModule(ScriptState*, const String& module_url) final; |
| 38 | 38 |
| 39 // WorkletScriptLoader::Client | 39 // WorkletScriptLoader::Client |
| 40 void NotifyWorkletScriptLoadingFinished(WorkletScriptLoader*, | 40 void NotifyWorkletScriptLoadingFinished(WorkletScriptLoader*, |
| 41 const ScriptSourceCode&) final; | 41 const ScriptSourceCode&) final; |
| 42 | 42 |
| 43 // ContextLifecycleObserver | 43 // ContextLifecycleObserver |
| 44 void ContextDestroyed(ExecutionContext*) final; | 44 void ContextDestroyed(ExecutionContext*) final; |
| 45 | 45 |
| 46 DECLARE_VIRTUAL_TRACE(); | 46 DECLARE_VIRTUAL_TRACE(); |
| 47 | 47 |
| 48 protected: | 48 protected: |
| 49 explicit ThreadedWorklet(LocalFrame*); | 49 explicit ThreadedWorklet(LocalFrame*); |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 HeapHashMap<Member<WorkletScriptLoader>, Member<ScriptPromiseResolver>> | 52 HeapHashMap<Member<WorkletScriptLoader>, Member<ScriptPromiseResolver>> |
| 53 loader_to_resolver_map_; | 53 loader_to_resolver_map_; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // namespace blink | 56 } // namespace blink |
| 57 | 57 |
| 58 #endif // ThreadedWorklet_h | 58 #endif // ThreadedWorklet_h |
| OLD | NEW |