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

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

Issue 2116113002: [worklets] Make WorkerThread handle both Worker and Worklet global scopes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again 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/core/workers/WorkerThread.h
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.h b/third_party/WebKit/Source/core/workers/WorkerThread.h
index 0e2821a5ab395898fd90ab3d60ad687a2462f6d2..cf23ac89b4d94323be938a80b8ced3ee2ba9136d 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.h
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.h
@@ -30,7 +30,6 @@
#include "core/CoreExport.h"
#include "core/dom/ExecutionContextTask.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
-#include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkerLoaderProxy.h"
#include "core/workers/WorkerThreadLifecycleObserver.h"
#include "platform/LifecycleNotifier.h"
@@ -43,10 +42,11 @@
namespace blink {
+class ConsoleMessageStorage;
class InspectorTaskRunner;
class WorkerBackingThread;
-class WorkerGlobalScope;
class WorkerInspectorController;
+class WorkerOrWorkletGlobalScope;
class WorkerReportingProxy;
class WorkerThreadStartupData;
@@ -109,6 +109,7 @@ public:
static void terminateAndWaitForAllWorkers();
virtual WorkerBackingThread& workerBackingThread() = 0;
+ virtual ConsoleMessageStorage* consoleMessageStorage() = 0;
virtual bool shouldAttachThreadDebugger() const { return true; }
v8::Isolate* isolate();
@@ -134,9 +135,9 @@ public:
void startRunningDebuggerTasksOnPauseOnWorkerThread();
void stopRunningDebuggerTasksOnPauseOnWorkerThread();
- // Can be called only on the worker thread, WorkerGlobalScope is not thread
- // safe.
- WorkerGlobalScope* workerGlobalScope();
+ // Can be called only on the worker thread, WorkerOrWorkletGlobalScope is
+ // not thread safe.
+ WorkerOrWorkletGlobalScope* globalScope();
// Called for creating WorkerThreadLifecycleObserver on both the main thread
// and the worker thread.
@@ -159,7 +160,7 @@ protected:
// Factory method for creating a new worker context for the thread.
// Called on the worker thread.
- virtual WorkerGlobalScope* createWorkerGlobalScope(std::unique_ptr<WorkerThreadStartupData>) = 0;
+ virtual WorkerOrWorkletGlobalScope* createWorkerGlobalScope(std::unique_ptr<WorkerThreadStartupData>) = 0;
// Returns true when this WorkerThread owns the associated
// WorkerBackingThread exclusively. If this function returns true, the
@@ -232,12 +233,11 @@ private:
RefPtr<WorkerLoaderProxy> m_workerLoaderProxy;
WorkerReportingProxy& m_workerReportingProxy;
- // This lock protects |m_workerGlobalScope|, |m_terminated|,
- // |m_readyToShutdown|, |m_runningDebuggerTask|, |m_exitCode| and
- // |m_microtaskRunner|.
+ // This lock protects |m_globalScope|, |m_terminated|, |m_readyToShutdown|,
+ // |m_runningDebuggerTask|, |m_exitCode| and |m_microtaskRunner|.
Mutex m_threadStateMutex;
- Persistent<WorkerGlobalScope> m_workerGlobalScope;
+ Persistent<WorkerOrWorkletGlobalScope> m_globalScope;
// Signaled when the thread starts termination on the main thread.
std::unique_ptr<WaitableEvent> m_terminationEvent;
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerReportingProxy.h ('k') | third_party/WebKit/Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698