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

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

Issue 2830603003: Worklet: Move WorkletScriptLoader from MainThreadWorklet to MainThreadWorkletGlobalScope (Closed)
Patch Set: const auto& Created 3 years, 8 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/MainThreadWorkletGlobalScope.h
diff --git a/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h b/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h
index 2de354e0b0720b500e498226d9e5662d9b630a03..2496c399f7d641664b4dfab27c9bac34f8c67fd4 100644
--- a/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h
+++ b/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h
@@ -8,8 +8,10 @@
#include "core/CoreExport.h"
#include "core/dom/ContextLifecycleObserver.h"
#include "core/dom/ExecutionContext.h"
+#include "core/loader/WorkletScriptLoader.h"
#include "core/workers/WorkletGlobalScope.h"
#include "core/workers/WorkletGlobalScopeProxy.h"
+#include "core/workers/WorkletObjectProxy.h"
namespace blink {
@@ -17,9 +19,11 @@ class ConsoleMessage;
class LocalFrame;
class ScriptSourceCode;
-class CORE_EXPORT MainThreadWorkletGlobalScope : public WorkletGlobalScope,
- public WorkletGlobalScopeProxy,
- public ContextClient {
+class CORE_EXPORT MainThreadWorkletGlobalScope
+ : public WorkletGlobalScope,
+ public WorkletGlobalScopeProxy,
+ public WorkletScriptLoader::Client,
+ public ContextClient {
USING_GARBAGE_COLLECTED_MIXIN(MainThreadWorkletGlobalScope);
public:
@@ -27,7 +31,8 @@ class CORE_EXPORT MainThreadWorkletGlobalScope : public WorkletGlobalScope,
const KURL&,
const String& user_agent,
PassRefPtr<SecurityOrigin>,
- v8::Isolate*);
+ v8::Isolate*,
+ WorkletObjectProxy*);
~MainThreadWorkletGlobalScope() override;
bool IsMainThreadWorkletGlobalScope() const final { return true; }
@@ -37,16 +42,24 @@ class CORE_EXPORT MainThreadWorkletGlobalScope : public WorkletGlobalScope,
WorkerThread* GetThread() const final;
// WorkletGlobalScopeProxy
+ void FetchAndInvokeScript(int32_t request_id, const KURL& script_url) final;
void EvaluateScript(const ScriptSourceCode&) final;
void TerminateWorkletGlobalScope() final;
+ // WorkletScriptLoader::Client
+ void NotifyWorkletScriptLoadingFinished(WorkletScriptLoader*,
+ const ScriptSourceCode&) final;
+
+ // ExecutionContext
void AddConsoleMessage(ConsoleMessage*) final;
void ExceptionThrown(ErrorEvent*) final;
- DEFINE_INLINE_VIRTUAL_TRACE() {
- WorkletGlobalScope::Trace(visitor);
- ContextClient::Trace(visitor);
- }
+ DECLARE_VIRTUAL_TRACE();
+
+ private:
+ HeapHashSet<Member<WorkletScriptLoader>> loader_set_;
+
+ Member<WorkletObjectProxy> object_proxy_;
};
DEFINE_TYPE_CASTS(MainThreadWorkletGlobalScope,

Powered by Google App Engine
This is Rietveld 408576698