Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WorkletScriptLoader_h | |
| 6 #define WorkletScriptLoader_h | |
| 7 | |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" | |
| 9 #include "core/fetch/ResourceClient.h" | |
| 10 #include "core/fetch/ScriptResource.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 | |
| 14 class ScriptPromiseResolver; | |
| 15 class Worklet; | |
| 16 class WorkletGlobalScopeProxy; | |
| 17 | |
| 18 class WorkletScriptLoader final : public GarbageCollectedFinalized<WorkletScript Loader>, public ScriptResourceClient { | |
| 19 USING_GARBAGE_COLLECTED_MIXIN(WorkletScriptLoader); | |
| 20 public: | |
| 21 static WorkletScriptLoader* create(ScriptPromiseResolver* scriptPromiseResol ver, WorkletGlobalScopeProxy* workletGlobalScopeProxy, | |
| 22 Worklet* worklet) | |
| 23 { | |
| 24 return new WorkletScriptLoader(scriptPromiseResolver, workletGlobalScope Proxy, worklet); | |
| 25 } | |
| 26 | |
| 27 ~WorkletScriptLoader() override = default; | |
| 28 | |
| 29 DECLARE_TRACE(); | |
| 30 | |
| 31 private: | |
| 32 WorkletScriptLoader(ScriptPromiseResolver*, WorkletGlobalScopeProxy*, Workle t* host); | |
| 33 | |
| 34 // ResourceClient | |
| 35 void notifyFinished(Resource*) final; | |
| 36 String debugName() const final { return "WorkletLoader"; } | |
| 37 | |
| 38 Member<ScriptPromiseResolver> m_resolver; | |
| 39 Member<Worklet> m_host; | |
| 40 WorkletGlobalScopeProxy* m_workletGlobalScopeProxy; | |
|
ikilpatrick
2016/07/28 22:42:10
I wouldn't store this here just access it through
Gleb Lanbin
2016/07/29 01:40:23
Done.
| |
| 41 | |
| 42 WTF_MAKE_NONCOPYABLE(WorkletScriptLoader); | |
|
ikilpatrick
2016/07/28 22:42:10
typically goes after USING_GAR...etc.
Gleb Lanbin
2016/07/29 01:40:23
Done.
| |
| 43 }; | |
| 44 | |
| 45 } // namespace blink | |
| 46 | |
| 47 #endif // WorkletScriptLoader_h | |
| OLD | NEW |