summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/bindings/js/WorkerScriptController.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/bindings/js/WorkerScriptController.h')
-rw-r--r--Source/WebCore/bindings/js/WorkerScriptController.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/Source/WebCore/bindings/js/WorkerScriptController.h b/Source/WebCore/bindings/js/WorkerScriptController.h
index c3b8215..0e52988 100644
--- a/Source/WebCore/bindings/js/WorkerScriptController.h
+++ b/Source/WebCore/bindings/js/WorkerScriptController.h
@@ -29,7 +29,7 @@
#if ENABLE(WORKERS)
-#include <collector/handles/Global.h>
+#include <heap/Strong.h>
#include <wtf/Forward.h>
#include <wtf/Threading.h>
@@ -61,9 +61,17 @@ namespace WebCore {
void setException(ScriptValue);
- enum ForbidExecutionOption { TerminateRunningScript, LetRunningScriptFinish };
- void forbidExecution(ForbidExecutionOption);
- bool isExecutionForbidden() const { return m_executionForbidden; }
+ // Async request to terminate a JS run execution. Eventually causes termination
+ // exception raised during JS execution, if the worker thread happens to run JS.
+ // After JS execution was terminated in this way, the Worker thread has to use
+ // forbidExecution()/isExecutionForbidden() to guard against reentry into JS.
+ // Can be called from any thread.
+ void scheduleExecutionTermination();
+
+ // Called on Worker thread when JS exits with termination exception caused by forbidExecution() request,
+ // or by Worker thread termination code to prevent future entry into JS.
+ void forbidExecution();
+ bool isExecutionForbidden() const;
JSC::JSGlobalData* globalData() { return m_globalData.get(); }
@@ -77,9 +85,7 @@ namespace WebCore {
RefPtr<JSC::JSGlobalData> m_globalData;
WorkerContext* m_workerContext;
- JSC::Global<JSWorkerContext> m_workerContextWrapper;
-
- Mutex m_sharedDataMutex;
+ JSC::Strong<JSWorkerContext> m_workerContextWrapper;
bool m_executionForbidden;
};