More Linux-specific fixup from bug 568691
authorBenjamin Smedberg <benjamin@smedbergs.us>
Sat, 12 Jun 2010 20:50:56 -0400
changeset 47003 afe6f788949a2d5b96ebc18ff26e74d0b5080be4
parent 47002 7bc6085d7e6eb1fb0523af2857846fbf6a146cb7
child 47006 d819800d60bb81947b12f3c237de755a0590ff0d
push idunknown
push userunknown
push dateunknown
bugs568691
milestone1.9.3a6pre
More Linux-specific fixup from bug 568691
extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
extensions/pref/system-pref/src/nsSystemPrefFactory.cpp
toolkit/components/filepicker/src/nsFileView.cpp
toolkit/components/remote/nsGTKRemoteService.cpp
toolkit/system/dbus/nsDBusModule.cpp
toolkit/system/gnome/nsGnomeModule.cpp
toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
widget/src/gtk2/nsWidgetFactory.cpp
--- a/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
+++ b/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
@@ -39,17 +39,17 @@
 extern "C" {
 #include <libgnomevfs/gnome-vfs.h>
 #include <libgnomevfs/gnome-vfs-standard-callbacks.h>
 #include <libgnomevfs/gnome-vfs-mime-utils.h>
 }
 
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
-#include "nsIGenericFactory.h"
+#include "mozilla/ModuleUtils.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch2.h"
 #include "nsIObserver.h"
 #include "nsThreadUtils.h"
 #include "nsProxyRelease.h"
 #include "nsIAuthPrompt.h"
 #include "nsIStringBundle.h"
@@ -980,19 +980,27 @@ nsGnomeVFSProtocolHandler::Observe(nsISu
 { /* 9b6dc177-a2e4-49e1-9c98-0a8384de7f6c */         \
     0x9b6dc177,                                      \
     0xa2e4,                                          \
     0x49e1,                                          \
     {0x9c, 0x98, 0x0a, 0x83, 0x84, 0xde, 0x7f, 0x6c} \
 }
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGnomeVFSProtocolHandler, Init)
+NS_DEFINE_NAMED_CID(NS_GNOMEVFSPROTOCOLHANDLER_CID);
 
-static const nsModuleComponentInfo components[] =
-{
-  { "nsGnomeVFSProtocolHandler",
-    NS_GNOMEVFSPROTOCOLHANDLER_CID,
-    NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX MOZ_GNOMEVFS_SCHEME,
-    nsGnomeVFSProtocolHandlerConstructor
-  }
+static const mozilla::Module::CIDEntry kVFSCIDs[] = {
+  { &kNS_GNOMEVFSPROTOCOLHANDLER_CID, false, NULL, nsGnomeVFSProtocolHandlerConstructor },
+  { NULL }
 };
 
-NS_IMPL_NSGETMODULE(nsGnomeVFSModule, components)
+static const mozilla::Module::ContractIDEntry kVFSContracts[] = {
+  { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX MOZ_GNOMEVFS_SCHEME, &kNS_GNOMEVFSPROTOCOLHANDLER_CID },
+  { NULL }
+};
+
+static const mozilla::Module kVFSModule = {
+  mozilla::Module::kVersion,
+  kVFSCIDs,
+  kVFSContracts
+};
+
+NSMODULE_DEFN(nsGnomeVFSModule) = &kVFSModule;
--- a/extensions/pref/system-pref/src/nsSystemPrefFactory.cpp
+++ b/extensions/pref/system-pref/src/nsSystemPrefFactory.cpp
@@ -35,72 +35,43 @@
  * 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 NPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsICategoryManager.h"
-#include "nsIGenericFactory.h"
+#include "mozilla/ModuleUtils.h"
 #include "nsSystemPref.h"
 #include "nsSystemPrefService.h"
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSystemPref, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSystemPrefService, Init)
 
