Bug 576900 C++ fixes for new XPCOM registration r=Callek a=IanN for checkin to a CLOSED TREE
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Sun, 04 Jul 2010 23:50:50 +0100
changeset 5929 7ab1997b0fc5cf5449c329d66d430a68207e6dbf
parent 5928 5afc8075d2a6642089bc97a8d08d8958ca8a0331
child 5930 8dfdc991b81f0ac4f20bda672a9457225beb926f
push idunknown
push userunknown
push dateunknown
reviewersCallek, IanN
bugs576900
Bug 576900 C++ fixes for new XPCOM registration r=Callek a=IanN for checkin to a CLOSED TREE
suite/browser/src/nsBookmarksService.cpp
suite/build/nsSuiteModule.cpp
suite/feeds/src/nsFeedSniffer.cpp
suite/feeds/src/nsFeedSniffer.h
suite/profile/nsSuiteDirectoryProvider.cpp
suite/profile/nsSuiteDirectoryProvider.h
suite/shell/src/nsGNOMEShellService.cpp
suite/shell/src/nsMacShellService.cpp
suite/shell/src/nsWindowsShellService.cpp
--- a/suite/browser/src/nsBookmarksService.cpp
+++ b/suite/browser/src/nsBookmarksService.cpp
@@ -68,17 +68,16 @@
 #include "nsISound.h"
 #include "nsIPrompt.h"
 #include "nsIWindowWatcher.h"
 #include "nsWidgetsCID.h"
 
 #include "nsIURL.h"
 #include "nsIFileURL.h"
 #include "nsIFile.h"
-#include "nsIGenericFactory.h"
 #include "nsIInputStream.h"
 #include "nsILineInputStream.h"
 #include "nsIOutputStream.h"
 #include "nsNetUtil.h"
 #include "nsICacheEntryDescriptor.h"
 
 #include "nsICharsetConverterManager.h"
 #include "nsICharsetAlias.h"
--- a/suite/build/nsSuiteModule.cpp
+++ b/suite/build/nsSuiteModule.cpp
@@ -31,24 +31,24 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#include "nsIGenericFactory.h"
+#include "mozilla/ModuleUtils.h"
 #include "nsSuiteDirectoryProvider.h"
 #include "nsProfileMigrator.h"
 #include "nsSeamonkeyProfileMigrator.h"
 #include "nsThunderbirdProfileMigrator.h"
 #include "nsInternetSearchService.h"
 #include "nsLocalSearchService.h"
-#include "nsIGenericFactory.h"
+#include "nsNetCID.h"
 #include "nsRDFCID.h"
 #include "nsBookmarksService.h"
 #include "nsFeedSniffer.h"
 
 #if defined(XP_WIN)
 #include "nsUrlWidget.h"
 #if !defined(BUILD_STATIC_SHELL)
 #include "nsWindowsShellService.h"
@@ -75,101 +75,92 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsSuiteDi
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsProfileMigrator)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSeamonkeyProfileMigrator)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsThunderbirdProfileMigrator)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(LocalSearchDataSource, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(InternetSearchDataSource, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsBookmarksService, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFeedSniffer)
 
+#if defined(XP_WIN)
+NS_DEFINE_NAMED_CID(NS_IURLWIDGET_CID);
+#endif
+#if defined(NS_SUITEWININTEGRATION_CID)
+NS_DEFINE_NAMED_CID(NS_SUITEWININTEGRATION_CID);
+#elif defined(NS_SUITEMACINTEGRATION_CID)
+NS_DEFINE_NAMED_CID(NS_SUITEMACINTEGRATION_CID);
+#elif defined(NS_SUITEGNOMEINTEGRATION_CID)
+NS_DEFINE_NAMED_CID(NS_SUITEGNOMEINTEGRATION_CID);
+#endif
+NS_DEFINE_NAMED_CID(NS_SUITEDIRECTORYPROVIDER_CID);
+NS_DEFINE_NAMED_CID(NS_SUITEPROFILEMIGRATOR_CID);
+NS_DEFINE_NAMED_CID(NS_SEAMONKEYPROFILEMIGRATOR_CID);
+NS_DEFINE_NAMED_CID(NS_THUNDERBIRDPROFILEMIGRATOR_CID);
+NS_DEFINE_NAMED_CID(NS_RDFFINDDATASOURCE_CID);
+NS_DEFINE_NAMED_CID(NS_RDFSEARCHDATASOURCE_CID);
+NS_DEFINE_NAMED_CID(NS_BOOKMARKS_SERVICE_CID);
+NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID);
+
 /////////////////////////////////////////////////////////////////////////////
 
