content-hashtables
author Benjamin Smedberg <benjamin@smedbergs.us>
Sat, 26 Jul 2008 22:49:39 -0400
changeset 167 a4da40849f5436e629c5732f4368c6c48189637f
parent 153 cd96178a2e472dc6cd10443a56a3cedf9e8e1140
permissions -rw-r--r--
State as of now

diff --git a/content/base/public/nsContentUtils.h b/content/base/public/nsContentUtils.h
--- a/content/base/public/nsContentUtils.h
+++ b/content/base/public/nsContentUtils.h
@@ -1271,7 +1271,7 @@ private:
 
   static nsIConsoleService* sConsoleService;
 
-  static nsDataHashtable<nsISupportsHashKey, EventNameMapping>* sEventTable;
+  static nsDataHashtable<nsISupportsHashKey, EventNameMapping, GCAllocator>* sEventTable;
 
   static nsIStringBundleService* sStringBundleService;
   static nsIStringBundle* sStringBundles[PropertiesFile_COUNT];
diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -188,7 +188,7 @@ nsIPref *nsContentUtils::sPref = nsnull;
 nsIPref *nsContentUtils::sPref = nsnull;
 imgILoader *nsContentUtils::sImgLoader;
 nsIConsoleService *nsContentUtils::sConsoleService;
-nsDataHashtable<nsISupportsHashKey, EventNameMapping>* nsContentUtils::sEventTable = nsnull;
+nsDataHashtable<nsISupportsHashKey, EventNameMapping, GCAllocator>* nsContentUtils::sEventTable = nsnull;
 nsIStringBundleService *nsContentUtils::sStringBundleService;
 nsIStringBundle *nsContentUtils::sStringBundles[PropertiesFile_COUNT];
 nsIContentPolicy *nsContentUtils::sContentPolicyService;
@@ -461,7 +461,7 @@ nsContentUtils::InitializeEventTable() {
 #endif //MOZ_MEDIA
   };
 
-  sEventTable = new nsDataHashtable<nsISupportsHashKey, EventNameMapping>;
+  sEventTable = new nsDataHashtable<nsISupportsHashKey, EventNameMapping, GCAllocator>;
   if (!sEventTable ||
       !sEventTable->Init(int(NS_ARRAY_LENGTH(eventArray) / 0.75) + 1)) {
     delete sEventTable;
diff --git a/xpcom/ds/nsExpirationTracker.h b/xpcom/ds/nsExpirationTracker.h
--- a/xpcom/ds/nsExpirationTracker.h
+++ b/xpcom/ds/nsExpirationTracker.h
@@ -94,7 +94,8 @@ struct nsExpirationState {
  * Future work:
  * -- Add a method to change the timer period?
  */
-template <class T, PRUint32 K> class nsExpirationTracker {
+template <class T, PRUint32 K> class nsExpirationTracker : public XPCOMGCObject
+{
   public:
     /**
      * Initialize the tracker.
@@ -108,11 +109,15 @@ template <class T, PRUint32 K> class nsE
         mInAgeOneGeneration(PR_FALSE) {
       PR_STATIC_ASSERT(K >= 2 && K <= nsExpirationState::NOT_TRACKED);
     }
+
+#if 0
+    // Can't access mTimer anyway
     ~nsExpirationTracker() {
       if (mTimer) {
         mTimer->Cancel();
       }
     }
+#endif
 
     /**
      * Add an object to be tracked. It must not already be tracked. It will