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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.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/WorkerOrWorkletGlobalScope.h
diff --git a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h
index 0127a065141280b0587431d5274464925a8153ee..c0f7ed63862e08ff08bf960d2ba5460074016927 100644
--- a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h
+++ b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h
@@ -16,6 +16,16 @@ class CORE_EXPORT WorkerOrWorkletGlobalScope : public ExecutionContext {
public:
virtual ScriptWrappable* getScriptWrappable() const = 0;
virtual WorkerOrWorkletScriptController* scriptController() = 0;
+
+ // Returns true when the WorkerOrWorkletGlobalScope is closing (e.g. via
+ // WorkerGlobalScope#close() method). If this returns true, the worker is
+ // going to be shutdown after the current task execution. Globals that
+ // don't support close operation should always return false.
+ virtual bool isClosing() const = 0;
+
+ // Should be called before destroying the global scope object. Allows
+ // sub-classes to perform any cleanup needed.
+ virtual void dispose() = 0;
};
DEFINE_TYPE_CASTS(WorkerOrWorkletGlobalScope, ExecutionContext, context, (context->isWorkerGlobalScope() || context->isWorkletGlobalScope()), (context.isWorkerGlobalScope() || context.isWorkletGlobalScope()));

Powered by Google App Engine
This is Rietveld 408576698