diff --git a/mozilla/modules/staticmod/nsMetaModule.cpp.in b/mozilla/modules/staticmod/nsMetaModule.cpp.in index 510e6413838..140dd8fdc36 100644 --- a/mozilla/modules/staticmod/nsMetaModule.cpp.in +++ b/mozilla/modules/staticmod/nsMetaModule.cpp.in @@ -114,6 +114,6 @@ NSGetModule(nsIComponentManager *servMgr, metainfo.mCtor = Initialize; metainfo.mDtor = Shutdown; - return NS_NewGenericModule(&metainfo, result); + return NS_NewGenericModule2(&metainfo, result); } diff --git a/mozilla/xpcom/components/nsGenericFactory.cpp b/mozilla/xpcom/components/nsGenericFactory.cpp index d87f64b5583..5eeb63fe2b8 100644 --- a/mozilla/xpcom/components/nsGenericFactory.cpp +++ b/mozilla/xpcom/components/nsGenericFactory.cpp @@ -415,7 +415,7 @@ nsGenericModule::CanUnload(nsIComponentManager *aCompMgr, PRBool *okToUnload) } NS_COM nsresult -NS_NewGenericModule(nsModuleInfo* info, nsIModule* *result) +NS_NewGenericModule2(nsModuleInfo* info, nsIModule* *result) { nsresult rv = NS_OK; @@ -436,4 +436,23 @@ NS_NewGenericModule(nsModuleInfo* info, nsIModule* *result) return rv; } +NS_COM nsresult +NS_NewGenericModule(const char* moduleName, + PRUint32 componentCount, + nsModuleComponentInfo* components, + nsModuleDestructorProc dtor, + nsIModule* *result) +{ + nsModuleInfo info; + nsCRT::memset(&info, 0, sizeof(info)); + + info.mVersion = NS_MODULEINFO_VERSION; + info.mModuleName = moduleName; + info.mComponents = components; + info.mCount = componentCount; + info.mDtor = dtor; + + return NS_NewGenericModule2(&info, result); +} + //////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/xpcom/components/nsIGenericFactory.h b/mozilla/xpcom/components/nsIGenericFactory.h index 9a6328d93d9..505641af27d 100644 --- a/mozilla/xpcom/components/nsIGenericFactory.h +++ b/mozilla/xpcom/components/nsIGenericFactory.h @@ -125,13 +125,27 @@ struct nsModuleInfo { /** * Rev this if you change the nsModuleInfo, and are worried about - * binary compatibility. (Ostensibly fix NS_NewGenericModule() to deal + * binary compatibility. (Ostensibly fix NS_NewGenericModule2() to deal * with older rev's at the same time.) */ #define NS_MODULEINFO_VERSION 0x00010000UL // 1.0 +/** + * Create a new generic module. Use the NS_IMPL_NSGETMODULE macro, or + * one of its relatives, rather than using this directly. + */ extern NS_COM nsresult -NS_NewGenericModule(nsModuleInfo *info, nsIModule* *result); +NS_NewGenericModule2(nsModuleInfo *info, nsIModule* *result); + +/** + * Obsolete. Use NS_NewGenericModule2() instead. + */ +extern NS_COM nsresult +NS_NewGenericModule(const char* moduleName, + PRUint32 componentCount, + nsModuleComponentInfo* components, + nsModuleDestructorProc dtor, + nsIModule* *result); #if defined(XPCOM_TRANSLATE_NSGM_ENTRY_POINT) # define NSMODULEINFO(_name) _name##_gModuleInfo @@ -144,7 +158,7 @@ NSGetModule(nsIComponentManager *servMgr, \ nsIFile* location, \ nsIModule** result) \ { \ - return NS_NewGenericModule(&(_info), result); \ + return NS_NewGenericModule2(&(_info), result); \ } #endif diff --git a/mozilla/xpcom/glue/nsGenericFactory.cpp b/mozilla/xpcom/glue/nsGenericFactory.cpp index d87f64b5583..5eeb63fe2b8 100644 --- a/mozilla/xpcom/glue/nsGenericFactory.cpp +++ b/mozilla/xpcom/glue/nsGenericFactory.cpp @@ -415,7 +415,7 @@ nsGenericModule::CanUnload(nsIComponentManager *aCompMgr, PRBool *okToUnload) } NS_COM nsresult -NS_NewGenericModule(nsModuleInfo* info, nsIModule* *result) +NS_NewGenericModule2(nsModuleInfo* info, nsIModule* *result) { nsresult rv = NS_OK; @@ -436,4 +436,23 @@ NS_NewGenericModule(nsModuleInfo* info, nsIModule* *result) return rv; } +NS_COM nsresult +NS_NewGenericModule(const char* moduleName, + PRUint32 componentCount, + nsModuleComponentInfo* components, + nsModuleDestructorProc dtor, + nsIModule* *result) +{ + nsModuleInfo info; + nsCRT::memset(&info, 0, sizeof(info)); + + info.mVersion = NS_MODULEINFO_VERSION; + info.mModuleName = moduleName; + info.mComponents = components; + info.mCount = componentCount; + info.mDtor = dtor; + + return NS_NewGenericModule2(&info, result); +} + //////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/xpcom/glue/nsIGenericFactory.h b/mozilla/xpcom/glue/nsIGenericFactory.h index 9a6328d93d9..505641af27d 100644 --- a/mozilla/xpcom/glue/nsIGenericFactory.h +++ b/mozilla/xpcom/glue/nsIGenericFactory.h @@ -125,13 +125,27 @@ struct nsModuleInfo { /** * Rev this if you change the nsModuleInfo, and are worried about - * binary compatibility. (Ostensibly fix NS_NewGenericModule() to deal + * binary compatibility. (Ostensibly fix NS_NewGenericModule2() to deal * with older rev's at the same time.) */ #define NS_MODULEINFO_VERSION 0x00010000UL // 1.0 +/** + * Create a new generic module. Use the NS_IMPL_NSGETMODULE macro, or + * one of its relatives, rather than using this directly. + */ extern NS_COM nsresult -NS_NewGenericModule(nsModuleInfo *info, nsIModule* *result); +NS_NewGenericModule2(nsModuleInfo *info, nsIModule* *result); + +/** + * Obsolete. Use NS_NewGenericModule2() instead. + */ +extern NS_COM nsresult +NS_NewGenericModule(const char* moduleName, + PRUint32 componentCount, + nsModuleComponentInfo* components, + nsModuleDestructorProc dtor, + nsIModule* *result); #if defined(XPCOM_TRANSLATE_NSGM_ENTRY_POINT) # define NSMODULEINFO(_name) _name##_gModuleInfo @@ -144,7 +158,7 @@ NSGetModule(nsIComponentManager *servMgr, \ nsIFile* location, \ nsIModule** result) \ { \ - return NS_NewGenericModule(&(_info), result); \ + return NS_NewGenericModule2(&(_info), result); \ } #endif diff --git a/mozilla/xpfe/bootstrap/nsStaticComponents.cpp.in b/mozilla/xpfe/bootstrap/nsStaticComponents.cpp.in index b845b53f1ce..c8d112b5ebb 100644 --- a/mozilla/xpfe/bootstrap/nsStaticComponents.cpp.in +++ b/mozilla/xpfe/bootstrap/nsStaticComponents.cpp.in @@ -43,7 +43,7 @@ NSGETMODULE(_name) (nsIComponentManager* aCompMgr, \ nsIFile* aLocation, \ nsIModule** aResult) \ { \ - return NS_NewGenericModule(&NSMODULEINFO(_name), aResult); \ + return NS_NewGenericModule2(&NSMODULEINFO(_name), aResult);\ } // NSGetModule entry points