Bug 504113 - "initialize mUsageDelta in nsInMemoryStorage()'s constructor" [r=honzab.moz]
authortimeless@mozdev.org
Wed, 22 Jul 2009 17:31:02 -0500
changeset 30572 15c44d1aeba207160d74602bc213e800067aa538
parent 30571 f33661125d0809f8b6bc9dfe11f17865c4fcee3c
child 30573 bce25c5c44c06084ba14e70f12b220e41e911578
push idunknown
push userunknown
push dateunknown
reviewershonzab
bugs504113
milestone1.9.2a1pre
Bug 504113 - "initialize mUsageDelta in nsInMemoryStorage()'s constructor" [r=honzab.moz] r=mayhemer
dom/src/storage/nsDOMStorageMemoryDB.cpp
dom/src/storage/nsDOMStorageMemoryDB.h
--- a/dom/src/storage/nsDOMStorageMemoryDB.cpp
+++ b/dom/src/storage/nsDOMStorageMemoryDB.cpp
@@ -81,17 +81,16 @@ nsDOMStorageMemoryDB::GetItemsTable(nsDO
     return NS_OK;
 
   *aMemoryStorage = nsnull;
 
   nsInMemoryStorage* storageData = new nsInMemoryStorage();
   if (!storageData)
     return NS_ERROR_OUT_OF_MEMORY;
 
-  storageData->mUsageDelta = 0;
   if (!storageData->mTable.Init()) {
     delete storageData;
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   if (mPreloadDB) {
     nsresult rv;
 
--- a/dom/src/storage/nsDOMStorageMemoryDB.h
+++ b/dom/src/storage/nsDOMStorageMemoryDB.h
@@ -61,17 +61,17 @@ public:
   typedef nsClassHashtable<nsStringHashKey, nsInMemoryItem> nsStorageItemsTable;
 
   class nsInMemoryStorage
   {
   public:
     nsStorageItemsTable mTable;
     PRInt32 mUsageDelta;
 
-    nsInMemoryStorage() { mTable.Init(20); }
+    nsInMemoryStorage() : mUsageDelta(0) { mTable.Init(20); }
   };
 
   /**
    * @param aPreloadDB
    *    If non-null, data for a domain/origin will be preloaded from
    *    the provided database. Used for session-only cookies mode to
    *    provide existing data from the persistent database.
    */