-static const nsModuleComponentInfo components[] = {
+static const mozilla::Module::CIDEntry kSuiteCIDs[] = {
 #if defined(XP_WIN)
-  { NS_IURLWIDGET_CLASSNAME, NS_IURLWIDGET_CID,
-    NS_IURLWIDGET_CONTRACTID, nsUrlWidgetConstructor },
-#if !defined(BUILD_STATIC_SHELL)
-  { "SeaMonkey Windows Integration",
-    NS_SUITEWININTEGRATION_CID,
-    NS_SUITESHELLSERVICE_CONTRACTID,
-    nsWindowsShellServiceConstructor },
-  { "SeaMonkey Windows Feed Integration",
-    NS_SUITEWININTEGRATION_CID,
-    NS_SUITEFEEDSERVICE_CONTRACTID,
-    nsWindowsShellServiceConstructor },
-#endif
-#elif defined(XP_MACOSX) && !defined(BUILD_STATIC_SHELL)
-  { "SeaMonkey Mac Feed Integration",
-    NS_SUITEMACINTEGRATION_CID,
-    NS_SUITEFEEDSERVICE_CONTRACTID,
-    nsMacShellServiceConstructor },
-#elif defined(MOZ_WIDGET_GTK2) && !defined(BUILD_STATIC_SHELL)
-  { "SeaMonkey Linux Feed Integration",
-    NS_SUITEGNOMEINTEGRATION_CID,
-    NS_SUITEFEEDSERVICE_CONTRACTID,
-    nsGNOMEShellServiceConstructor },
+  { &kNS_IURLWIDGET_CID, false, NULL, nsUrlWidgetConstructor },
 #endif
-
-  { "nsSuiteDirectoryProvider",
-    NS_SUITEDIRECTORYPROVIDER_CID,
-    NS_SUITEDIRECTORYPROVIDER_CONTRACTID,
-    nsSuiteDirectoryProviderConstructor,
-    nsSuiteDirectoryProvider::Register,
-    nsSuiteDirectoryProvider::Unregister },
-
-  { "Profile Migrator",
-    NS_SUITEPROFILEMIGRATOR_CID,
-    NS_PROFILEMIGRATOR_CONTRACTID,
-    nsProfileMigratorConstructor },
-  
-  { "SeaMonkey Profile Migrator",
-    NS_SEAMONKEYPROFILEMIGRATOR_CID,
-    NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "seamonkey",
-    nsSeamonkeyProfileMigratorConstructor },
-
-  { "Thunderbird Profile Migrator",
-    NS_THUNDERBIRDPROFILEMIGRATOR_CID,
-    NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "thunderbird",
-    nsThunderbirdProfileMigratorConstructor },
-
-  { "Local Search",
-    NS_RDFFINDDATASOURCE_CID,
-    NS_LOCALSEARCH_SERVICE_CONTRACTID,
-    LocalSearchDataSourceConstructor },
-
-  { "Local Search",
-    NS_RDFFINDDATASOURCE_CID,
-    NS_LOCALSEARCH_DATASOURCE_CONTRACTID,
-    LocalSearchDataSourceConstructor },
-
-  { "Internet Search",
-    NS_RDFSEARCHDATASOURCE_CID,
-    NS_INTERNETSEARCH_SERVICE_CONTRACTID,
-    InternetSearchDataSourceConstructor },
-
-  { "Internet Search",
-    NS_RDFSEARCHDATASOURCE_CID,
-    NS_INTERNETSEARCH_DATASOURCE_CONTRACTID,
-    InternetSearchDataSourceConstructor },
-
-  { "Bookmarks",
-    NS_BOOKMARKS_SERVICE_CID,
-    NS_BOOKMARKS_SERVICE_CONTRACTID,
-    nsBookmarksServiceConstructor },
-
-  { "Bookmarks",
-    NS_BOOKMARKS_SERVICE_CID,
-    "@mozilla.org/embeddor.implemented/bookmark-charset-resolver;1",
-    nsBookmarksServiceConstructor },
-
-  { "Bookmarks",
-    NS_BOOKMARKS_SERVICE_CID,
-    NS_BOOKMARKS_DATASOURCE_CONTRACTID,
-    nsBookmarksServiceConstructor },
-
-  { "Feed Sniffer",
-    NS_FEEDSNIFFER_CID,
-    NS_FEEDSNIFFER_CONTRACTID,
-    nsFeedSnifferConstructor,
-    nsFeedSniffer::Register }
+#if defined(NS_SUITEWININTEGRATION_CID)
+  { &kNS_SUITEWININTEGRATION_CID, false, NULL, nsWindowsShellServiceConstructor },
+#elif defined(NS_SUITEMACINTEGRATION_CID)
+  { &kNS_SUITEMACINTEGRATION_CID, false, NULL, nsMacShellServiceConstructor },
+#elif defined(NS_SUITEGNOMEINTEGRATION_CID)
+  { &kNS_SUITEGNOMEINTEGRATION_CID, false, NULL, nsGnomeShellServiceConstructor },
+#endif
+  { &kNS_SUITEDIRECTORYPROVIDER_CID, false, NULL, nsSuiteDirectoryProviderConstructor },
+  { &kNS_SUITEPROFILEMIGRATOR_CID, false, NULL, nsProfileMigratorConstructor },
+  { &kNS_SEAMONKEYPROFILEMIGRATOR_CID, false, NULL, nsSeamonkeyProfileMigratorConstructor },
+  { &kNS_THUNDERBIRDPROFILEMIGRATOR_CID, false, NULL, nsThunderbirdProfileMigratorConstructor },
+  { &kNS_RDFFINDDATASOURCE_CID, false, NULL, LocalSearchDataSourceConstructor },
+  { &kNS_RDFSEARCHDATASOURCE_CID, false, NULL, InternetSearchDataSourceConstructor },
+  { &kNS_BOOKMARKS_SERVICE_CID, false, NULL, nsBookmarksServiceConstructor },
+  { &kNS_FEEDSNIFFER_CID, false, NULL, nsFeedSnifferConstructor },
+  { NULL }
 };
 
-NS_IMPL_NSGETMODULE(nsSuiteModule, components)
+static const mozilla::Module::ContractIDEntry kSuiteContracts[] = {
+#if defined(XP_WIN)
+  { NS_IURLWIDGET_CONTRACTID, &kNS_IURLWIDGET_CID },
+#endif
+#if defined(NS_SUITEWININTEGRATION_CID)
+  { NS_SUITESHELLSERVICE_CONTRACTID, &kNS_SUITEWININTEGRATION_CID },
+  { NS_SUITEFEEDSERVICE_CONTRACTID, &kNS_SUITEWININTEGRATION_CID },
+#elif defined(NS_SUITEMACINTEGRATION_CID)
+  { NS_SUITEFEEDSERVICE_CONTRACTID, &kNS_SUITEMACINTEGRATION_CID },
+#elif defined(NS_SUITEGNOMEINTEGRATION_CID)
+  { NS_SUITEFEEDSERVICE_CONTRACTID, &kNS_SUITEGNOMEINTEGRATION_CID },
+#endif
+  { NS_SUITEDIRECTORYPROVIDER_CONTRACTID, &kNS_SUITEDIRECTORYPROVIDER_CID },
+  { NS_PROFILEMIGRATOR_CONTRACTID, &kNS_SUITEPROFILEMIGRATOR_CID },
+  { NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "seamonkey", &kNS_SEAMONKEYPROFILEMIGRATOR_CID },
+  { NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "thunderbird", &kNS_THUNDERBIRDPROFILEMIGRATOR_CID },
+  { NS_LOCALSEARCH_SERVICE_CONTRACTID, &kNS_RDFFINDDATASOURCE_CID },
+  { NS_LOCALSEARCH_DATASOURCE_CONTRACTID, &kNS_RDFFINDDATASOURCE_CID },
+  { NS_INTERNETSEARCH_SERVICE_CONTRACTID, &kNS_RDFSEARCHDATASOURCE_CID },
+  { NS_INTERNETSEARCH_DATASOURCE_CONTRACTID, &kNS_RDFSEARCHDATASOURCE_CID },
+  { NS_BOOKMARKS_SERVICE_CONTRACTID, &kNS_BOOKMARKS_SERVICE_CID },
+  { "@mozilla.org/embeddor.implemented/bookmark-charset-resolver;1", &kNS_BOOKMARKS_SERVICE_CID },
+  { NS_BOOKMARKS_DATASOURCE_CONTRACTID, &kNS_BOOKMARKS_SERVICE_CID },
+  { NS_FEEDSNIFFER_CONTRACTID, &kNS_FEEDSNIFFER_CID },
+  { NULL }
+};
+
+static const mozilla::Module::CategoryEntry kSuiteCategories[] = {
+  { XPCOM_DIRECTORY_PROVIDER_CATEGORY, "suite-directory-provider", NS_SUITEDIRECTORYPROVIDER_CONTRACTID },
+  { NS_CONTENT_SNIFFER_CATEGORY, "Feed Sniffer", NS_FEEDSNIFFER_CONTRACTID },
+  { NULL }
+};
+
+static const mozilla::Module kSuiteModule = {
+  mozilla::Module::kVersion,
+  kSuiteCIDs,
+  kSuiteContracts,
+  kSuiteCategories
+};
+
+NSMODULE_DEFN(SuiteModule) = &kSuiteModule;
--- a/suite/feeds/src/nsFeedSniffer.cpp
+++ b/suite/feeds/src/nsFeedSniffer.cpp
@@ -412,24 +412,8 @@ nsFeedSniffer::OnDataAvailable(nsIReques
 }
 
 NS_IMETHODIMP
 nsFeedSniffer::OnStopRequest(nsIRequest* request, nsISupports* context,
                              nsresult status)
 {
   return NS_OK;
 }
-
-NS_METHOD
-nsFeedSniffer::Register(nsIComponentManager *compMgr, nsIFile *path,
-                        const char *registryLocation,
-                        const char *componentType,
-                        const nsModuleComponentInfo *info)
-{
-  nsresult rv;
-  nsCOMPtr<nsICategoryManager> catman = do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
-  if (NS_FAILED(rv))
-    return rv;
-
-  return catman->AddCategoryEntry(NS_CONTENT_SNIFFER_CATEGORY, "Feed Sniffer",
-                                  NS_FEEDSNIFFER_CONTRACTID, PR_TRUE, PR_TRUE,
-                                  nsnull);
-}
--- a/suite/feeds/src/nsFeedSniffer.h
+++ b/suite/feeds/src/nsFeedSniffer.h
@@ -30,17 +30,16 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#include "nsIGenericFactory.h"
 #include "nsIContentSniffer.h"
 #include "nsIStreamListener.h"
 #include "nsStringAPI.h"
 
 #define NS_FEEDSNIFFER_CONTRACTID \
   "@mozilla.org/browser/feeds/sniffer;1"
 
 // {E5EEEF51-05CE-4885-9434-7287616D9547}
@@ -58,20 +57,15 @@ public:
 
   static NS_METHOD AppendSegmentToString(nsIInputStream* inputStream,
                                          void* closure,
                                          const char* rawSegment,
                                          PRUint32 toOffset,
                                          PRUint32 count,
                                          PRUint32* writeCount);
 
-  static NS_METHOD Register(nsIComponentManager* compMgr, nsIFile* path,
-                            const char* registryLocation,
-                            const char* componentType,
-                            const nsModuleComponentInfo *info);
-
 protected:
   nsresult ConvertEncodedData(nsIRequest* request, const PRUint8* data,
                               PRUint32 length);
 
 private:
   nsCString mDecodedData;
 };
