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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h

Issue 2277703002: Revert of Streams: Remove isTerminating() calls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h
index 4ea92e4a76b3c06172b01c59bda673e104b5ad5b..1c6d97a0035a194513be3d270de72c9a391b0ac6 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h
+++ b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h
@@ -37,6 +37,7 @@
#include "bindings/core/v8/V8CacheOptions.h"
#include "core/CoreExport.h"
#include "wtf/Allocator.h"
+#include "wtf/ThreadingPrimitives.h"
#include "wtf/text/TextPosition.h"
#include <v8.h>
@@ -56,15 +57,23 @@
void dispose();
bool isExecutionForbidden() const;
+ bool isExecutionTerminating() const;
// Returns true if the evaluation completed with no uncaught exception.
bool evaluate(const ScriptSourceCode&, ErrorEvent** = nullptr, CachedMetadataHandler* = nullptr, V8CacheOptions = V8CacheOptionsDefault);
- // Prevents future JavaScript execution.
+ // Prevents future JavaScript execution. See
+ // willScheduleExecutionTermination, isExecutionForbidden.
void forbidExecution();
// Used by WorkerThread:
bool initializeContextIfNeeded();
+ // Async request to terminate future JavaScript execution on the worker
+ // thread. JavaScript evaluation exits with a non-continuable exception and
+ // WorkerOrWorkletScriptController calls forbidExecution to prevent further
+ // JavaScript execution. Use forbidExecution()/isExecutionForbidden() to
+ // guard against reentry into JavaScript.
+ void willScheduleExecutionTermination();
// Used by WorkerGlobalScope:
void rethrowExceptionFromImportedScript(ErrorEvent*, ExceptionState&);
@@ -101,6 +110,8 @@
RefPtr<DOMWrapperWorld> m_world;
String m_disableEvalPending;
bool m_executionForbidden;
+ bool m_executionScheduledToTerminate;
+ mutable Mutex m_scheduledTerminationMutex;
RefPtr<RejectedPromises> m_rejectedPromises;
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698