-// Registering nsSystemPref module as part of the app-startup category to get 
-// it instantiated.
-
-static NS_METHOD
-RegisterSystemPref(nsIComponentManager *aCompMgr,
-                   nsIFile *aPath,
-                   const char *registryLocation,
-                   const char *componentType,
-                   const nsModuleComponentInfo *info)
-{
-    nsresult rv;
-
-    nsCOMPtr<nsICategoryManager>
-        categoryManager(do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv));
-    if (NS_SUCCEEDED(rv)) {
-        rv = categoryManager->AddCategoryEntry(APPSTARTUP_CATEGORY,
-                                               "SystemPref Module",
-                                               NS_SYSTEMPREF_CONTRACTID,
-                                               PR_TRUE, PR_TRUE, nsnull);
-    }
-
-    return rv;
-}
+NS_DEFINE_NAMED_CID(NS_SYSTEMPREF_CID);
+NS_DEFINE_NAMED_CID(NS_SYSTEMPREF_SERVICE_CID);
 
-static NS_METHOD 
-UnRegisterSystemPref(nsIComponentManager *aCompMgr,
-                     nsIFile *aPath,
-                     const char *registryLocation,
-                     const nsModuleComponentInfo *info)
-{
-    nsresult rv;
-    nsCOMPtr<nsICategoryManager>
-        categoryManager(do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv));
-    if (NS_SUCCEEDED(rv)) {
-        rv = categoryManager->DeleteCategoryEntry(APPSTARTUP_CATEGORY,
-                                                  "SystemPref Module",
-                                                  PR_TRUE);
-    }
-    return rv;
-}
-
-static const nsModuleComponentInfo components[] = {
-    { NS_SYSTEMPREF_CLASSNAME,
-      NS_SYSTEMPREF_CID,
-      NS_SYSTEMPREF_CONTRACTID,
-      nsSystemPrefConstructor,
-      RegisterSystemPref,
-      UnRegisterSystemPref,
-    },
-    { NS_SYSTEMPREF_SERVICE_CLASSNAME,
-      NS_SYSTEMPREF_SERVICE_CID,
-      NS_SYSTEMPREF_SERVICE_CONTRACTID,
-      nsSystemPrefServiceConstructor,
-    },
+static const mozilla::Module::CIDEntry kSysPrefCIDs[] = {
+    { &kNS_SYSTEMPREF_CID, false, NULL, nsSystemPrefConstructor },
+    { &kNS_SYSTEMPREF_SERVICE_CID, false, NULL, nsSystemPrefServiceConstructor },
+    { NULL }
 };
 
-NS_IMPL_NSGETMODULE(nsSystemPrefModule, components)
+static const mozilla::Module::ContractIDEntry kSysPrefContracts[] = {
+    { NS_SYSTEMPREF_CONTRACTID, &kNS_SYSTEMPREF_CID },
+    { NS_SYSTEMPREF_SERVICE_CONTRACTID, &kNS_SYSTEMPREF_SERVICE_CID },
+    { NULL }
+};
+
+static const mozilla::Module::CategoryEntry kSysPrefCategories[] = {
+    { APPSTARTUP_CATEGORY, "SystemPref Module", NS_SYSTEMPREF_CONTRACTID },
+    { NULL }
+};
+
+static const mozilla::Module kSysPrefModule = {
+    mozilla::Module::kVersion,
+    kSysPrefCIDs,
+    kSysPrefContracts,
+    kSysPrefCategories
+};
+
+NSMODULE_DEFN(nsSystemPrefModule) = &kSysPrefModule;
--- a/toolkit/components/filepicker/src/nsFileView.cpp
+++ b/toolkit/components/filepicker/src/nsFileView.cpp
@@ -33,17 +33,17 @@
  * 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 "nsIFileView.h"
 #include "nsITreeView.h"
-#include "nsIGenericFactory.h"
+#include "mozilla/ModuleUtils.h"
 #include "nsITreeSelection.h"
 #include "nsITreeColumns.h"
 #include "nsITreeBoxObject.h"
 #include "nsILocalFile.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsCRT.h"
 #include "prmem.h"
@@ -258,27 +258,38 @@ protected:
   PRPackedBool mShowHiddenFiles;
   PRPackedBool mDirectoryFilter;
   PRPackedBool mReverseSort;
 };
 
 // Factory constructor
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFileComplete)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFileView, Init)
+NS_DEFINE_NAMED_CID(NS_FILECOMPLETE_CID);
+NS_DEFINE_NAMED_CID(NS_FILEVIEW_CID);
 
