Bug 1501718 - Port bug 1501404, part 7: Move XPCOM registration of nsSyncStreamListener to C-C common/. rs=bustage-fix

This commit is contained in:
Jorg K 2018-10-24 21:11:27 +02:00
Родитель b2e9f8cbe1
Коммит 59550099c4
3 изменённых файлов: 30 добавлений и 0 удалений

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

@ -22,4 +22,8 @@
#define NS_TRANSACTIONMANAGER_CID \
{ 0x9c8f9601, 0x801a, 0x11d2, { 0x98, 0xba, 0x0, 0x80, 0x5f, 0x29, 0x7d, 0x89 } }
#define NS_SYNCSTREAMLISTENER_CONTRACTID "@mozilla.org/network/sync-stream-listener;1"
#define NS_SYNCSTREAMLISTENER_CID \
{ 0x439400d3, 0x6f23, 0x43db, {0x8b, 0x06, 0x8a, 0xaf, 0xe1, 0x86, 0x9b, 0xd8 } }
#endif // nsCommonBaseCID_h__

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

@ -14,4 +14,8 @@ SOURCES += [
'nsComponentManagerExtra.cpp',
]
LOCAL_INCLUDES += [
'/%s/netwerk/base' % CONFIG['mozreltopsrcdir']
]
FINAL_LIBRARY = 'xul'

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

@ -7,6 +7,7 @@
#include "nsBaseCommandController.h"
#include "nsCommonBaseCID.h"
#include "nsComponentManagerExtra.h"
#include "nsSyncStreamListener.h"
using mozilla::TransactionManager;
@ -19,10 +20,30 @@ NS_DEFINE_NAMED_CID(NS_BASECOMMANDCONTROLLER_CID);
NS_GENERIC_FACTORY_CONSTRUCTOR(TransactionManager)
NS_DEFINE_NAMED_CID(NS_TRANSACTIONMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_SYNCSTREAMLISTENER_CID);
static nsresult
CreateNewSyncStreamListener(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
*aResult = nullptr;
if (aOuter) {
return NS_ERROR_NO_AGGREGATION;
}
RefPtr<nsISyncStreamListener> inst = nsSyncStreamListener::Create();
if (!inst)
return NS_ERROR_NULL_POINTER;
return inst->QueryInterface(aIID, aResult);
}
const mozilla::Module::CIDEntry kCommonCIDs[] = {
{ &kNS_COMPONENTMANAGEREXTRA_CID, false, nullptr, nsComponentManagerExtraConstructor },
{ &kNS_BASECOMMANDCONTROLLER_CID, false, nullptr, nsBaseCommandControllerConstructor },
{ &kNS_TRANSACTIONMANAGER_CID, false, nullptr, TransactionManagerConstructor },
{ &kNS_SYNCSTREAMLISTENER_CID, false, nullptr, CreateNewSyncStreamListener },
{ nullptr }
};
@ -30,6 +51,7 @@ const mozilla::Module::ContractIDEntry kCommonContracts[] = {
{ NS_COMPONENTMANAGEREXTRA_CONTRACTID, &kNS_COMPONENTMANAGEREXTRA_CID },
{ NS_BASECOMMANDCONTROLLER_CONTRACTID, &kNS_BASECOMMANDCONTROLLER_CID },
{ NS_TRANSACTIONMANAGER_CONTRACTID, &kNS_TRANSACTIONMANAGER_CID },
{ NS_SYNCSTREAMLISTENER_CONTRACTID, &kNS_SYNCSTREAMLISTENER_CID },
{ nullptr }
};