--- a/suite/profile/nsSuiteDirectoryProvider.cpp
+++ b/suite/profile/nsSuiteDirectoryProvider.cpp
@@ -185,43 +185,8 @@ nsSuiteDirectoryProvider::AppendingEnume
 
 nsSuiteDirectoryProvider::AppendingEnumerator::AppendingEnumerator
     (nsISimpleEnumerator* aBase, const char* const aLeafName) :
   mBase(aBase), mLeafName(aLeafName)
 {
   // Initialize mNext to begin.
   GetNext();
 }
-
-NS_METHOD
-nsSuiteDirectoryProvider::Register(nsIComponentManager* aCompMgr,
-                                   nsIFile* aPath,
-                                   const char *aLoaderStr,
-                                   const char *aType,
-                                   const nsModuleComponentInfo *aInfo)
-{
-  nsresult rv;
-  nsCOMPtr<nsICategoryManager> catMan
-    (do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv));
-  if (NS_FAILED(rv))
-    return rv;
-
-  return catMan->AddCategoryEntry(XPCOM_DIRECTORY_PROVIDER_CATEGORY,
-                                  "suite-directory-provider",
-                                  NS_SUITEDIRECTORYPROVIDER_CONTRACTID,
-                                  PR_TRUE, PR_TRUE, nsnull);
-}
-
-
-NS_METHOD
-nsSuiteDirectoryProvider::Unregister(nsIComponentManager* aCompMgr,
-                                     nsIFile* aPath, const char *aLoaderStr,
-                                     const nsModuleComponentInfo *aInfo)
-{
-  nsresult rv;
-  nsCOMPtr<nsICategoryManager> catMan
-    (do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv));
-  if (NS_FAILED(rv))
-    return rv;
-
-  return catMan->DeleteCategoryEntry(XPCOM_DIRECTORY_PROVIDER_CATEGORY,
-                                     "suite-directory-provider", PR_TRUE);
-}
--- a/suite/profile/nsSuiteDirectoryProvider.h
+++ b/suite/profile/nsSuiteDirectoryProvider.h
@@ -38,39 +38,28 @@
 
 
 #include "nsIDirectoryService.h"
 #include "nsIFile.h"
 #include "nsISimpleEnumerator.h"
 #include "nsStringAPI.h"
 #include "nsCOMPtr.h"
 
