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

Side by Side Diff: third_party/WebKit/Source/modules/worklet/Worklet.h

Issue 2029163002: Worklets - Change inheritance heirarchy of WorkletGlobalScope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 Worklet_h 5 #ifndef Worklet_h
6 #define Worklet_h 6 #define Worklet_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptWrappable.h" 9 #include "bindings/core/v8/ScriptWrappable.h"
10 #include "core/dom/ActiveDOMObject.h" 10 #include "core/dom/ActiveDOMObject.h"
11 #include "core/frame/csp/ContentSecurityPolicy.h" 11 #include "core/frame/csp/ContentSecurityPolicy.h"
12 #include "core/workers/WorkerScriptLoader.h" 12 #include "core/workers/WorkerScriptLoader.h"
13 #include "modules/ModulesExport.h" 13 #include "modules/ModulesExport.h"
14 #include "modules/worklet/WorkletGlobalScope.h"
15 #include "platform/heap/Handle.h" 14 #include "platform/heap/Handle.h"
16 15
17 namespace blink { 16 namespace blink {
18 17
19 class ExecutionContext; 18 class ExecutionContext;
20 class ScriptPromiseResolver; 19 class ScriptPromiseResolver;
21 class WorkerScriptLoader; 20 class WorkerScriptLoader;
21 class WorkletGlobalScopeProxy;
22 22
23 class MODULES_EXPORT Worklet : public GarbageCollectedFinalized<Worklet>, public ScriptWrappable, public ActiveDOMObject { 23 class MODULES_EXPORT Worklet : public GarbageCollectedFinalized<Worklet>, public ScriptWrappable, public ActiveDOMObject {
24 DEFINE_WRAPPERTYPEINFO(); 24 DEFINE_WRAPPERTYPEINFO();
25 USING_GARBAGE_COLLECTED_MIXIN(Worklet); 25 USING_GARBAGE_COLLECTED_MIXIN(Worklet);
26 WTF_MAKE_NONCOPYABLE(Worklet); 26 WTF_MAKE_NONCOPYABLE(Worklet);
27 public: 27 public:
28 virtual WorkletGlobalScope* workletGlobalScope() const = 0; 28 virtual WorkletGlobalScopeProxy* workletGlobalScopeProxy() const = 0;
29 29
30 // Worklet 30 // Worklet
31 ScriptPromise import(ScriptState*, const String& url); 31 ScriptPromise import(ScriptState*, const String& url);
32 32
33 // ActiveDOMObject 33 // ActiveDOMObject
34 void stop() final; 34 void stop() final;
35 35
36 DECLARE_VIRTUAL_TRACE(); 36 DECLARE_VIRTUAL_TRACE();
37 37
38 protected: 38 protected:
39 // The ExecutionContext argument is the parent document of the Worklet. The 39 // The ExecutionContext argument is the parent document of the Worklet. The
40 // Worklet inherits the url and userAgent from the document. 40 // Worklet inherits the url and userAgent from the document.
41 explicit Worklet(ExecutionContext*); 41 explicit Worklet(ExecutionContext*);
42 42
43 private: 43 private:
44 void onResponse(WorkerScriptLoader*); 44 void onResponse(WorkerScriptLoader*);
45 void onFinished(WorkerScriptLoader*, ScriptPromiseResolver*); 45 void onFinished(WorkerScriptLoader*, ScriptPromiseResolver*);
46 46
47 Vector<RefPtr<WorkerScriptLoader>> m_scriptLoaders; 47 Vector<RefPtr<WorkerScriptLoader>> m_scriptLoaders;
48 HeapVector<Member<ScriptPromiseResolver>> m_resolvers; 48 HeapVector<Member<ScriptPromiseResolver>> m_resolvers;
49 }; 49 };
50 50
51 } // namespace blink 51 } // namespace blink
52 52
53 #endif // Worklet_h 53 #endif // Worklet_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/modules.gypi ('k') | third_party/WebKit/Source/modules/worklet/Worklet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698