Index: Source/core/workers/WorkerThread.h |
diff --git a/Source/core/workers/WorkerThread.h b/Source/core/workers/WorkerThread.h |
index 2405c86493da3a2d74d818d58207bc8e2333576c..cc969a6ae3f4835d229be567d7867bb2ef3322ca 100644 |
--- a/Source/core/workers/WorkerThread.h |
+++ b/Source/core/workers/WorkerThread.h |
@@ -31,6 +31,7 @@ |
#include "core/dom/ExecutionContextTask.h" |
#include "core/frame/csp/ContentSecurityPolicy.h" |
#include "core/workers/WorkerGlobalScope.h" |
+#include "core/workers/WorkerIsolateWrapper.h" |
#include "core/workers/WorkerLoaderProxy.h" |
#include "platform/WebThreadSupportingGC.h" |
#include "platform/weborigin/SecurityOrigin.h" |
@@ -69,11 +70,10 @@ public: |
// some implementations can use an existing thread that is already being |
// used by other workers (e.g. compositor workers). |
virtual WebThreadSupportingGC& backingThread() = 0; |
- |
virtual void didStartRunLoop(); |
virtual void didStopRunLoop(); |
- v8::Isolate* isolate() const { return m_isolate; } |
+ v8::Isolate* isolate(); |
// Can be used to wait for this worker thread to shut down. |
// (This is signalled on the main thread, so it's assumed to be waited on the worker context thread) |
@@ -122,9 +122,14 @@ protected: |
virtual void postInitialize() { } |
- virtual v8::Isolate* initializeIsolate(); |
- virtual void willDestroyIsolate(); |
- virtual void destroyIsolate(); |
+ // Both of these methods are called in the worker thread. |
+ virtual void initializeBackingThread(); |
+ virtual void shutdownBackingThread(); |
+ |
+ // The WorkerIsolateWrapper is created in the worker thread. |
+ virtual PassOwnPtr<WorkerIsolateWrapper> createIsolateWrapper(); |
+ |
+ // This is called on the main-thread. |
virtual void terminateV8Execution(); |
// This is protected virtual for testing. |
@@ -155,13 +160,11 @@ private: |
RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorController; |
Mutex m_workerInspectorControllerMutex; |
- // This lock protects |m_workerGlobalScope|, |m_terminated|, |m_isolate| and |m_microtaskRunner|. |
+ // This lock protects |m_workerGlobalScope|, |m_terminated|, and |m_isolateWrapper|. |
Mutex m_threadStateMutex; |
RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope; |
- |
- v8::Isolate* m_isolate; |
- OwnPtr<V8IsolateInterruptor> m_interruptor; |
+ OwnPtr<WorkerIsolateWrapper> m_isolateWrapper; |
// Used to signal thread shutdown. |
OwnPtr<WebWaitableEvent> m_shutdownEvent; |