-struct nsModuleComponentInfo;
-
 #define NS_SUITEDIRECTORYPROVIDER_CONTRACTID "@mozilla.org/suite/directory-provider;1"
 // {9aa21826-9d1d-433d-8c10-f313b26fa9dd}
 #define NS_SUITEDIRECTORYPROVIDER_CID \
   { 0x9aa21826, 0x9d1d, 0x433d, { 0x8c, 0x10, 0xf3, 0x13, 0xb2, 0x6f, 0xa9, 0xdd } }
 
 class nsSuiteDirectoryProvider : public nsIDirectoryServiceProvider2
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDIRECTORYSERVICEPROVIDER
   NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
 
-  static NS_METHOD Register(nsIComponentManager* aCompMgr,
-                            nsIFile* aPath, const char *aLoaderStr,
-                            const char *aType,
-                            const nsModuleComponentInfo *aInfo);
-
-  static NS_METHOD Unregister(nsIComponentManager* aCompMgr,
-                              nsIFile* aPath, const char *aLoaderStr,
-                              const nsModuleComponentInfo *aInfo);
-
 private:
   void EnsureProfileFile(const nsACString& aLeafName,
 			 nsIFile* aParentDir, nsIFile* aTarget);
 
   class AppendingEnumerator : public nsISimpleEnumerator
   {
   public:
     NS_DECL_ISUPPORTS
--- a/suite/shell/src/nsGNOMEShellService.cpp
+++ b/suite/shell/src/nsGNOMEShellService.cpp
@@ -36,17 +36,17 @@
 
 #include "nsCOMPtr.h"
 #include "nsComponentManagerUtils.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsGNOMEShellService.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIGConfService.h"
-#include "nsIGenericFactory.h"
+#include "mozilla/ModuleUtils.h"
 #include "nsIGnomeVFSService.h"
 #include "nsILocalFile.h"
 #include "nsIProcess.h"
 #include "prenv.h"
 
 NS_IMPL_ISUPPORTS1(nsGNOMEShellService, nsIShellService)
 
 nsresult
@@ -157,19 +157,29 @@ nsGNOMEShellService::OpenApplicationWith
 NS_IMETHODIMP
 nsGNOMEShellService::GetDefaultFeedReader(nsILocalFile** _retval)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 #ifdef BUILD_STATIC_SHELL
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
+NS_DEFINE_NAMED_CID(NS_SUITEGNOMEINTEGRATION_CID);
 
-static const nsModuleComponentInfo components[] = {
-  { "SeaMonkey Linux Feed Integration",
-    NS_SUITEGNOMEINTEGRATION_CID,
-    NS_SUITEFEEDSERVICE_CONTRACTID,
-    nsGNOMEShellServiceConstructor },
+static const mozilla::Module::CIDEntry kSuiteShellCIDs[] = {
+  { &kNS_SUITEGNOMEINTEGRATION_CID, false, NULL, nsGNOMEShellServiceConstructor },
+  { NULL }
 };
 
-NS_IMPL_NSGETMODULE(nsSuiteShellModule, components)
+static const mozilla::Module::ContractIDEntry kSuiteShellContracts[] = {
+  { NS_SUITEFEEDSERVICE_CONTRACTID, &kNS_SUITEGNOMEINTEGRATION_CID },
+  { NULL }
+};
+
+static const mozilla::Module kSuiteShellModule = {
+  mozilla::Module::kVersion,
+  kSuiteShellCIDs,
+  kSuiteShellContracts
+};
+
+NSMODULE_DEFN(nsSuiteShellModule) = &kSuiteShellModule;
 #endif
 
--- a/suite/shell/src/nsMacShellService.cpp
+++ b/suite/shell/src/nsMacShellService.cpp
@@ -39,17 +39,17 @@
 
 #include "nsCOMPtr.h"
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsMacShellService.h"
 #include "nsStringGlue.h"
 #include "nsIDOMElement.h"
 #include "nsILocalFileMac.h"
-#include "nsIGenericFactory.h"
+#include "mozilla/ModuleUtils.h"
 
 #include <CoreFoundation/CoreFoundation.h>
 #include <Carbon/Carbon.h>
 
 #define SAFARI_BUNDLE_IDENTIFIER "com.apple.Safari"
 
 NS_IMPL_ISUPPORTS1(nsMacShellService, nsIShellService)
 
@@ -187,19 +187,29 @@ nsMacShellService::GetDefaultFeedReader(
 
   ::CFRelease(defaultHandlerID);
 
   return rv;
 }
 
 #ifdef BUILD_STATIC_SHELL
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
+NS_DEFINE_NAMED_CID(NS_SUITEMACINTEGRATION_CID);
 
-static const nsModuleComponentInfo components[] = {
-  { "SeaMonkey Mac Feed Integration",
-    NS_SUITEMACINTEGRATION_CID,
-    NS_SUITEFEEDSERVICE_CONTRACTID,
-    nsMacShellServiceConstructor },
+static const mozilla::Module::CIDEntry kSuiteShellCIDs[] = {
+  { &kNS_SUITEMACINTEGRATION_CID, false, NULL, nsMacShellServiceConstructor },
+  { NULL }
 };
 
-NS_IMPL_NSGETMODULE(nsSuiteShellModule, components)
+static const mozilla::Module::ContractIDEntry kSuiteShellContracts[] = {
+  { NS_SUITEFEEDSERVICE_CONTRACTID, &kNS_SUITEMACINTEGRATION_CID },
+  { NULL }
+};
+
+static const mozilla::Module kSuiteShellModule = {
+  mozilla::Module::kVersion,
+  kSuiteShellCIDs,
+  kSuiteShellContracts
+};
+
+NSMODULE_DEFN(nsSuiteShellModule) = &kSuiteShellModule;
 #endif
 
--- a/suite/shell/src/nsWindowsShellService.cpp
+++ b/suite/shell/src/nsWindowsShellService.cpp
@@ -57,17 +57,17 @@
 #include "nsUnicharUtils.h"
 #include "nsIStringBundle.h"
 #include "nsIServiceManager.h"
 #include "nsServiceManagerUtils.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
 #include <mbstring.h>
-#include "nsIGenericFactory.h"
+#include "mozilla/ModuleUtils.h"
 
 #ifdef MOZILLA_INTERNAL_API
 #define CaseInsensitiveCompare nsCaseInsensitiveStringComparator()
 #endif
 
 #ifdef _WIN32_WINNT
 #undef _WIN32_WINNT
 #endif
@@ -865,22 +865,29 @@ nsWindowsShellService::GetDefaultFeedRea
     return NS_ERROR_FAILURE;
 
   NS_ADDREF(*_retval = defaultReader);
   return NS_OK;
 }
 
 #ifdef BUILD_STATIC_SHELL
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowsShellService, Init)
+NS_DEFINE_NAMED_CID(NS_SUITEWININTEGRATION_CID);
 
-static const nsModuleComponentInfo components[] = {
-  { "SeaMonkey Windows Integration",
-    NS_SUITEWININTEGRATION_CID,
-    NS_SUITESHELLSERVICE_CONTRACTID,
-    nsWindowsShellServiceConstructor },
-  { "SeaMonkey Windows Feed Integration",
-    NS_SUITEWININTEGRATION_CID,
-    NS_SUITEFEEDSERVICE_CONTRACTID,
-    nsWindowsShellServiceConstructor },
+static const mozilla::Module::CIDEntry kSuiteShellCIDs[] = {
+  { &kNS_SUITEWININTEGRATION_CID, false, NULL, nsWindowsShellServiceConstructor },
+  { NULL }
 };
 
-NS_IMPL_NSGETMODULE(nsSuiteShellModule, components)
+static const mozilla::Module::ContractIDEntry kSuiteShellContracts[] = {
+  { NS_SUITESHELLSERVICE_CONTRACTID, &kNS_SUITEWININTEGRATION_CID },
+  { NS_SUITEFEEDSERVICE_CONTRACTID, &kNS_SUITEWININTEGRATION_CID },
+  { NULL }
+};
+
+static const mozilla::Module kSuiteShellModule = {
+  mozilla::Module::kVersion,
+  kSuiteShellCIDs,
+  kSuiteShellContracts
+};
+
+NSMODULE_DEFN(nsSuiteShellModule) = &kSuiteShellModule;
 #endif