Index: third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.h |
diff --git a/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h b/third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.h |
similarity index 25% |
copy from third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h |
copy to third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.h |
index 2d4e966d5e713fd2b31451c3b5390c76a2f9fef8..a0b5f79f30857b7e08b462dc99cc8c2fe051b214 100644 |
--- a/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h |
+++ b/third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.h |
@@ -2,46 +2,41 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef MainThreadWorkletGlobalScope_h |
-#define MainThreadWorkletGlobalScope_h |
+#ifndef ThreadedWorkletGlobalScope_h |
+#define ThreadedWorkletGlobalScope_h |
#include "core/CoreExport.h" |
-#include "core/dom/ExecutionContext.h" |
-#include "core/frame/LocalFrameLifecycleObserver.h" |
#include "core/workers/WorkletGlobalScope.h" |
-#include "core/workers/WorkletGlobalScopeProxy.h" |
namespace blink { |
-class ConsoleMessage; |
-class LocalFrame; |
-class ScriptSourceCode; |
+class ConsoleMessageStorage; |
+class WorkerInspectorController; |
+class WorkerThread; |
-class CORE_EXPORT MainThreadWorkletGlobalScope : public WorkletGlobalScope, public WorkletGlobalScopeProxy, public LocalFrameLifecycleObserver { |
+class CORE_EXPORT ThreadedWorkletGlobalScope : public WorkletGlobalScope { |
public: |
- ~MainThreadWorkletGlobalScope() override; |
- bool isMainThreadWorkletGlobalScope() const final { return true; } |
+ ~ThreadedWorkletGlobalScope() override; |
+ void dispose() final; |
- // WorkletGlobalScopeProxy |
- void evaluateScript(const ScriptSourceCode&) final; |
- void terminateWorkletGlobalScope() final; |
- |
- using LocalFrameLifecycleObserver::frame; |
+ // ExecutionContext |
+ bool isThreadedWorkletGlobalScope() const final { return true; } |
+ bool isContextThread() const final; |
+ void postTask(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>, const String& taskNameForInstrumentation) final; |
void addConsoleMessage(ConsoleMessage*) final; |
void exceptionThrown(ErrorEvent*) final; |
- DEFINE_INLINE_VIRTUAL_TRACE() |
- { |
- WorkletGlobalScope::trace(visitor); |
- LocalFrameLifecycleObserver::trace(visitor); |
- } |
+ WorkerThread* thread() const { return m_thread; } |
protected: |
- MainThreadWorkletGlobalScope(LocalFrame*, const KURL&, const String& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*); |
+ ThreadedWorkletGlobalScope(const KURL&, const String& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*, WorkerThread*); |
+ |
+private: |
+ WorkerThread* m_thread; |
}; |
-DEFINE_TYPE_CASTS(MainThreadWorkletGlobalScope, ExecutionContext, context, context->isMainThreadWorkletGlobalScope(), context.isMainThreadWorkletGlobalScope()); |
+DEFINE_TYPE_CASTS(ThreadedWorkletGlobalScope, ExecutionContext, context, context->isThreadedWorkletGlobalScope(), context.isThreadedWorkletGlobalScope()); |
} // namespace blink |
-#endif // MainThreadWorkletGlobalScope_h |
+#endif // ThreadedWorkletGlobalScope_h |