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

diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp
--- a/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp
+++ b/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp
@@ -1251,8 +1251,12 @@ private:
 
   class PendingLookup {
   public:
-    nsCString mKey;
-    nsCOMPtr<nsIUrlClassifierLookupCallback> mCallback;
+    PendingLookup(const nsACString &key, nsIUrlClassifierLookupCallback* cb)
+      : mKey(key)
+      , mCallback(cb) { }
+
+    const nsCString mKey;
+    nsIUrlClassifierLookupCallback* const mCallback;
   };
 
   // list of pending lookups
@@ -1334,11 +1338,8 @@ nsUrlClassifierDBServiceWorker::QueueLoo
 {
   nsAutoLock lock(mPendingLookupLock);
 
-  PendingLookup* lookup = mPendingLookups.AppendElement();
+  PendingLookup* lookup = mPendingLookups.AppendElement(PendingLookup(spec, callback));
   if (!lookup) return NS_ERROR_OUT_OF_MEMORY;
-
-  lookup->mKey = spec;
-  lookup->mCallback = callback;
 
   return NS_OK;
 }