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

Unified Diff: third_party/WebKit/Source/modules/worklet/Worklet.h

Issue 2178223002: Refactor Worklet class to use ScriptResource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing files Created 4 years, 5 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/modules/worklet/Worklet.h
diff --git a/third_party/WebKit/Source/modules/worklet/Worklet.h b/third_party/WebKit/Source/modules/worklet/Worklet.h
index 620cb77354fa95bcc6742242bdb8862d507b46c8..f39f4407b67d79cb4e5b29108bb0ee6b9a068960 100644
--- a/third_party/WebKit/Source/modules/worklet/Worklet.h
+++ b/third_party/WebKit/Source/modules/worklet/Worklet.h
@@ -8,16 +8,14 @@
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/dom/ActiveDOMObject.h"
-#include "core/frame/csp/ContentSecurityPolicy.h"
-#include "core/workers/WorkerScriptLoader.h"
+#include "core/fetch/ScriptResource.h"
#include "modules/ModulesExport.h"
#include "platform/heap/Handle.h"
namespace blink {
class ExecutionContext;
-class ScriptPromiseResolver;
-class WorkerScriptLoader;
+class ResourceFetcher;
class WorkletGlobalScopeProxy;
class MODULES_EXPORT Worklet : public GarbageCollectedFinalized<Worklet>, public ScriptWrappable, public ActiveDOMObject {
@@ -30,6 +28,8 @@ public:
// Worklet
ScriptPromise import(ScriptState*, const String& url);
+ void notifyFinished(Resource*);
+
// ActiveDOMObject
void stop() final;
@@ -38,14 +38,13 @@ public:
protected:
// The ExecutionContext argument is the parent document of the Worklet. The
// Worklet inherits the url and userAgent from the document.
- explicit Worklet(ExecutionContext*);
+ explicit Worklet(ExecutionContext*, LocalFrame*);
yhirano 2016/07/27 09:09:46 Could you tell me when the frame is null?
private:
- void onResponse(WorkerScriptLoader*);
- void onFinished(WorkerScriptLoader*, ScriptPromiseResolver*);
+ ResourceFetcher* fetcher() const { return m_fetcher.get(); }
- Vector<RefPtr<WorkerScriptLoader>> m_scriptLoaders;
- HeapVector<Member<ScriptPromiseResolver>> m_resolvers;
+ Member<ResourceFetcher> m_fetcher;
+ HeapVector<Member<Resource>> m_resources;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698