Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(754)

Unified Diff: third_party/WebKit/Source/core/workers/Worklet.h

Issue 2657823002: Worklet: Straighten layering of worklet script loading (Closed)
Patch Set: clean up Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/workers/Worklet.h
diff --git a/third_party/WebKit/Source/core/workers/Worklet.h b/third_party/WebKit/Source/core/workers/Worklet.h
index ebd8d1e421465e99d1ff092ccaae142ce54ad141..fca8f5e85c0834bedd4a2b34ce5c5f9847e77287 100644
--- a/third_party/WebKit/Source/core/workers/Worklet.h
+++ b/third_party/WebKit/Source/core/workers/Worklet.h
@@ -6,20 +6,21 @@
#define Worklet_h
#include "bindings/core/v8/ScriptPromise.h"
+#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/CoreExport.h"
#include "core/dom/ContextLifecycleObserver.h"
-#include "core/loader/resource/ScriptResource.h"
+#include "core/workers/WorkletScriptLoader.h"
#include "platform/heap/Handle.h"
+#include "platform/loader/fetch/ResourceFetcher.h"
namespace blink {
class LocalFrame;
-class ResourceFetcher;
class WorkletGlobalScopeProxy;
-class WorkletScriptLoader;
class CORE_EXPORT Worklet : public GarbageCollectedFinalized<Worklet>,
+ public WorkletScriptLoader::Client,
public ScriptWrappable,
public ContextLifecycleObserver {
DEFINE_WRAPPERTYPEINFO();
@@ -27,7 +28,7 @@ class CORE_EXPORT Worklet : public GarbageCollectedFinalized<Worklet>,
WTF_MAKE_NONCOPYABLE(Worklet);
public:
- virtual ~Worklet() {}
+ virtual ~Worklet() = default;
virtual void initialize() {}
virtual bool isInitialized() const { return true; }
@@ -37,7 +38,9 @@ class CORE_EXPORT Worklet : public GarbageCollectedFinalized<Worklet>,
// Worklet
ScriptPromise import(ScriptState*, const String& url);
- void notifyFinished(WorkletScriptLoader*);
+ // WorkletScriptLoader::Client
+ void notifyWorkletScriptLoadingFinished(WorkletScriptLoader*,
+ const ScriptSourceCode&) final;
// ContextLifecycleObserver
void contextDestroyed(ExecutionContext*) final;
@@ -49,10 +52,9 @@ class CORE_EXPORT Worklet : public GarbageCollectedFinalized<Worklet>,
explicit Worklet(LocalFrame*);
private:
- ResourceFetcher* fetcher() const { return m_fetcher.get(); }
-
- Member<ResourceFetcher> m_fetcher;
- HeapHashSet<Member<WorkletScriptLoader>> m_scriptLoaders;
+ Member<LocalFrame> m_frame;
+ HeapHashMap<Member<WorkletScriptLoader>, Member<ScriptPromiseResolver>>
+ m_loaderAndResolvers;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698