зеркало из https://github.com/mozilla/gecko-dev.git
Changing RegisterFactory to use the new API.
This commit is contained in:
Родитель
2f28d33b0c
Коммит
ec691d8a4c
|
@ -106,19 +106,19 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char
|
|||
{
|
||||
nsresult res;
|
||||
|
||||
res = nsRepository::RegisterFactory(kUnicodeEncodeHelperCID, path,
|
||||
res = nsRepository::RegisterComponent(kUnicodeEncodeHelperCID, NULL, NULL,
|
||||
path, PR_TRUE, PR_TRUE);
|
||||
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
|
||||
|
||||
res = nsRepository::RegisterComponent(kCharsetAliasCID, NULL, NULL, path,
|
||||
PR_TRUE, PR_TRUE);
|
||||
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
|
||||
|
||||
res = nsRepository::RegisterFactory(kCharsetAliasCID, path,
|
||||
PR_TRUE, PR_TRUE);
|
||||
res = nsRepository::RegisterComponent(kCharsetConverterManagerCID, NULL, NULL,
|
||||
path, PR_TRUE, PR_TRUE);
|
||||
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
|
||||
|
||||
res = nsRepository::RegisterFactory(kCharsetConverterManagerCID, path,
|
||||
PR_TRUE, PR_TRUE);
|
||||
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
|
||||
|
||||
res = nsRepository::RegisterFactory(kPlatformCharsetCID, path,
|
||||
res = nsRepository::RegisterComponent(kPlatformCharsetCID, NULL, NULL, path,
|
||||
PR_TRUE, PR_TRUE);
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -80,25 +80,25 @@ nsresult setupRegistry()
|
|||
{
|
||||
nsresult res;
|
||||
|
||||
res = nsRepository::RegisterFactory(kCharsetConverterManagerCID, UCONV_DLL, PR_FALSE, PR_FALSE);
|
||||
res = nsRepository::RegisterComponent(kCharsetConverterManagerCID, NULL, NULL, UCONV_DLL, PR_FALSE, PR_FALSE);
|
||||
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
|
||||
|
||||
res = nsRepository::RegisterFactory(kLatin1ToUnicodeCID, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
|
||||
res = nsRepository::RegisterComponent(kLatin1ToUnicodeCID, NULL, NULL, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
|
||||
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
|
||||
|
||||
res = nsRepository::RegisterFactory(kCP1253ToUnicodeCID, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
|
||||
res = nsRepository::RegisterComponent(kCP1253ToUnicodeCID, NULL, NULL, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
|
||||
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
|
||||
|
||||
res = nsRepository::RegisterFactory(kISO88597ToUnicodeCID, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
|
||||
res = nsRepository::RegisterComponent(kISO88597ToUnicodeCID, NULL, NULL, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
|
||||
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
|
||||
|
||||
res = nsRepository::RegisterFactory(kSJIS2UnicodeCID, UCVJA_DLL, PR_FALSE, PR_FALSE);
|
||||
res = nsRepository::RegisterComponent(kSJIS2UnicodeCID, NULL, NULL, UCVJA_DLL, PR_FALSE, PR_FALSE);
|
||||
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
|
||||
|
||||
res = nsRepository::RegisterFactory(kISO2022JPToUnicodeCID, UCVJA2_DLL, PR_FALSE, PR_FALSE);
|
||||
res = nsRepository::RegisterComponent(kISO2022JPToUnicodeCID, NULL, NULL, UCVJA2_DLL, PR_FALSE, PR_FALSE);
|
||||
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
|
||||
|
||||
res = nsRepository::RegisterFactory(kPlatformCharsetCID, UCONV_DLL, PR_FALSE, PR_FALSE);
|
||||
res = nsRepository::RegisterComponent(kPlatformCharsetCID, NULL, NULL, UCONV_DLL, PR_FALSE, PR_FALSE);
|
||||
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -149,8 +149,8 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char
|
|||
nsresult res;
|
||||
|
||||
for (PRInt32 i=0; i<ARRAY_SIZE(g_FactoryData); i++) {
|
||||
res = nsRepository::RegisterFactory(*(g_FactoryData[i].mCID), path,
|
||||
PR_TRUE, PR_TRUE);
|
||||
res = nsRepository::RegisterComponent(*(g_FactoryData[i].mCID), NULL, NULL,
|
||||
path, PR_TRUE, PR_TRUE);
|
||||
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -168,8 +168,8 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char
|
|||
nsresult res;
|
||||
|
||||
for (PRInt32 i=0; i<ARRAY_SIZE(g_FactoryData); i++) {
|
||||
res = nsRepository::RegisterFactory(*(g_FactoryData[i].mCID), path,
|
||||
PR_TRUE, PR_TRUE);
|
||||
res = nsRepository::RegisterComponent(*(g_FactoryData[i].mCID), NULL, NULL,
|
||||
path, PR_TRUE, PR_TRUE);
|
||||
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -172,8 +172,8 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char
|
|||
nsresult res;
|
||||
|
||||
for (PRInt32 i=0; i<ARRAY_SIZE(g_FactoryData); i++) {
|
||||
res = nsRepository::RegisterFactory(*(g_FactoryData[i].mCID), path,
|
||||
PR_TRUE, PR_TRUE);
|
||||
res = nsRepository::RegisterComponent(*(g_FactoryData[i].mCID), NULL, NULL,
|
||||
path, PR_TRUE, PR_TRUE);
|
||||
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* serviceMgr) {
|
|||
}
|
||||
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char *path)
|
||||
{
|
||||
return nsRepository::RegisterFactory(kUnicharUtilCID, path,
|
||||
return nsRepository::RegisterComponent(kUnicharUtilCID, NULL, NULL, path,
|
||||
PR_TRUE, PR_TRUE);
|
||||
}
|
||||
|
||||
|
|
|
@ -347,12 +347,14 @@ void TestCaseConversion()
|
|||
void RegisterFactories()
|
||||
{
|
||||
nsresult res;
|
||||
res = nsRepository::RegisterFactory(kUnicharUtilCID,
|
||||
res = nsRepository::RegisterComponent(kUnicharUtilCID,
|
||||
NULL,
|
||||
NULL,
|
||||
UNICHARUTIL_DLL_NAME,
|
||||
PR_FALSE,
|
||||
PR_TRUE);
|
||||
if(NS_FAILED(res))
|
||||
cout << "RegisterFactory failed\n";
|
||||
cout << "RegisterComponent failed\n";
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче