summaryrefslogtreecommitdiffstats
path: root/dom/workers/WorkerThread.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/workers/WorkerThread.h')
-rw-r--r--dom/workers/WorkerThread.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/dom/workers/WorkerThread.h b/dom/workers/WorkerThread.h
index 06624f60c1..8da085b51b 100644
--- a/dom/workers/WorkerThread.h
+++ b/dom/workers/WorkerThread.h
@@ -25,9 +25,6 @@ namespace dom {
class WorkerRunnable;
class WorkerPrivate;
-template <class>
-class WorkerPrivateParent;
-
namespace workerinternals {
class RuntimeService;
}
@@ -38,7 +35,6 @@ class RuntimeService;
class WorkerThreadFriendKey {
friend class workerinternals::RuntimeService;
friend class WorkerPrivate;
- friend class WorkerPrivateParent<WorkerPrivate>;
WorkerThreadFriendKey();
~WorkerThreadFriendKey();
@@ -76,6 +72,13 @@ class WorkerThread final : public nsThread {
void SetWorker(const WorkerThreadFriendKey& aKey,
WorkerPrivate* aWorkerPrivate);
+ // This method is used to decouple the connection with the WorkerPrivate which
+ // is set in SetWorker(). And it also clears all pending runnables on this
+ // WorkerThread.
+ // After decoupling, WorkerThreadRunnable can not run on this WorkerThread
+ // anymore, since WorkerPrivate is invalid.
+ void ClearEventQueueAndWorker(const WorkerThreadFriendKey& aKey);
+
nsresult DispatchPrimaryRunnable(const WorkerThreadFriendKey& aKey,
already_AddRefed<nsIRunnable> aRunnable);