зеркало из https://github.com/mozilla/gecko-dev.git
Changed error code checking in NSRegisterSelf as suggested by ftang.
This commit is contained in:
Родитель
458a079388
Коммит
7a45bc2ab8
|
@ -122,28 +122,28 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *
|
|||
//
|
||||
rv = compMgr->RegisterComponent(kLocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
|
||||
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: RegisterFactory failed.");
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
//
|
||||
// register the collation factory
|
||||
//
|
||||
rv = compMgr->RegisterComponent(kCollationFactoryCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
|
||||
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register CollationFactory failed.");
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
//
|
||||
// register the collation interface
|
||||
//
|
||||
rv = compMgr->RegisterComponent(kCollationCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
|
||||
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register Collation failed.");
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
//
|
||||
// register the date time formatter
|
||||
//
|
||||
rv = compMgr->RegisterComponent(kDateTimeFormatCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
|
||||
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register DateTimeFormat failed.");
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
done:
|
||||
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
|
||||
|
@ -164,16 +164,16 @@ extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = compMgr->UnregisterFactory(kLocaleFactoryCID, path);
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
rv = compMgr->UnregisterFactory(kCollationFactoryCID, path);
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
rv = compMgr->UnregisterFactory(kCollationCID, path);
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
rv = compMgr->UnregisterFactory(kDateTimeFormatCID, path);
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
done:
|
||||
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
|
||||
|
|
|
@ -120,28 +120,28 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *
|
|||
//
|
||||
rv = compMgr->RegisterComponent(kLocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
|
||||
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: RegisterFactory failed.");
|
||||
if (rv!=NS_OK) goto done;
|
||||
if(NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
//
|
||||
// register the collation factory
|
||||
//
|
||||
rv = compMgr->RegisterComponent(kCollationFactoryCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
|
||||
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register CollationFactory failed.");
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
if(NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
//
|
||||
// register the collation interface
|
||||
//
|
||||
rv = compMgr->RegisterComponent(kCollationCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
|
||||
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register Collation failed.");
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
if(NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
//
|
||||
// register the date time formatter
|
||||
//
|
||||
rv = compMgr->RegisterComponent(kDateTimeFormatCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
|
||||
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register DateTimeFormat failed.");
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
if(NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
done:
|
||||
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
|
||||
|
@ -162,16 +162,16 @@ extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = compMgr->UnregisterFactory(kLocaleFactoryCID, path);
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
rv = compMgr->UnregisterFactory(kCollationFactoryCID, path);
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
rv = compMgr->UnregisterFactory(kCollationCID, path);
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
rv = compMgr->UnregisterFactory(kDateTimeFormatCID, path);
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
done:
|
||||
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
|
||||
|
|
|
@ -136,35 +136,35 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *
|
|||
//
|
||||
rv = compMgr->RegisterComponent(kLocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
|
||||
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: RegisterFactory failed.");
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
//
|
||||
// register the windows specific factory
|
||||
//
|
||||
rv = compMgr->RegisterComponent(kWin32LocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
|
||||
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register nsIWin32LocaleFactory failed.");
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
//
|
||||
// register the collation factory
|
||||
//
|
||||
rv = compMgr->RegisterComponent(kCollationFactoryCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
|
||||
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register CollationFactory failed.");
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
//
|
||||
// register the collation interface
|
||||
//
|
||||
rv = compMgr->RegisterComponent(kCollationCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
|
||||
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register Collation failed.");
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
//
|
||||
// register the date time formatter
|
||||
//
|
||||
rv = compMgr->RegisterComponent(kDateTimeFormatCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
|
||||
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register DateTimeFormat failed.");
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
done:
|
||||
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
|
||||
|
@ -185,19 +185,19 @@ extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = compMgr->UnregisterFactory(kLocaleFactoryCID, path);
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
rv = compMgr->UnregisterFactory(kWin32LocaleFactoryCID, path);
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
rv = compMgr->UnregisterFactory(kCollationFactoryCID, path);
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
rv = compMgr->UnregisterFactory(kCollationCID, path);
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
rv = compMgr->UnregisterFactory(kDateTimeFormatCID, path);
|
||||
if (rv!=NS_OK) goto done;
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
done:
|
||||
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
|
||||
|
|
Загрузка…
Ссылка в новой задаче