Closed Bug 1573623 Opened Last month Closed Last month

Add support for callables to ClearOnShutdown

Categories

(Core :: XPCOM, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: aklotz, Assigned: aklotz)

Details

Attachments

(1 file)

It would be nice to be able to use ClearOnShutdown for more than just clearing smart pointers. This would allow us to avoid nsIObserver boilerplate.

This patch adds an overload to ClearOnShutdown that allows to the caller to
supply any callable. This would be nice so that we can do more than just clear
smart pointers without needing to write a bunch of observer service boilerplate.

We use std::function to hold the callable.

Attachment #9085204 - Attachment description: Bug 1573623: Add support for passing callables to ClearOnShutdown; r=froydnj! → Bug 1573623: Add RunOnShutdown, a variant of ClearOnShutdown which supports passing callables; r=froydnj!
Pushed by aklotz@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f510b32aec3a
Add RunOnShutdown, a variant of ClearOnShutdown which supports passing callables; r=froydnj
Status: ASSIGNED → RESOLVED
Closed: Last month
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.