PSA: new helper class for MozPromise in DOM code

2018-04-26 Thread Ben Kelly
Hi all, I pushed a new helper class to inbound today to make it easier to work with MozPromise in DOM code. Specifically, it allows you to auto-disconnect a Thenable request when the global dies. The class is called DOMMozPromiseRequestHolder. Here is an example using it: #include "mozilla

Re: PSA: new helper class for MozPromise in DOM code

2018-04-26 Thread Kris Maglione
On Thu, Apr 26, 2018 at 04:12:09PM -0400, Ben Kelly wrote: I pushed a new helper class to inbound today to make it easier to work with MozPromise in DOM code. Specifically, it allows you to auto-disconnect a Thenable request when the global dies. Thank you! I've been worried about these kinds

Re: PSA: new helper class for MozPromise in DOM code

2018-04-27 Thread Jean-Yves Avenard
Hi > On 26 Apr 2018, at 10:12 pm, Ben Kelly wrote: > > Hi all, > > I pushed a new helper class to inbound today to make it easier to work with > MozPromise in DOM code. Specifically, it allows you to auto-disconnect a > Thenable request when the global dies. > > The class is called DOMMozProm

Re: PSA: new helper class for MozPromise in DOM code

2018-04-27 Thread Ben Kelly
On Fri, Apr 27, 2018, 3:13 AM Jean-Yves Avenard wrote: > > The class is called DOMMozPromiseRequestHolder. Here is an example using > > it: > > is that just a refcounted version of MozPromiseRequestHolder? > No. It binds to the global and calls DisconnectIfExists() when the global invokes Disc