-static const nsModuleComponentInfo components[] =
-{
-  { "nsFileComplete", NS_FILECOMPLETE_CID,
-    NS_FILECOMPLETE_CONTRACTID, nsFileCompleteConstructor },
-  { "nsFileView", NS_FILEVIEW_CID,
-    NS_FILEVIEW_CONTRACTID, nsFileViewConstructor }
+static const mozilla::Module::CIDEntry kFileViewCIDs[] = {
+  { &kNS_FILECOMPLETE_CID, false, NULL, nsFileCompleteConstructor },
+  { &kNS_FILEVIEW_CID, false, NULL, nsFileViewConstructor },
+  { NULL }
 };
 
-NS_IMPL_NSGETMODULE(nsFileViewModule, components)
+static const mozilla::Module::ContractIDEntry kFileViewContracts[] = {
+  { NS_FILECOMPLETE_CONTRACTID, &kNS_FILECOMPLETE_CID },
+  { NS_FILEVIEW_CONTRACTID, &kNS_FILEVIEW_CID },
+  { NULL }
+};
 
+static const mozilla::Module kFileViewModule = {
+  mozilla::Module::kVersion,
+  kFileViewCIDs,
+  kFileViewContracts
+};
+
+NSMODULE_DEFN(nsFileViewModule) = &kFileViewModule;
 
 nsFileView::nsFileView() :
   mSortType(-1),
   mTotalRows(0),
   mShowHiddenFiles(PR_FALSE),
   mDirectoryFilter(PR_FALSE),
   mReverseSort(PR_FALSE)
 {
--- a/toolkit/components/remote/nsGTKRemoteService.cpp
+++ b/toolkit/components/remote/nsGTKRemoteService.cpp
@@ -45,17 +45,17 @@
 #include <stdlib.h>
 #include <gtk/gtk.h>
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
 
 #include "nsIBaseWindow.h"
 #include "nsIDocShell.h"
 #include "nsPIDOMWindow.h"
-#include "nsIGenericFactory.h"
+#include "mozilla/ModuleUtils.h"
 #include "nsILocalFile.h"
 #include "nsIObserverService.h"
 #include "nsIServiceManager.h"
 #include "nsIWeakReference.h"
 #include "nsIWidget.h"
 #include "nsIAppShellService.h"
 #include "nsAppShellCID.h"
 
@@ -598,19 +598,27 @@ Atom nsGTKRemoteService::sMozProfileAtom
 Atom nsGTKRemoteService::sMozProgramAtom;
 Atom nsGTKRemoteService::sMozCommandLineAtom;
 
 // {C0773E90-5799-4eff-AD03-3EBCD85624AC}
 #define NS_REMOTESERVICE_CID \
   { 0xc0773e90, 0x5799, 0x4eff, { 0xad, 0x3, 0x3e, 0xbc, 0xd8, 0x56, 0x24, 0xac } }
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsGTKRemoteService)
+NS_DEFINE_NAMED_CID(NS_REMOTESERVICE_CID);
 
-static const nsModuleComponentInfo components[] =
-{
-  { "Remote Service",
-    NS_REMOTESERVICE_CID,
-    "@mozilla.org/toolkit/remote-service;1",
-    nsGTKRemoteServiceConstructor
-  }
+static const mozilla::Module::CIDEntry kRemoteCIDs[] = {
+  { &kNS_REMOTESERVICE_CID, false, NULL, nsGTKRemoteServiceConstructor },
+  { NULL }
 };
 
-NS_IMPL_NSGETMODULE(RemoteServiceModule, components)
+static const mozilla::Module::ContractIDEntry kRemoteContracts[] = {
+  { "@mozilla.org/toolkit/remote-service;1", &kNS_REMOTESERVICE_CID },
+  { NULL }
+};
+
+static const mozilla::Module kRemoteModule = {
+  mozilla::Module::kVersion,
+  kRemoteCIDs,
+  kRemoteContracts
+};
+
+NSMODULE_DEFN(RemoteServiceModule) = &kRemoteModule;
--- a/toolkit/system/dbus/nsDBusModule.cpp
+++ b/toolkit/system/dbus/nsDBusModule.cpp
@@ -35,36 +35,43 @@
  * 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 NPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsServiceManagerUtils.h"
 #include "nsICategoryManager.h"
-#include "nsIGenericFactory.h"
+#include "mozilla/ModuleUtils.h"
 #include "nsIAppStartupNotifier.h"
 #include "nsNetworkManagerListener.h"
 #include "nsNetCID.h"
 
 #define NS_DBUS_NETWORK_LINK_SERVICE_CLASSNAME "DBus Network Link Status"
 #define NS_DBUS_NETWORK_LINK_SERVICE_CID    \
   { 0x75a500a2,                                        \
     0x0030,                                            \
     0x40f7,                                            \
     { 0x86, 0xf8, 0x63, 0xf2, 0x25, 0xb9, 0x40, 0xae } \
   }
   
 /* ===== XPCOM registration stuff ======== */
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNetworkManagerListener, Init)
+NS_DEFINE_NAMED_CID(NS_DBUS_NETWORK_LINK_SERVICE_CID);
 
-static const nsModuleComponentInfo components[] = {
-    { NS_DBUS_NETWORK_LINK_SERVICE_CLASSNAME,
-      NS_DBUS_NETWORK_LINK_SERVICE_CID,
-      NS_NETWORK_LINK_SERVICE_CONTRACTID,
-      nsNetworkManagerListenerConstructor,
-      nsnull,
-      nsnull,
-    },
+static const mozilla::Module::CIDEntry kDBUSCIDs[] = {
+    { &kNS_DBUS_NETWORK_LINK_SERVICE_CID, false, NULL, nsNetworkManagerListenerConstructor },
+    { NULL }
 };
 
-NS_IMPL_NSGETMODULE(nsDBusModule, components)
+static const mozilla::Module::ContractIDEntry kDBUSContracts[] = {
+    { NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_DBUS_NETWORK_LINK_SERVICE_CID },
+    { NULL }
+};
+
+static const mozilla::Module kDBUSModule = {
+    mozilla::Module::kVersion,
+    kDBUSCIDs,
+    kDBUSContracts
+};
+
+NSMODULE_DEFN(nsDBusModule) = &kDBUSModule;
--- a/toolkit/system/gnome/nsGnomeModule.cpp
+++ b/toolkit/system/gnome/nsGnomeModule.cpp
@@ -32,17 +32,17 @@
  * 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 "nsToolkitCompsCID.h"
-#include "nsIGenericFactory.h"
+#include "mozilla/ModuleUtils.h"
 
 #ifdef MOZ_ENABLE_GCONF
 #include "nsGConfService.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGConfService, Init)
 #endif
 #ifdef MOZ_ENABLE_GNOMEVFS
 #include "nsGnomeVFSService.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGnomeVFSService, Init)
@@ -51,36 +51,61 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGn
 #include "nsGIOService.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGIOService, Init)
 #endif
 #ifdef MOZ_ENABLE_LIBNOTIFY
 #include "nsAlertsService.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAlertsService, Init)
 #endif
 
-static const nsModuleComponentInfo components[] = {
 #ifdef MOZ_ENABLE_GCONF
-  { "GConf Service",
-    NS_GCONFSERVICE_CID,
-    NS_GCONFSERVICE_CONTRACTID,
-    nsGConfServiceConstructor },
+NS_DEFINE_NAMED_CID(NS_GCONFSERVICE_CID);
 #endif
 #ifdef MOZ_ENABLE_GNOMEVFS
-  { "GnomeVFS Service",
-    NS_GNOMEVFSSERVICE_CID,
-    NS_GNOMEVFSSERVICE_CONTRACTID,
-    nsGnomeVFSServiceConstructor },
+NS_DEFINE_NAMED_CID(NS_GNOMEVFSSERVICE_CID);
+#endif
+#ifdef MOZ_ENABLE_GIO
+NS_DEFINE_NAMED_CID(NS_GIOSERVICE_CID);
+#endif
+#ifdef MOZ_ENABLE_LIBNOTIFY
+NS_DEFINE_NAMED_CID(NS_SYSTEMALERTSSERVICE_CID);
+#endif
+
+
+static const mozilla::Module::CIDEntry kGnomeCIDs[] = {
+#ifdef MOZ_ENABLE_GCONF
+  { &kNS_GCONFSERVICE_CID, false, NULL, nsGConfServiceConstructor },
+#endif
+#ifdef MOZ_ENABLE_GNOMEVFS
+  { &kNS_GNOMEVFSSERVICE_CID, false, NULL, nsGnomeVFSServiceConstructor },
 #endif
 #ifdef MOZ_ENABLE_GIO
-  { "GIO Service",
-    NS_GIOSERVICE_CID,
-    NS_GIOSERVICE_CONTRACTID,
-    nsGIOServiceConstructor },
+  { &kNS_GIOSERVICE_CID, false, NULL, nsGIOServiceConstructor },
 #endif
 #ifdef MOZ_ENABLE_LIBNOTIFY
-  { "Gnome Alerts Service",
-    NS_SYSTEMALERTSSERVICE_CID,
-    NS_SYSTEMALERTSERVICE_CONTRACTID,
-    nsAlertsServiceConstructor },
+  { &kNS_SYSTEMALERTSSERVICE_CID, false, NULL, nsAlertsServiceConstructor },
 #endif
+  { NULL }
 };
 
-NS_IMPL_NSGETMODULE(mozgnome, components)
+static const mozilla::Module::ContractIDEntry kGnomeContracts[] = {
+#ifdef MOZ_ENABLE_GCONF
+  { NS_GCONFSERVICE_CONTRACTID, &kNS_GCONFSERVICE_CID },
+#endif
+#ifdef MOZ_ENABLE_GNOMEVFS
+  { NS_GNOMEVFSSERVICE_CONTRACTID, &kNS_GNOMEVFSSERVICE_CID },
+#endif
+#ifdef MOZ_ENABLE_GIO
+  { NS_GIOSERVICE_CONTRACTID, &kNS_GIOSERVICE_CID },
+#endif
+#ifdef MOZ_ENABLE_LIBNOTIFY
+  { NS_SYSTEMALERTSERVICE_CONTRACTID, &kNS_SYSTEMALERTSSERVICE_CID },
+#endif
+  { NULL }
+};
+
+static const mozilla::Module kGnomeModule = {
+  mozilla::Module::kVersion,
+  kGnomeCIDs,
+  kGnomeContracts
+};
+
+NSMODULE_DEFN(mozgnome) = &kGnomeModule;
--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
+++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
@@ -33,17 +33,17 @@
  * 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 "nsISystemProxySettings.h"
-#include "nsIGenericFactory.h"
+#include "mozilla/ModuleUtils.h"
 #include "nsIServiceManager.h"
 #include "nsIGConfService.h"
 #include "nsIURI.h"
 #include "nsReadableUtils.h"
 #include "nsArrayUtils.h"
 #include "prnetdb.h"
 #include "prenv.h"
 #include "nsPrintfCString.h"
@@ -412,17 +412,27 @@ nsUnixSystemProxySettings::GetProxyForUR
   return GetProxyFromGConf(scheme, host, port, aResult);
 }
 
 #define NS_UNIXSYSTEMPROXYSERVICE_CID  /* 0fa3158c-d5a7-43de-9181-a285e74cf1d4 */\
      { 0x0fa3158c, 0xd5a7, 0x43de, \
        {0x91, 0x81, 0xa2, 0x85, 0xe7, 0x4c, 0xf1, 0xd4 } }
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUnixSystemProxySettings, Init)
+NS_DEFINE_NAMED_CID(NS_UNIXSYSTEMPROXYSERVICE_CID);
 
-static const nsModuleComponentInfo components[] = {
-  { "Unix System Proxy Settings Service",
-    NS_UNIXSYSTEMPROXYSERVICE_CID,
-    NS_SYSTEMPROXYSETTINGS_CONTRACTID,
-    nsUnixSystemProxySettingsConstructor }
+static const mozilla::Module::CIDEntry kUnixProxyCIDs[] = {
+  { &kNS_UNIXSYSTEMPROXYSERVICE_CID, false, NULL, nsUnixSystemProxySettingsConstructor },
+  { NULL }
 };
 
-NS_IMPL_NSGETMODULE(nsUnixProxyModule, components)
+static const mozilla::Module::ContractIDEntry kUnixProxyContracts[] = {
+  { NS_SYSTEMPROXYSETTINGS_CONTRACTID, &kNS_UNIXSYSTEMPROXYSERVICE_CID },
+  { NULL }
+};
+
+static const mozilla::Module kUnixProxyModule = {
+  mozilla::Module::kVersion,
+  kUnixProxyCIDs,
+  kUnixProxyContracts
+};
+
+NSMODULE_DEFN(nsUnixProxyModule) = &kUnixProxyModule;
--- a/widget/src/gtk2/nsWidgetFactory.cpp
+++ b/widget/src/gtk2/nsWidgetFactory.cpp
@@ -292,17 +292,17 @@ static const mozilla::Module::CIDEntry k
     { &kNS_PRINTSESSION_CID, false, NULL, nsPrintSessionConstructor },
     { &kNS_DEVICE_CONTEXT_SPEC_CID, false, NULL, nsDeviceContextSpecGTKConstructor },
     { &kNS_PRINTDIALOGSERVICE_CID, false, NULL, nsPrintDialogServiceGTKConstructor },
 #endif 
     { &kNS_IMAGE_TO_PIXBUF_CID, false, NULL, nsImageToPixbufConstructor },
 #if defined(MOZ_X11)
     { &kNS_IDLE_SERVICE_CID, false, NULL, nsIdleServiceGTKConstructor },
 #endif
-
+    { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
     { "@mozilla.org/widget/window/gtk;1", &kNS_WINDOW_CID },
     { "@mozilla.org/widgets/child_window/gtk;1", &kNS_CHILD_CID },
     { "@mozilla.org/widget/appshell/gtk;1", &kNS_APPSHELL_CID },
     { "@mozilla.org/widget/lookandfeel;1", &kNS_LOOKANDFEEL_CID },
     { "@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID },
@@ -329,17 +329,17 @@ static const mozilla::Module::ContractID
     { "@mozilla.org/gfx/printsession;1", &kNS_PRINTSESSION_CID },
     { "@mozilla.org/gfx/devicecontextspec;1", &kNS_DEVICE_CONTEXT_SPEC_CID },
     { NS_PRINTDIALOGSERVICE_CONTRACTID, &kNS_PRINTDIALOGSERVICE_CID },
 #endif 
     { "@mozilla.org/widget/image-to-gdk-pixbuf;1", &kNS_IMAGE_TO_PIXBUF_CID },
 #if defined(MOZ_X11)
     { "@mozilla.org/widget/idleservice;1", &kNS_IDLE_SERVICE_CID },
 #endif
-
+    { NULL }
 };
 
 static void
 nsWidgetGtk2ModuleDtor()
 {
   nsFilePicker::Shutdown();
   nsSound::Shutdown();
   nsWindow::ReleaseGlobals();