tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 120f48b684865bbc169066d3236d4469026779e9
parent e78b98f730ecd5918e4ee804a70a21abbe478d04
Author: Matthew Gaudet <mgaudet@mozilla.com>
Date:   Fri, 28 Nov 2025 16:31:04 +0000

Bug 2002035 - Remove unnecessary barriers in MustConsumeMicroTaskRunnable r=jonco

Differential Revision: https://phabricator.services.mozilla.com/D274352

Diffstat:
Mxpcom/base/CycleCollectedJSContext.h | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xpcom/base/CycleCollectedJSContext.h b/xpcom/base/CycleCollectedJSContext.h @@ -109,7 +109,9 @@ class SuppressedMicroTasks : public MicroTaskRunnable { // A gecko wrapper for the JS::MicroTask type. Used to enforce both // that this is handled move only, but also that we have succesfully // consumed this microtask before destruction. -class MustConsumeMicroTask { +// +// This type must be rooted, it holds onto a JS reference. +class MOZ_STACK_CLASS MustConsumeMicroTask { public: // We need a public constructor to allow forward declared Rooted MustConsumeMicroTask() = default; @@ -253,14 +255,14 @@ class MustConsumeMicroTask { } void trace(JSTracer* aTrc) { - TraceEdge(aTrc, &mMicroTask, "MustConsumeMicroTask value"); + TraceRoot(aTrc, &mMicroTask, "MustConsumeMicroTask value"); } private: explicit MustConsumeMicroTask(JS::GenericMicroTask&& aMicroTask) : mMicroTask(aMicroTask) {} - JS::Heap<JS::GenericMicroTask> mMicroTask; + JS::GenericMicroTask mMicroTask; }; class SuppressedMicroTaskList final : public MicroTaskRunnable {