gecko-dev/modules/libjar
Kris Maglione 257d9118dc Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj
Right now, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR expects singleton
constructors to return already-addrefed raw pointers, and while it accepts
constructors that return already_AddRefed, most existing don't do so.

Meanwhile, the convention elsewhere is that a raw pointer return value is
owned by the callee, and that the caller needs to addref it if it wants to
keep its own reference to it.

The difference in convention makes it easy to leak (I've definitely caused
more than one shutdown leak this way), so it would be better if we required
the singleton getters to return an explicit already_AddRefed, which would
behave the same for all callers.


This also cleans up several singleton constructors that left a dangling
pointer to their singletons when their initialization methods failed, when
they released their references without clearing their global raw pointers.

MozReview-Commit-ID: 9peyG4pRYcr

--HG--
extra : rebase_source : 2f5bd89c17cb554541be38444672a827c1392f3f
2017-10-16 21:08:42 -07:00
..
test bug 1382749 - remove the "old way" of signing add-ons r=aklotz,mossop 2017-07-19 13:09:46 -07:00
zipwriter Bug 1409329 - NS_NewBufferedOutputStream should take the ownership of the outputStream, r=smaug 2017-10-24 14:38:23 +02:00
appnote.txt
moz.build bug 1382749 - remove the "old way" of signing add-ons r=aklotz,mossop 2017-07-19 13:09:46 -07:00
nsIJARChannel.idl Bug 1376496 - Part 2 - Don't request FD from parent when JAR file is cached. r=mayhemer 2017-07-21 15:19:09 -07:00
nsIJARFactory.h
nsIJARProtocolHandler.idl
nsIJARURI.idl
nsIZipReader.idl bug 1382749 - remove the "old way" of signing add-ons r=aklotz,mossop 2017-07-19 13:09:46 -07:00
nsJAR.cpp Bug 1399520 - Avoid race condition. r=dragana 2017-10-19 22:29:41 -04:00
nsJAR.h Bug 1399520 - Avoid race condition. r=dragana 2017-10-19 22:29:41 -04:00
nsJARChannel.cpp Bug 1405286: Part 1 - Allow retrieving the delivery target from retargetable requests. r=dragana 2017-10-14 18:30:38 -07:00
nsJARChannel.h Bug 1376496 - Part 2 - Don't request FD from parent when JAR file is cached. r=mayhemer 2017-07-21 15:19:09 -07:00
nsJARFactory.cpp
nsJARInputStream.cpp Bug 1340910 - pt 2+3 - Import Brotli 0.6.0 from upstream, and Gecko updates required to work with Brotli 0.6.0 API changes. r=glandium 2017-08-09 11:45:39 +01:00
nsJARInputStream.h Bug 1340910 - pt 2+3 - Import Brotli 0.6.0 from upstream, and Gecko updates required to work with Brotli 0.6.0 API changes. r=glandium 2017-08-09 11:45:39 +01:00
nsJARProtocolHandler.cpp Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj 2017-10-16 21:08:42 -07:00
nsJARProtocolHandler.h Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj 2017-10-16 21:08:42 -07:00
nsJARURI.cpp Bug 1409598 - Change nsIXPCScriptable::className and nsIClassInfo::{contractID,classDescription} from string to AUTF8String. r=froydnj. 2017-10-18 13:17:26 +11:00
nsJARURI.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsZipArchive.cpp Bug 1340910 - pt 2+3 - Import Brotli 0.6.0 from upstream, and Gecko updates required to work with Brotli 0.6.0 API changes. r=glandium 2017-08-09 11:45:39 +01:00
nsZipArchive.h Bug 1340910 - pt 2+3 - Import Brotli 0.6.0 from upstream, and Gecko updates required to work with Brotli 0.6.0 API changes. r=glandium 2017-08-09 11:45:39 +01:00
zipstruct.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00