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 92c7dbe30e5e2029efd02695376b526fe3649d85..9c3c9bec643250c643eaecdc737a896cf31d4e08 100644 |
--- a/third_party/WebKit/Source/core/workers/WorkerThread.h |
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.h |
@@ -32,6 +32,7 @@ |
#include "core/frame/csp/ContentSecurityPolicy.h" |
#include "core/workers/WorkerGlobalScope.h" |
#include "core/workers/WorkerLoaderProxy.h" |
+#include "core/workers/WorkerThreadLifecycleObserver.h" |
#include "wtf/Forward.h" |
#include "wtf/Functional.h" |
#include "wtf/OwnPtr.h" |
@@ -53,6 +54,10 @@ enum WorkerThreadStartMode { |
PauseWorkerGlobalScopeOnStart |
}; |
+class WorkerThreadContext : public GarbageCollectedFinalized<WorkerThreadContext>, public LifecycleNotifier<WorkerThreadContext, WorkerThreadLifecycleObserver> { |
+ USING_GARBAGE_COLLECTED_MIXIN(WorkerThreadContext); |
+}; |
+ |
// WorkerThread is a kind of WorkerBackingThread client. Each worker mechanism |
// can access the lower thread infrastructure via an implementation of this |
// abstract class. Multiple WorkerThreads can share one WorkerBackingThread. |
@@ -123,6 +128,11 @@ public: |
ExitCode getExitCode(); |
+ WorkerThreadContext* workerThreadContext() |
+ { |
+ return m_workerThreadContext.get(); |
+ } |
+ |
protected: |
WorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerReportingProxy&); |
@@ -196,6 +206,8 @@ private: |
// Scheduled when termination starts with TerminationMode::Force, and |
// cancelled when the worker thread is gracefully shut down. |
OwnPtr<ForceTerminationTask> m_scheduledForceTerminationTask; |
+ |
+ Persistent<WorkerThreadContext> m_workerThreadContext; |
}; |
} // namespace blink |