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

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

Issue 1684303002: Add a basic version of Worklet#import. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix non-oilpan build. Created 4 years, 10 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 7af0832648811b65bfc114b8a6ba4bca7b785f06..91f7f2ef204285d2fad1caa0b46e4ef696237e07 100644
--- a/third_party/WebKit/Source/modules/worklet/Worklet.h
+++ b/third_party/WebKit/Source/modules/worklet/Worklet.h
@@ -5,28 +5,45 @@
#ifndef Worklet_h
#define Worklet_h
+#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 "modules/worklet/WorkletGlobalScope.h"
#include "platform/heap/Handle.h"
namespace blink {
class ExecutionContext;
+class ScriptPromiseResolver;
+class WorkerScriptLoader;
-class Worklet final : public GarbageCollectedFinalized<Worklet>, public ScriptWrappable {
- WTF_MAKE_NONCOPYABLE(Worklet);
+class Worklet final : public GarbageCollectedFinalized<Worklet>, public ScriptWrappable, public ActiveDOMObject {
DEFINE_WRAPPERTYPEINFO();
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Worklet);
+ WTF_MAKE_NONCOPYABLE(Worklet);
public:
// The ExecutionContext argument is the parent document of the Worklet. The
// Worklet inherits the url and userAgent, from the document.
static Worklet* create(ExecutionContext*);
+ ScriptPromise import(ScriptState*, const String& url);
+
+ // ActiveDOMObject
+ void stop() final;
+
DECLARE_TRACE();
private:
explicit Worklet(ExecutionContext*);
+ void onResponse();
+ void onFinished(WorkerScriptLoader*, ScriptPromiseResolver*);
+
RefPtrWillBeMember<WorkletGlobalScope> m_workletGlobalScope;
+ Vector<RefPtr<WorkerScriptLoader>> m_scriptLoaders;
+ HeapVector<Member<ScriptPromiseResolver>> m_resolvers;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698