Bug 1514936, part 2 - Drop the outer arguments from static components. r=xpcom-reviewers,nika

Differential Revision: https://phabricator.services.mozilla.com/D146457
This commit is contained in:
Andrew McCreight 2022-05-17 20:24:19 +00:00
Родитель c8c5c819df
Коммит fa8bfd1245
88 изменённых файлов: 155 добавлений и 392 удалений

Просмотреть файл

@ -277,8 +277,7 @@ AboutRedirector::GetChromeURI(nsIURI* aURI, nsIURI** chromeURI) {
return NS_ERROR_ILLEGAL_VALUE;
}
nsresult AboutRedirector::Create(nsISupports* aOuter, REFNSIID aIID,
void** result) {
nsresult AboutRedirector::Create(REFNSIID aIID, void** result) {
AboutRedirector* about = new AboutRedirector();
if (about == nullptr) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(about);

Просмотреть файл

@ -18,7 +18,7 @@ class AboutRedirector : public nsIAboutModule {
AboutRedirector() {}
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
protected:
virtual ~AboutRedirector() {}

Просмотреть файл

@ -133,8 +133,8 @@ Class definitions may have the following properties:
The fully-qualified name of a constructor function to call in order to
create instances of this class. This function must be declared in one of the
headers listed in the ``headers`` property, and must have the signature
``nsresult(nsISupports* aOuter, const nsID& aIID, void** aResult)``, and
behave equivalently to ``nsIFactory::CreateInstance``.
``nsresult(const nsID& aIID, void** aResult)``, and behave equivalently to
``nsIFactory::CreateInstance``.
This property is incompatible with ``constructor``.

Просмотреть файл

@ -284,8 +284,7 @@ nsAboutRedirector::GetChromeURI(nsIURI* aURI, nsIURI** chromeURI) {
return NS_ERROR_ILLEGAL_VALUE;
}
nsresult nsAboutRedirector::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult nsAboutRedirector::Create(REFNSIID aIID, void** aResult) {
RefPtr<nsAboutRedirector> about = new nsAboutRedirector();
return about->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -17,7 +17,7 @@ class nsAboutRedirector : public nsIAboutModule {
nsAboutRedirector() {}
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
protected:
virtual ~nsAboutRedirector() {}

Просмотреть файл

@ -494,7 +494,7 @@ bool DecryptingInputStream<CipherStrategy>::Deserialize(
const auto& params = aParams.get_EncryptedFileInputStreamParams();
nsCOMPtr<nsIFileInputStream> stream;
nsFileInputStream::Create(nullptr, NS_GET_IID(nsIFileInputStream),
nsFileInputStream::Create(NS_GET_IID(nsIFileInputStream),
getter_AddRefs(stream));
nsCOMPtr<nsIIPCSerializableInputStream> baseSerializable =
do_QueryInterface(stream);

Просмотреть файл

@ -100,18 +100,13 @@ SDBConnection::~SDBConnection() {
}
// static
nsresult SDBConnection::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult SDBConnection::Create(REFNSIID aIID, void** aResult) {
MOZ_ASSERT(aResult);
if (NS_WARN_IF(!Preferences::GetBool(kPrefSimpleDBEnabled, false))) {
return NS_ERROR_NOT_AVAILABLE;
}
if (aOuter) {
return NS_ERROR_NO_AGGREGATION;
}
RefPtr<SDBConnection> connection = new SDBConnection();
nsresult rv = connection->QueryInterface(aIID, aResult);

Просмотреть файл

@ -52,7 +52,7 @@ class SDBConnection final : public nsISDBConnection {
bool mAllowedToClose;
public:
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
void AssertIsOnOwningThread() const { NS_ASSERT_OWNINGTHREAD(SDBConnection); }

Просмотреть файл

@ -130,8 +130,7 @@ class nsXULPrototypeCache : public nsIObserver {
nsISupports* aData);
protected:
friend nsresult NS_NewXULPrototypeCache(nsISupports* aOuter, REFNSIID aIID,
void** aResult);
friend nsresult NS_NewXULPrototypeCache(REFNSIID aIID, void** aResult);
nsXULPrototypeCache();
virtual ~nsXULPrototypeCache() = default;

Просмотреть файл

@ -150,29 +150,29 @@ already_AddRefed<nsIInputStream> InputStreamHelper::DeserializeInputStream(
case InputStreamParams::TFileInputStreamParams: {
nsCOMPtr<nsIFileInputStream> stream;
nsFileInputStream::Create(nullptr, NS_GET_IID(nsIFileInputStream),
nsFileInputStream::Create(NS_GET_IID(nsIFileInputStream),
getter_AddRefs(stream));
serializable = do_QueryInterface(stream);
} break;
case InputStreamParams::TBufferedInputStreamParams: {
nsCOMPtr<nsIBufferedInputStream> stream;
nsBufferedInputStream::Create(nullptr, NS_GET_IID(nsIBufferedInputStream),
nsBufferedInputStream::Create(NS_GET_IID(nsIBufferedInputStream),
getter_AddRefs(stream));
serializable = do_QueryInterface(stream);
} break;
case InputStreamParams::TMIMEInputStreamParams: {
nsCOMPtr<nsIMIMEInputStream> stream;
nsMIMEInputStreamConstructor(nullptr, NS_GET_IID(nsIMIMEInputStream),
nsMIMEInputStreamConstructor(NS_GET_IID(nsIMIMEInputStream),
getter_AddRefs(stream));
serializable = do_QueryInterface(stream);
} break;
case InputStreamParams::TMultiplexInputStreamParams: {
nsCOMPtr<nsIMultiplexInputStream> stream;
nsMultiplexInputStreamConstructor(
nullptr, NS_GET_IID(nsIMultiplexInputStream), getter_AddRefs(stream));
nsMultiplexInputStreamConstructor(NS_GET_IID(nsIMultiplexInputStream),
getter_AddRefs(stream));
serializable = do_QueryInterface(stream);
} break;

Просмотреть файл

@ -131,9 +131,8 @@ nsresult NS_NewParentProcessMessageManager(nsISupports** aResult);
nsresult NS_NewChildProcessMessageManager(nsISupports** aResult);
#define MAKE_CTOR(ctor_, iface_, func_) \
nsresult ctor_(nsISupports* aOuter, REFNSIID aIID, void** aResult) { \
nsresult ctor_(REFNSIID aIID, void** aResult) { \
*aResult = nullptr; \
if (aOuter) return NS_ERROR_NO_AGGREGATION; \
iface_* inst; \
nsresult rv = func_(&inst); \
if (NS_SUCCEEDED(rv)) { \
@ -182,15 +181,10 @@ MAKE_GENERIC_CTOR(nsIFocusManager, NS_NewFocusManager)
// views are not refcounted, so this is the same as
// NS_GENERIC_FACTORY_CONSTRUCTOR without the NS_ADDREF/NS_RELEASE
#define NS_GENERIC_FACTORY_CONSTRUCTOR_NOREFS(_InstanceClass) \
static nsresult _InstanceClass##Constructor(nsISupports* aOuter, \
REFNSIID aIID, void** aResult) { \
static nsresult _InstanceClass##Constructor(REFNSIID aIID, void** aResult) { \
nsresult rv; \
\
*aResult = nullptr; \
if (nullptr != aOuter) { \
rv = NS_ERROR_NO_AGGREGATION; \
return rv; \
} \
\
_InstanceClass* inst = new _InstanceClass(); \
if (nullptr == inst) { \
@ -208,11 +202,9 @@ MAKE_GENERIC_CTOR(nsIFocusManager, NS_NewFocusManager)
MAKE_GENERIC_CTOR(nsIAccessibilityService, NS_GetAccessibilityService)
#endif
nsresult Construct_nsIScriptSecurityManager(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult Construct_nsIScriptSecurityManager(REFNSIID aIID, void** aResult) {
if (!aResult) return NS_ERROR_NULL_POINTER;
*aResult = nullptr;
if (aOuter) return NS_ERROR_NO_AGGREGATION;
nsScriptSecurityManager* obj =
nsScriptSecurityManager::GetScriptSecurityManager();
if (!obj) return NS_ERROR_OUT_OF_MEMORY;
@ -220,8 +212,7 @@ nsresult Construct_nsIScriptSecurityManager(nsISupports* aOuter, REFNSIID aIID,
return NS_OK;
}
nsresult LocalStorageManagerConstructor(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult LocalStorageManagerConstructor(REFNSIID aIID, void** aResult) {
if (NextGenLocalStorageEnabled()) {
RefPtr<LocalStorageManager2> manager = new LocalStorageManager2();
return manager->QueryInterface(aIID, aResult);
@ -231,8 +222,7 @@ nsresult LocalStorageManagerConstructor(nsISupports* aOuter, REFNSIID aIID,
return manager->QueryInterface(aIID, aResult);
}
nsresult SessionStorageManagerConstructor(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult SessionStorageManagerConstructor(REFNSIID aIID, void** aResult) {
RefPtr<SessionStorageManager> manager = new SessionStorageManager(nullptr);
return manager->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -21,29 +21,18 @@ void nsLayoutModuleInitialize();
void nsLayoutModuleDtor();
nsresult CreateXMLContentSerializer(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreateHTMLContentSerializer(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreateXHTMLContentSerializer(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreatePlainTextSerializer(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreateContentPolicy(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreateGlobalMessageManager(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreateParentMessageManager(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreateChildMessageManager(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreateXMLContentSerializer(const nsID& aIID, void** aResult);
nsresult CreateHTMLContentSerializer(const nsID& aIID, void** aResult);
nsresult CreateXHTMLContentSerializer(const nsID& aIID, void** aResult);
nsresult CreatePlainTextSerializer(const nsID& aIID, void** aResult);
nsresult CreateContentPolicy(const nsID& aIID, void** aResult);
nsresult CreateGlobalMessageManager(const nsID& aIID, void** aResult);
nsresult CreateParentMessageManager(const nsID& aIID, void** aResult);
nsresult CreateChildMessageManager(const nsID& aIID, void** aResult);
nsresult Construct_nsIScriptSecurityManager(nsISupports* aOuter,
const nsIID& aIID, void** aResult);
nsresult LocalStorageManagerConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult SessionStorageManagerConstructor(nsISupports* aOuter,
const nsIID& aIID, void** aResult);
nsresult Construct_nsIScriptSecurityManager(const nsIID& aIID, void** aResult);
nsresult LocalStorageManagerConstructor(const nsIID& aIID, void** aResult);
nsresult SessionStorageManagerConstructor(const nsIID& aIID, void** aResult);
already_AddRefed<nsIPresentationService> NS_CreatePresentationService();

Просмотреть файл

@ -436,16 +436,11 @@ void Predictor::Shutdown() {
mInitialized = false;
}
nsresult Predictor::Create(nsISupports* aOuter, const nsIID& aIID,
void** aResult) {
nsresult Predictor::Create(const nsIID& aIID, void** aResult) {
MOZ_ASSERT(NS_IsMainThread());
nsresult rv;
if (aOuter != nullptr) {
return NS_ERROR_NO_AGGREGATION;
}
RefPtr<Predictor> svc = new Predictor();
if (IsNeckoChild()) {
NeckoChild::InitNeckoChild();

Просмотреть файл

@ -56,7 +56,7 @@ class Predictor final : public nsINetworkPredictor,
nsresult Init();
void Shutdown();
static nsresult Create(nsISupports* outer, const nsIID& iid, void** result);
static nsresult Create(const nsIID& iid, void** result);
// Used to update whether a particular URI was cacheable or not.
// sourceURI and targetURI are the same as the arguments to Learn

Просмотреть файл

@ -311,10 +311,7 @@ NS_IMPL_CI_INTERFACE_GETTER(nsBufferedInputStream, nsIInputStream,
nsIBufferedInputStream, nsISeekableStream,
nsITellableStream, nsIStreamBufferAccess)
nsresult nsBufferedInputStream::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
NS_ENSURE_NO_AGGREGATION(aOuter);
nsresult nsBufferedInputStream::Create(REFNSIID aIID, void** aResult) {
RefPtr<nsBufferedInputStream> stream = new nsBufferedInputStream();
return stream->QueryInterface(aIID, aResult);
}
@ -837,10 +834,7 @@ NS_INTERFACE_MAP_BEGIN(nsBufferedOutputStream)
NS_INTERFACE_MAP_ENTRY(nsIStreamBufferAccess)
NS_INTERFACE_MAP_END_INHERITING(nsBufferedStream)
nsresult nsBufferedOutputStream::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
NS_ENSURE_NO_AGGREGATION(aOuter);
nsresult nsBufferedOutputStream::Create(REFNSIID aIID, void** aResult) {
RefPtr<nsBufferedOutputStream> stream = new nsBufferedOutputStream();
return stream->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -89,7 +89,7 @@ class nsBufferedInputStream final : public nsBufferedStream,
nsBufferedInputStream() : nsBufferedStream() {}
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
nsIInputStream* Source() { return (nsIInputStream*)mStream.get(); }
@ -145,7 +145,7 @@ class nsBufferedOutputStream : public nsBufferedStream,
nsBufferedOutputStream() : nsBufferedStream() {}
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
nsIOutputStream* Sink() { return (nsIOutputStream*)mStream.get(); }

Просмотреть файл

@ -404,10 +404,7 @@ NS_IMPL_CI_INTERFACE_GETTER(nsFileInputStream, nsIInputStream,
nsIFileInputStream, nsISeekableStream,
nsITellableStream, nsILineInputStream)
nsresult nsFileInputStream::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
NS_ENSURE_NO_AGGREGATION(aOuter);
nsresult nsFileInputStream::Create(REFNSIID aIID, void** aResult) {
RefPtr<nsFileInputStream> stream = new nsFileInputStream();
return stream->QueryInterface(aIID, aResult);
}
@ -654,10 +651,7 @@ nsFileInputStream::Clone(nsIInputStream** aResult) {
NS_IMPL_ISUPPORTS_INHERITED(nsFileOutputStream, nsFileStreamBase,
nsIOutputStream, nsIFileOutputStream)
nsresult nsFileOutputStream::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
NS_ENSURE_NO_AGGREGATION(aOuter);
nsresult nsFileOutputStream::Create(REFNSIID aIID, void** aResult) {
RefPtr<nsFileOutputStream> stream = new nsFileOutputStream();
return stream->QueryInterface(aIID, aResult);
}
@ -877,10 +871,7 @@ nsSafeFileOutputStream::Finish() {
////////////////////////////////////////////////////////////////////////////////
// nsFileStream
nsresult nsFileStream::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
NS_ENSURE_NO_AGGREGATION(aOuter);
nsresult nsFileStream::Create(REFNSIID aIID, void** aResult) {
RefPtr<nsFileStream> stream = new nsFileStream();
return stream->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -150,7 +150,7 @@ class nsFileInputStream : public nsFileStreamBase,
nsFileInputStream() : mLineBuffer(nullptr) {}
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
protected:
virtual ~nsFileInputStream() = default;
@ -196,7 +196,7 @@ class nsFileOutputStream : public nsFileStreamBase, public nsIFileOutputStream {
NS_DECL_NSIFILEOUTPUTSTREAM
NS_FORWARD_NSIOUTPUTSTREAM(nsFileStreamBase::)
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
nsresult InitWithFileDescriptor(const mozilla::ipc::FileDescriptor& aFd);
protected:
@ -255,7 +255,7 @@ class nsFileStream : public nsFileStreamBase,
public nsIOutputStream,
public nsIFileStream {
public:
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIFILESTREAM

Просмотреть файл

@ -853,10 +853,7 @@ nsIncrementalDownload::OnRedirectVerifyCallback(nsresult result) {
return NS_OK;
}
extern nsresult net_NewIncrementalDownload(nsISupports* outer, const nsIID& iid,
void** result) {
if (outer) return NS_ERROR_NO_AGGREGATION;
extern nsresult net_NewIncrementalDownload(const nsIID& iid, void** result) {
RefPtr<nsIncrementalDownload> d = new nsIncrementalDownload();
return d->QueryInterface(iid, result);
}

Просмотреть файл

@ -20,10 +20,7 @@ nsIncrementalStreamLoader::Init(nsIIncrementalStreamLoaderObserver* observer) {
return NS_OK;
}
nsresult nsIncrementalStreamLoader::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
if (aOuter) return NS_ERROR_NO_AGGREGATION;
nsresult nsIncrementalStreamLoader::Create(REFNSIID aIID, void** aResult) {
RefPtr<nsIncrementalStreamLoader> it = new nsIncrementalStreamLoader();
return it->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -26,7 +26,7 @@ class nsIncrementalStreamLoader final
nsIncrementalStreamLoader();
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
protected:
~nsIncrementalStreamLoader() = default;

Просмотреть файл

@ -309,12 +309,9 @@ NS_IMETHODIMP nsMIMEInputStream::SetEOF(void) {
* Factory method used by do_CreateInstance
*/
nsresult nsMIMEInputStreamConstructor(nsISupports* outer, REFNSIID iid,
void** result) {
nsresult nsMIMEInputStreamConstructor(REFNSIID iid, void** result) {
*result = nullptr;
if (outer) return NS_ERROR_NO_AGGREGATION;
RefPtr<nsMIMEInputStream> inst = new nsMIMEInputStream();
if (!inst) return NS_ERROR_OUT_OF_MEMORY;

Просмотреть файл

@ -19,7 +19,6 @@
} \
}
extern nsresult nsMIMEInputStreamConstructor(nsISupports* outer, REFNSIID iid,
void** result);
extern nsresult nsMIMEInputStreamConstructor(REFNSIID iid, void** result);
#endif // _nsMIMEInputStream_h_

Просмотреть файл

@ -185,7 +185,7 @@ Result<nsCOMPtr<nsIOutputStream>, nsresult> NS_NewLocalFileOutputStream(
nsresult NS_NewLocalFileOutputStream(nsIOutputStream** result,
const mozilla::ipc::FileDescriptor& fd) {
nsCOMPtr<nsIFileOutputStream> out;
nsFileOutputStream::Create(nullptr, NS_GET_IID(nsIFileOutputStream),
nsFileOutputStream::Create(NS_GET_IID(nsIFileOutputStream),
getter_AddRefs(out));
nsresult rv =
@ -1343,7 +1343,7 @@ nsresult NS_NewBufferedOutputStream(
nsCOMPtr<nsIBufferedInputStream> in;
nsresult rv = nsBufferedInputStream::Create(
nullptr, NS_GET_IID(nsIBufferedInputStream), getter_AddRefs(in));
NS_GET_IID(nsIBufferedInputStream), getter_AddRefs(in));
if (NS_SUCCEEDED(rv)) {
rv = in->Init(inputStream, aBufferSize);
if (NS_SUCCEEDED(rv)) {

Просмотреть файл

@ -25,10 +25,7 @@ nsStreamLoader::Init(nsIStreamLoaderObserver* aStreamObserver,
return NS_OK;
}
nsresult nsStreamLoader::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
if (aOuter) return NS_ERROR_NO_AGGREGATION;
nsresult nsStreamLoader::Create(REFNSIID aIID, void** aResult) {
RefPtr<nsStreamLoader> it = new nsStreamLoader();
return it->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -28,7 +28,7 @@ class nsStreamLoader final : public nsIStreamLoader,
nsStreamLoader();
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
protected:
~nsStreamLoader() = default;

Просмотреть файл

@ -89,17 +89,10 @@ static BaseWebSocketChannel* WebSocketChannelConstructor(bool aSecure) {
}
#define WEB_SOCKET_HANDLER_CONSTRUCTOR(type, secure) \
nsresult type##Constructor(nsISupports* aOuter, REFNSIID aIID, \
void** aResult) { \
nsresult rv; \
\
nsresult type##Constructor(REFNSIID aIID, void** aResult) { \
RefPtr<BaseWebSocketChannel> inst; \
\
*aResult = nullptr; \
if (nullptr != aOuter) { \
rv = NS_ERROR_NO_AGGREGATION; \
return rv; \
} \
inst = WebSocketChannelConstructor(secure); \
return inst->QueryInterface(aIID, aResult); \
}
@ -153,15 +146,10 @@ static const mozilla::Module::CategoryEntry kNeckoCategories[] = {
NS_BINARYDETECTOR_CATEGORYENTRY,
{nullptr}};
nsresult CreateNewStreamConvServiceFactory(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult CreateNewStreamConvServiceFactory(REFNSIID aIID, void** aResult) {
if (!aResult) {
return NS_ERROR_INVALID_POINTER;
}
if (aOuter) {
*aResult = nullptr;
return NS_ERROR_NO_AGGREGATION;
}
RefPtr<nsStreamConverterService> inst;
nsresult rv = NS_NewStreamConv(getter_AddRefs(inst));
if (NS_FAILED(rv)) {
@ -175,15 +163,10 @@ nsresult CreateNewStreamConvServiceFactory(nsISupports* aOuter, REFNSIID aIID,
return rv;
}
nsresult CreateNewMultiMixedConvFactory(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult CreateNewMultiMixedConvFactory(REFNSIID aIID, void** aResult) {
if (!aResult) {
return NS_ERROR_INVALID_POINTER;
}
if (aOuter) {
*aResult = nullptr;
return NS_ERROR_NO_AGGREGATION;
}
RefPtr<nsMultiMixedConv> inst;
nsresult rv = NS_NewMultiMixedConv(getter_AddRefs(inst));
if (NS_FAILED(rv)) {
@ -197,15 +180,10 @@ nsresult CreateNewMultiMixedConvFactory(nsISupports* aOuter, REFNSIID aIID,
return rv;
}
nsresult CreateNewTXTToHTMLConvFactory(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult CreateNewTXTToHTMLConvFactory(REFNSIID aIID, void** aResult) {
if (!aResult) {
return NS_ERROR_INVALID_POINTER;
}
if (aOuter) {
*aResult = nullptr;
return NS_ERROR_NO_AGGREGATION;
}
RefPtr<mozTXTToHTMLConv> inst;
nsresult rv = MOZ_NewTXTToHTMLConv(getter_AddRefs(inst));
if (NS_FAILED(rv)) {
@ -219,15 +197,10 @@ nsresult CreateNewTXTToHTMLConvFactory(nsISupports* aOuter, REFNSIID aIID,
return rv;
}
nsresult CreateNewHTTPCompressConvFactory(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult CreateNewHTTPCompressConvFactory(REFNSIID aIID, void** aResult) {
if (!aResult) {
return NS_ERROR_INVALID_POINTER;
}
if (aOuter) {
*aResult = nullptr;
return NS_ERROR_NO_AGGREGATION;
}
RefPtr<mozilla::net::nsHTTPCompressConv> inst;
nsresult rv = NS_NewHTTPCompressConv(getter_AddRefs(inst));
if (NS_FAILED(rv)) {
@ -241,32 +214,22 @@ nsresult CreateNewHTTPCompressConvFactory(nsISupports* aOuter, REFNSIID aIID,
return rv;
}
nsresult CreateNewUnknownDecoderFactory(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult CreateNewUnknownDecoderFactory(REFNSIID aIID, void** aResult) {
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
*aResult = nullptr;
if (aOuter) {
return NS_ERROR_NO_AGGREGATION;
}
RefPtr<nsUnknownDecoder> inst = new nsUnknownDecoder();
return inst->QueryInterface(aIID, aResult);
}
nsresult CreateNewBinaryDetectorFactory(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult CreateNewBinaryDetectorFactory(REFNSIID aIID, void** aResult) {
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
*aResult = nullptr;
if (aOuter) {
return NS_ERROR_NO_AGGREGATION;
}
RefPtr<nsBinaryDetector> inst = new nsBinaryDetector();
return inst->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -13,29 +13,20 @@ class nsISupports;
nsresult nsNetStartup();
void nsNetShutdown();
nsresult CreateNewStreamConvServiceFactory(nsISupports* aOuter,
const nsIID& aIID, void** aResult);
nsresult CreateNewMultiMixedConvFactory(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult CreateNewTXTToHTMLConvFactory(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult CreateNewHTTPCompressConvFactory(nsISupports* aOuter,
const nsIID& aIID, void** aResult);
nsresult CreateNewUnknownDecoderFactory(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult CreateNewBinaryDetectorFactory(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult nsLoadGroupConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult CreateNewStreamConvServiceFactory(const nsIID& aIID, void** aResult);
nsresult CreateNewMultiMixedConvFactory(const nsIID& aIID, void** aResult);
nsresult CreateNewTXTToHTMLConvFactory(const nsIID& aIID, void** aResult);
nsresult CreateNewHTTPCompressConvFactory(const nsIID& aIID, void** aResult);
nsresult CreateNewUnknownDecoderFactory(const nsIID& aIID, void** aResult);
nsresult CreateNewBinaryDetectorFactory(const nsIID& aIID, void** aResult);
nsresult nsLoadGroupConstructor(const nsIID& aIID, void** aResult);
extern nsresult net_NewIncrementalDownload(nsISupports*, const nsIID&, void**);
extern nsresult net_NewIncrementalDownload(const nsIID&, void**);
namespace mozilla {
namespace net {
nsresult WebSocketChannelConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult WebSocketSSLChannelConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult WebSocketChannelConstructor(const nsIID& aIID, void** aResult);
nsresult WebSocketSSLChannelConstructor(const nsIID& aIID, void** aResult);
} // namespace net
} // namespace mozilla

Просмотреть файл

@ -44,8 +44,7 @@ nsAboutBlank::GetChromeURI(nsIURI* aURI, nsIURI** chromeURI) {
return NS_ERROR_ILLEGAL_VALUE;
}
nsresult nsAboutBlank::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult nsAboutBlank::Create(REFNSIID aIID, void** aResult) {
RefPtr<nsAboutBlank> about = new nsAboutBlank();
return about->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -16,7 +16,7 @@ class nsAboutBlank : public nsIAboutModule {
nsAboutBlank() = default;
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
private:
virtual ~nsAboutBlank() = default;

Просмотреть файл

@ -516,8 +516,7 @@ nsAboutCache::GetURIFlags(nsIURI* aURI, uint32_t* result) {
}
// static
nsresult nsAboutCache::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult nsAboutCache::Create(REFNSIID aIID, void** aResult) {
RefPtr<nsAboutCache> about = new nsAboutCache();
return about->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -120,8 +120,7 @@ class nsAboutCache final : public nsIAboutModule {
nsAboutCache() = default;
[[nodiscard]] static nsresult Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult);
[[nodiscard]] static nsresult Create(REFNSIID aIID, void** aResult);
[[nodiscard]] static nsresult GetStorage(nsACString const& storageName,
nsILoadContextInfo* loadInfo,

Просмотреть файл

@ -17,8 +17,7 @@
NS_IMPL_ISUPPORTS(nsDataHandler, nsIProtocolHandler, nsISupportsWeakReference)
nsresult nsDataHandler::Create(nsISupports* aOuter, const nsIID& aIID,
void** aResult) {
nsresult nsDataHandler::Create(const nsIID& aIID, void** aResult) {
RefPtr<nsDataHandler> ph = new nsDataHandler();
return ph->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -26,8 +26,7 @@ class nsDataHandler : public nsIProtocolHandler,
nsIURI* aBaseURI, nsIURI** result);
// Define a Create method to be used with a factory:
[[nodiscard]] static nsresult Create(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
[[nodiscard]] static nsresult Create(const nsIID& aIID, void** aResult);
// Parse a data: URI and return the individual parts
// (the given spec will temporarily be modified but will be returned

Просмотреть файл

@ -295,8 +295,8 @@ nsresult nsHttpTransaction::Init(
if (mHasRequestBody) {
// wrap the headers and request body in a multiplexed input stream.
nsCOMPtr<nsIMultiplexInputStream> multi;
rv = nsMultiplexInputStreamConstructor(
nullptr, NS_GET_IID(nsIMultiplexInputStream), getter_AddRefs(multi));
rv = nsMultiplexInputStreamConstructor(NS_GET_IID(nsIMultiplexInputStream),
getter_AddRefs(multi));
if (NS_FAILED(rv)) return rv;
rv = multi->AppendStream(headers);

Просмотреть файл

@ -50,10 +50,8 @@ static void AppendNonAsciiToNCR(const nsAString& in, nsCString& out) {
}
}
nsresult nsIndexedToHTML::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult nsIndexedToHTML::Create(REFNSIID aIID, void** aResult) {
nsresult rv;
if (aOuter) return NS_ERROR_NO_AGGREGATION;
nsIndexedToHTML* _s = new nsIndexedToHTML();
if (_s == nullptr) return NS_ERROR_OUT_OF_MEMORY;

Просмотреть файл

@ -33,7 +33,7 @@ class nsIndexedToHTML : public nsIStreamConverter, public nsIDirIndexListener {
nsresult Init(nsIStreamListener* aListener);
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
protected:
void FormatSizeString(int64_t inSize, nsCString& outSizeString);

Просмотреть файл

@ -18,8 +18,7 @@
}
extern "C" {
nsresult cert_storage_constructor(nsISupports* outer, REFNSIID iid,
void** result);
nsresult cert_storage_constructor(REFNSIID iid, void** result);
};
#endif // _cert_storage_h_

Просмотреть файл

@ -30,7 +30,7 @@ use crossbeam_utils::atomic::AtomicCell;
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use moz_task::{create_background_task_queue, is_main_thread, Task, TaskRunnable};
use nserror::{
nsresult, NS_ERROR_FAILURE, NS_ERROR_NOT_SAME_THREAD, NS_ERROR_NO_AGGREGATION,
nsresult, NS_ERROR_FAILURE, NS_ERROR_NOT_SAME_THREAD,
NS_ERROR_NULL_POINTER, NS_ERROR_UNEXPECTED, NS_OK,
};
use nsstring::{nsACString, nsCStr, nsCString, nsString};
@ -1268,7 +1268,6 @@ impl Task for BackgroundReadStashTask {
}
fn do_construct_cert_storage(
_outer: *const nsISupports,
iid: *const xpcom::nsIID,
result: *mut *mut xpcom::reexports::libc::c_void,
) -> Result<(), nserror::nsresult> {
@ -1380,17 +1379,13 @@ impl<T: Default + VariantType, F: FnOnce(&mut SecurityState) -> Result<T, Securi
#[no_mangle]
pub extern "C" fn cert_storage_constructor(
outer: *const nsISupports,
iid: *const xpcom::nsIID,
result: *mut *mut xpcom::reexports::libc::c_void,
) -> nserror::nsresult {
if !outer.is_null() {
return NS_ERROR_NO_AGGREGATION;
}
if !is_main_thread() {
return NS_ERROR_NOT_SAME_THREAD;
}
match do_construct_cert_storage(outer, iid, result) {
match do_construct_cert_storage(iid, result) {
Ok(()) => NS_OK,
Err(e) => e,
}

Просмотреть файл

@ -71,12 +71,8 @@ template <class InstanceClass,
ProcessRestriction processRestriction =
ProcessRestriction::ParentProcessOnly,
ThreadRestriction threadRestriction = ThreadRestriction::AnyThread>
static nsresult Constructor(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
static nsresult Constructor(REFNSIID aIID, void** aResult) {
*aResult = nullptr;
if (aOuter != nullptr) {
return NS_ERROR_NO_AGGREGATION;
}
if (processRestriction == ProcessRestriction::ParentProcessOnly &&
!XRE_IsParentProcess()) {
@ -97,9 +93,8 @@ static nsresult Constructor(nsISupports* aOuter, REFNSIID aIID,
#define IMPL(type, ...) \
template <> \
nsresult NSSConstructor<type>(nsISupports * aOuter, const nsIID& aIID, \
void** aResult) { \
return Constructor<type, __VA_ARGS__>(aOuter, aIID, aResult); \
nsresult NSSConstructor<type>(const nsIID& aIID, void** aResult) { \
return Constructor<type, __VA_ARGS__>(aIID, aResult); \
}
// Components that require main thread initialization could cause a deadlock

Просмотреть файл

@ -14,9 +14,7 @@ class nsISupports;
namespace mozilla {
namespace psm {
template <typename T>
nsresult NSSConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aInstancePtr);
nsresult NSSConstructor(const nsIID& aIID, void** aInstancePtr);
}
} // namespace mozilla

Просмотреть файл

@ -11,12 +11,10 @@ using namespace mozilla;
/////////////////////////////////////////////////////////////////////////////
nsresult nsUrlClassifierDBServiceConstructor(nsISupports* aOuter,
const nsIID& aIID,
nsresult nsUrlClassifierDBServiceConstructor(const nsIID& aIID,
void** aResult) {
nsresult rv;
NS_ENSURE_ARG_POINTER(aResult);
NS_ENSURE_NO_AGGREGATION(aOuter);
RefPtr<nsUrlClassifierDBService> inst =
nsUrlClassifierDBService::GetInstance(&rv);

Просмотреть файл

@ -7,5 +7,4 @@
class nsISupports;
nsresult nsUrlClassifierDBServiceConstructor(nsISupports* aOuter,
const nsIID& aIID, void** aResult);
nsresult nsUrlClassifierDBServiceConstructor(const nsIID& aIID, void** aResult);

Просмотреть файл

@ -1985,10 +1985,7 @@ nsXULAppInfo::Callback(nsISupports* aData) {
static const nsXULAppInfo kAppInfo;
namespace mozilla {
nsresult AppInfoConstructor(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
NS_ENSURE_NO_AGGREGATION(aOuter);
nsresult AppInfoConstructor(REFNSIID aIID, void** aResult) {
return const_cast<nsXULAppInfo*>(&kAppInfo)->QueryInterface(aIID, aResult);
}
} // namespace mozilla

Просмотреть файл

@ -55,8 +55,7 @@ extern nsString gAbsoluteArgv0Path;
extern bool gIsGtest;
namespace mozilla {
nsresult AppInfoConstructor(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult AppInfoConstructor(const nsID& aIID, void** aResult);
} // namespace mozilla
// Exported for gtests.

Просмотреть файл

@ -13,8 +13,7 @@
class nsISupports;
nsresult nsAppShellConstructor(nsISupports* outer, const nsIID& iid,
void** result);
nsresult nsAppShellConstructor(const nsIID& iid, void** result);
nsresult nsWidgetAndroidModuleCtor();
void nsWidgetAndroidModuleDtor();

Просмотреть файл

@ -13,8 +13,7 @@
class nsISupports;
nsresult nsAppShellConstructor(nsISupports* outer, const nsIID& iid,
void** result);
nsresult nsAppShellConstructor(const nsIID& iid, void** result);
nsresult nsWidgetGtk2ModuleCtor();
void nsWidgetGtk2ModuleDtor();

Просмотреть файл

@ -51,9 +51,7 @@ static nsresult nsAppShellInit() {
static void nsAppShellShutdown() { NS_RELEASE(sAppShell); }
nsresult nsAppShellConstructor(nsISupports* outer, const nsIID& iid,
void** result) {
NS_ENSURE_TRUE(!outer, NS_ERROR_NO_AGGREGATION);
nsresult nsAppShellConstructor(const nsIID& iid, void** result) {
NS_ENSURE_TRUE(sAppShell, NS_ERROR_NOT_INITIALIZED);
return sAppShell->QueryInterface(iid, result);

Просмотреть файл

@ -13,8 +13,7 @@
class nsISupports;
nsresult nsAppShellConstructor(nsISupports* outer, const nsIID& iid,
void** result);
nsresult nsAppShellConstructor(const nsIID& iid, void** result);
nsresult nsWidgetWindowsModuleCtor();
void nsWidgetWindowsModuleDtor();

Просмотреть файл

@ -313,9 +313,6 @@ inline void MOZ_PretendNoReturn() MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS {}
#define NS_ENSURE_STATE(state) NS_ENSURE_TRUE(state, NS_ERROR_UNEXPECTED)
#define NS_ENSURE_NO_AGGREGATION(outer) \
NS_ENSURE_FALSE(outer, NS_ERROR_NO_AGGREGATION)
/*****************************************************************************/
#if (defined(DEBUG) || (defined(NIGHTLY_BUILD) && !defined(MOZ_PROFILING))) && \

Просмотреть файл

@ -625,14 +625,9 @@ static void Break(const char* aMsg) {
#endif
}
nsresult nsDebugImpl::Create(nsISupports* aOuter, const nsIID& aIID,
void** aInstancePtr) {
nsresult nsDebugImpl::Create(const nsIID& aIID, void** aInstancePtr) {
static const nsDebugImpl* sImpl;
if (NS_WARN_IF(aOuter)) {
return NS_ERROR_NO_AGGREGATION;
}
if (!sImpl) {
sImpl = new nsDebugImpl();
}

Просмотреть файл

@ -15,8 +15,7 @@ class nsDebugImpl : public nsIDebug2 {
NS_DECL_ISUPPORTS
NS_DECL_NSIDEBUG2
static nsresult Create(nsISupports* aOuter, const nsIID& aIID,
void** aInstancePtr);
static nsresult Create(const nsIID& aIID, void** aInstancePtr);
/*
* If we are in multiprocess mode, return the process name.

Просмотреть файл

@ -64,11 +64,7 @@ nsMemoryImpl::IsLowMemoryPlatform(bool* aResult) {
}
/*static*/
nsresult nsMemoryImpl::Create(nsISupports* aOuter, const nsIID& aIID,
void** aResult) {
if (NS_WARN_IF(aOuter)) {
return NS_ERROR_NO_AGGREGATION;
}
nsresult nsMemoryImpl::Create(const nsIID& aIID, void** aResult) {
return sGlobalMemory.QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -25,8 +25,7 @@ class nsMemoryImpl : public nsIMemory {
NS_DECL_NSIMEMORY
static nsresult Create(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
static nsresult Create(const nsIID& aIID, void** aResult);
nsresult FlushMemory(const char16_t* aReason, bool aImmediate);
void RunFlushers(const char16_t* aReason);

Просмотреть файл

@ -145,11 +145,7 @@ nsMessageLoop::PostIdleTask(nsIRunnable* aTask, uint32_t aEnsureRunsAfterMS) {
return NS_OK;
}
nsresult nsMessageLoopConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aInstancePtr) {
if (NS_WARN_IF(aOuter)) {
return NS_ERROR_NO_AGGREGATION;
}
nsresult nsMessageLoopConstructor(const nsIID& aIID, void** aInstancePtr) {
nsISupports* messageLoop = new nsMessageLoop();
return messageLoop->QueryInterface(aIID, aInstancePtr);
}

Просмотреть файл

@ -25,5 +25,5 @@ class nsMessageLoop : public nsIMessageLoop {
} \
}
extern nsresult nsMessageLoopConstructor(nsISupports* aOuter, const nsIID& aIID,
extern nsresult nsMessageLoopConstructor(const nsIID& aIID,
void** aInstancePtr);

Просмотреть файл

@ -134,19 +134,13 @@ extern nsresult NS_CategoryManagerGetFactory(nsIFactory**);
extern nsresult CreateAnonTempFileRemover();
#endif
nsresult nsThreadManagerGetSingleton(nsISupports* aOuter, const nsIID& aIID,
void** aInstancePtr) {
nsresult nsThreadManagerGetSingleton(const nsIID& aIID, void** aInstancePtr) {
NS_ASSERTION(aInstancePtr, "null outptr");
if (NS_WARN_IF(aOuter)) {
return NS_ERROR_NO_AGGREGATION;
}
return nsThreadManager::get().QueryInterface(aIID, aInstancePtr);
}
nsresult nsLocalFileConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aInstancePtr) {
return nsLocalFile::nsLocalFileConstructor(aOuter, aIID, aInstancePtr);
nsresult nsLocalFileConstructor(const nsIID& aIID, void** aInstancePtr) {
return nsLocalFile::nsLocalFileConstructor(aIID, aInstancePtr);
}
nsComponentManagerImpl* nsComponentManagerImpl::gComponentManager = nullptr;
@ -185,7 +179,7 @@ static nsIDebug2* gDebug = nullptr;
EXPORT_XPCOM_API(nsresult)
NS_GetDebug(nsIDebug2** aResult) {
return nsDebugImpl::Create(nullptr, NS_GET_IID(nsIDebug2), (void**)aResult);
return nsDebugImpl::Create(NS_GET_IID(nsIDebug2), (void**)aResult);
}
class ICUReporter final : public nsIMemoryReporter,

Просмотреть файл

@ -11,13 +11,10 @@
class nsISupports;
nsresult nsThreadManagerGetSingleton(nsISupports* aOuter, const nsIID& aIID,
void** aInstancePtr);
nsresult nsThreadManagerGetSingleton(const nsIID& aIID, void** aInstancePtr);
nsresult nsLocalFileConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aInstancePtr);
nsresult nsLocalFileConstructor(const nsIID& aIID, void** aInstancePtr);
extern nsresult nsStringInputStreamConstructor(nsISupports*, const nsID&,
void**);
extern nsresult nsStringInputStreamConstructor(const nsID&, void**);
#endif // XPCOMModule_h

Просмотреть файл

@ -400,7 +400,7 @@ class ModuleEntry(object):
if self.legacy_constructor:
res += (
" return /* legacy */ %s(nullptr, aIID, aResult);\n"
" return /* legacy */ %s(aIID, aResult);\n"
% self.legacy_constructor
)
return res

Просмотреть файл

@ -341,12 +341,7 @@ void nsCategoryManager::Destroy() {
gCategoryManager = nullptr;
}
nsresult nsCategoryManager::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
if (aOuter) {
return NS_ERROR_NO_AGGREGATION;
}
nsresult nsCategoryManager::Create(REFNSIID aIID, void** aResult) {
return GetSingleton()->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -116,7 +116,7 @@ class nsCategoryManager final : public nsICategoryManager,
return AddCategoryEntry(aCategory, aKey, aValue, aReplace, oldValue);
}
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
void InitMemoryReporter();
static nsCategoryManager* GetSingleton();

Просмотреть файл

@ -223,7 +223,7 @@ class MOZ_STACK_CLASS EntryWrapper final {
static already_AddRefed<nsIFile> GetLocationFromDirectoryService(
const char* aProp) {
nsCOMPtr<nsIProperties> directoryService;
nsDirectoryService::Create(nullptr, NS_GET_IID(nsIProperties),
nsDirectoryService::Create(NS_GET_IID(nsIProperties),
getter_AddRefs(directoryService));
if (!directoryService) {
@ -256,12 +256,7 @@ static already_AddRefed<nsIFile> CloneAndAppend(nsIFile* aBase,
// nsComponentManagerImpl
////////////////////////////////////////////////////////////////////////////////
nsresult nsComponentManagerImpl::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
if (aOuter) {
return NS_ERROR_NO_AGGREGATION;
}
nsresult nsComponentManagerImpl::Create(REFNSIID aIID, void** aResult) {
if (!gComponentManager) {
return NS_ERROR_FAILURE;
}

Просмотреть файл

@ -79,7 +79,7 @@ class nsComponentManagerImpl final : public nsIComponentManager,
NS_DECL_NSICOMPONENTREGISTRAR
NS_DECL_NSIMEMORYREPORTER
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
nsresult RegistryLocationForFile(nsIFile* aFile, nsCString& aResult);
nsresult FileForRegistryLocation(const nsCString& aLocation, nsIFile** aSpec);

Просмотреть файл

@ -130,12 +130,7 @@ nsArrayBase::GetElementAt(uint32_t aIndex, nsISupports** aResult) {
return NS_OK;
}
nsresult nsArrayBase::XPCOMConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aResult) {
if (aOuter) {
return NS_ERROR_NO_AGGREGATION;
}
nsresult nsArrayBase::XPCOMConstructor(const nsIID& aIID, void** aResult) {
nsCOMPtr<nsIMutableArray> inst = Create();
return inst->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -34,8 +34,7 @@ class nsArrayBase : public nsIMutableArray {
static already_AddRefed<nsIMutableArray> Create();
/* Only for the benefit of the XPCOM module system, use Create()
instead. */
static nsresult XPCOMConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
static nsresult XPCOMConstructor(const nsIID& aIID, void** aResult);
protected:
nsArrayBase() = default;

Просмотреть файл

@ -151,8 +151,7 @@ void nsObserverService::Shutdown() {
mObserverTopicTable.Clear();
}
nsresult nsObserverService::Create(nsISupports* aOuter, const nsIID& aIID,
void** aInstancePtr) {
nsresult nsObserverService::Create(const nsIID& aIID, void** aInstancePtr) {
LOG(("nsObserverService::Create()"));
RefPtr<nsObserverService> os = new nsObserverService();

Просмотреть файл

@ -34,8 +34,7 @@ class nsObserverService final : public nsIObserverService,
void Shutdown();
[[nodiscard]] static nsresult Create(nsISupports* aOuter, const nsIID& aIID,
void** aInstancePtr);
[[nodiscard]] static nsresult Create(const nsIID& aIID, void** aInstancePtr);
// Unmark any strongly held observers implemented in JS so the cycle
// collector will not traverse them.

Просмотреть файл

@ -550,11 +550,7 @@ nsPersistentProperties::GetKeys(nsTArray<nsCString>& aKeys) {
// PropertyElement
////////////////////////////////////////////////////////////////////////////////
nsresult nsPropertyElement::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
if (aOuter) {
return NS_ERROR_NO_AGGREGATION;
}
nsresult nsPropertyElement::Create(REFNSIID aIID, void** aResult) {
RefPtr<nsPropertyElement> propElem = new nsPropertyElement();
return propElem->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -47,7 +47,7 @@ class nsPropertyElement final : public nsIPropertyElement {
NS_DECL_ISUPPORTS
NS_DECL_NSIPROPERTYELEMENT
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
private:
~nsPropertyElement() = default;

Просмотреть файл

@ -516,12 +516,7 @@ void NS_NewWindowsRegKey(nsIWindowsRegKey** aResult) {
//-----------------------------------------------------------------------------
nsresult nsWindowsRegKeyConstructor(nsISupports* aDelegate, const nsIID& aIID,
void** aResult) {
if (aDelegate) {
return NS_ERROR_NO_AGGREGATION;
}
nsresult nsWindowsRegKeyConstructor(const nsIID& aIID, void** aResult) {
nsCOMPtr<nsIWindowsRegKey> key;
NS_NewWindowsRegKey(getter_AddRefs(key));
return key->QueryInterface(aIID, aResult);

Просмотреть файл

@ -35,8 +35,7 @@ extern "C" void NS_NewWindowsRegKey(nsIWindowsRegKey** aResult);
} \
}
[[nodiscard]] extern nsresult nsWindowsRegKeyConstructor(nsISupports* aOuter,
const nsIID& aIID,
[[nodiscard]] extern nsresult nsWindowsRegKeyConstructor(const nsIID& aIID,
void** aResult);
#endif // IMPL_LIBXUL

Просмотреть файл

@ -84,14 +84,10 @@ StaticRefPtr<nsDirectoryService> nsDirectoryService::gService;
nsDirectoryService::nsDirectoryService() : mHashtable(128) {}
nsresult nsDirectoryService::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult nsDirectoryService::Create(REFNSIID aIID, void** aResult) {
if (NS_WARN_IF(!aResult)) {
return NS_ERROR_INVALID_ARG;
}
if (NS_WARN_IF(aOuter)) {
return NS_ERROR_NO_AGGREGATION;
}
if (!gService) {
return NS_ERROR_NOT_INITIALIZED;

Просмотреть файл

@ -41,7 +41,7 @@ class nsDirectoryService final : public nsIDirectoryService,
static void RealInit();
void RegisterCategoryProviders();
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
static mozilla::StaticRefPtr<nsDirectoryService> gService;

Просмотреть файл

@ -284,15 +284,11 @@ NS_IMPL_ISUPPORTS(nsLocalFile, nsILocalFileMac, nsIFile)
NS_IMPL_ISUPPORTS(nsLocalFile, nsIFile)
#endif
nsresult nsLocalFile::nsLocalFileConstructor(nsISupports* aOuter,
const nsIID& aIID,
nsresult nsLocalFile::nsLocalFileConstructor(const nsIID& aIID,
void** aInstancePtr) {
if (NS_WARN_IF(!aInstancePtr)) {
return NS_ERROR_INVALID_ARG;
}
if (NS_WARN_IF(aOuter)) {
return NS_ERROR_NO_AGGREGATION;
}
*aInstancePtr = nullptr;

Просмотреть файл

@ -57,7 +57,7 @@ class nsLocalFile final
nsLocalFile();
explicit nsLocalFile(const nsACString& aFilePath);
static nsresult nsLocalFileConstructor(nsISupports* aOuter, const nsIID& aIID,
static nsresult nsLocalFileConstructor(const nsIID& aIID,
void** aInstancePtr);
NS_DECL_THREADSAFE_ISUPPORTS

Просмотреть файл

@ -880,15 +880,11 @@ nsLocalFile::nsLocalFile(const nsAString& aFilePath)
InitWithPath(aFilePath);
}
nsresult nsLocalFile::nsLocalFileConstructor(nsISupports* aOuter,
const nsIID& aIID,
nsresult nsLocalFile::nsLocalFileConstructor(const nsIID& aIID,
void** aInstancePtr) {
if (NS_WARN_IF(!aInstancePtr)) {
return NS_ERROR_INVALID_ARG;
}
if (NS_WARN_IF(aOuter)) {
return NS_ERROR_NO_AGGREGATION;
}
nsLocalFile* inst = new nsLocalFile();
nsresult rv = inst->QueryInterface(aIID, aInstancePtr);

Просмотреть файл

@ -30,7 +30,7 @@ class nsLocalFile final : public nsILocalFileWin {
nsLocalFile();
explicit nsLocalFile(const nsAString& aFilePath);
static nsresult nsLocalFileConstructor(nsISupports* aOuter, const nsIID& aIID,
static nsresult nsLocalFileConstructor(const nsIID& aIID,
void** aInstancePtr);
// nsISupports interface

Просмотреть файл

@ -944,14 +944,9 @@ void nsMultiplexInputStream::AsyncWaitCompleted() {
callback->OnInputStreamReady(this);
}
nsresult nsMultiplexInputStreamConstructor(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult nsMultiplexInputStreamConstructor(REFNSIID aIID, void** aResult) {
*aResult = nullptr;
if (aOuter) {
return NS_ERROR_NO_AGGREGATION;
}
RefPtr<nsMultiplexInputStream> inst = new nsMultiplexInputStream();
return inst->QueryInterface(aIID, aResult);

Просмотреть файл

@ -21,8 +21,7 @@
} \
}
extern nsresult nsMultiplexInputStreamConstructor(nsISupports* aOuter,
REFNSIID aIID,
extern nsresult nsMultiplexInputStreamConstructor(REFNSIID aIID,
void** aResult);
#endif // _nsMultiplexInputStream_h_

Просмотреть файл

@ -16,6 +16,6 @@
}
// Generic factory constructor for the nsPipe class
nsresult nsPipeConstructor(nsISupports* outer, REFNSIID iid, void** result);
nsresult nsPipeConstructor(REFNSIID iid, void** result);
#endif // !defined(nsPipe_h__)

Просмотреть файл

@ -1864,10 +1864,7 @@ nsPipeHolder::GetOutputStream(nsIAsyncOutputStream** aOutputStream) {
return NS_ERROR_NOT_INITIALIZED;
}
nsresult nsPipeConstructor(nsISupports* aOuter, REFNSIID aIID, void** aResult) {
if (aOuter) {
return NS_ERROR_NO_AGGREGATION;
}
nsresult nsPipeConstructor(REFNSIID aIID, void** aResult) {
RefPtr<nsPipeHolder> pipe = new nsPipeHolder();
nsresult rv = pipe->QueryInterface(aIID, aResult);
return rv;

Просмотреть файл

@ -112,12 +112,7 @@ nsresult nsScriptableInputStream::ReadHelper(char* aBuffer, uint32_t aCount) {
return NS_OK;
}
nsresult nsScriptableInputStream::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
if (aOuter) {
return NS_ERROR_NO_AGGREGATION;
}
nsresult nsScriptableInputStream::Create(REFNSIID aIID, void** aResult) {
RefPtr<nsScriptableInputStream> sis = new nsScriptableInputStream();
return sis->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -33,7 +33,7 @@ class nsScriptableInputStream final : public nsIScriptableInputStream {
// nsScriptableInputStream methods
nsScriptableInputStream() = default;
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
private:
~nsScriptableInputStream() = default;

Просмотреть файл

@ -633,14 +633,9 @@ nsresult NS_NewCStringInputStream(nsIInputStream** aStreamResult,
}
// factory method for constructing a nsStringInputStream object
nsresult nsStringInputStreamConstructor(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult nsStringInputStreamConstructor(REFNSIID aIID, void** aResult) {
*aResult = nullptr;
if (NS_WARN_IF(aOuter)) {
return NS_ERROR_NO_AGGREGATION;
}
RefPtr<nsStringInputStream> inst = new nsStringInputStream();
return inst->QueryInterface(aIID, aResult);
}

Просмотреть файл

@ -18,15 +18,10 @@ using namespace mozilla;
NS_IMPL_ISUPPORTS(nsEnvironment, nsIEnvironment)
nsresult nsEnvironment::Create(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult nsEnvironment::Create(REFNSIID aIID, void** aResult) {
nsresult rv;
*aResult = nullptr;
if (aOuter) {
return NS_ERROR_NO_AGGREGATION;
}
nsEnvironment* obj = new nsEnvironment();
rv = obj->QueryInterface(aIID, aResult);

Просмотреть файл

@ -24,7 +24,7 @@ class nsEnvironment final : public nsIEnvironment {
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIENVIRONMENT
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
static nsresult Create(REFNSIID aIID, void** aResult);
private:
nsEnvironment() {}

Просмотреть файл

@ -794,13 +794,8 @@ RefPtr<nsTimer> nsTimer::WithEventTarget(nsIEventTarget* aTarget) {
}
/* static */
nsresult nsTimer::XPCOMConstructor(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult nsTimer::XPCOMConstructor(REFNSIID aIID, void** aResult) {
*aResult = nullptr;
if (aOuter != nullptr) {
return NS_ERROR_NO_AGGREGATION;
}
auto timer = WithEventTarget(nullptr);
return timer->QueryInterface(aIID, aResult);

Просмотреть файл

@ -216,8 +216,7 @@ class nsTimer final : public nsITimer {
// current thread should be used as the timer's target.
static RefPtr<nsTimer> WithEventTarget(nsIEventTarget* aTarget);
static nsresult XPCOMConstructor(nsISupports* aOuter, REFNSIID aIID,
void** aResult);
static nsresult XPCOMConstructor(REFNSIID aIID, void** aResult);
private:
// nsTimerImpl holds a strong ref to us. When our refcount goes to 1, we will