Bug 675500 - Remove --disable-storage. r=khuey
authorMatheus Kerschbaum <matjk7@gmail.com>
Sat, 06 Aug 2011 19:05:49 +0200
changeset 74346 9754cac0194cdd25979acae750cd3ca9ed32f734
parent 74345 b0d6e197c741da6c00f53b1a6ec99277f24f70e9
child 74347 33b34c07f8fc033dc09e468230194b78bfa5c0ed
push idunknown
push userunknown
push dateunknown
reviewerskhuey
bugs675500
milestone8.0a1
Bug 675500 - Remove --disable-storage. r=khuey
config/autoconf.mk.in
configure.in
dom/base/nsGlobalWindow.cpp
dom/src/storage/Makefile.in
dom/src/storage/nsDOMStorage.cpp
dom/src/storage/nsDOMStorage.h
netwerk/build/Makefile.in
netwerk/cache/Makefile.in
toolkit/library/libxul-config.mk
toolkit/library/nsStaticXULComponents.cpp
toolkit/toolkit-makefiles.sh
toolkit/toolkit-tiers.mk
xulrunner/confvars.sh
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -138,17 +138,16 @@ MOZ_UPDATE_CHANNEL	= @MOZ_UPDATE_CHANNEL
 MOZ_UPDATE_PACKAGING	= @MOZ_UPDATE_PACKAGING@
 MOZ_DISABLE_PARENTAL_CONTROLS = @MOZ_DISABLE_PARENTAL_CONTROLS@
 NS_ENABLE_TSF = @NS_ENABLE_TSF@
 MOZ_SPELLCHECK = @MOZ_SPELLCHECK@
 MOZ_PROFILELOCKING = @MOZ_PROFILELOCKING@
 MOZ_FEEDS = @MOZ_FEEDS@
 MOZ_TOOLKIT_SEARCH = @MOZ_TOOLKIT_SEARCH@
 MOZ_PLACES = @MOZ_PLACES@
-MOZ_STORAGE = @MOZ_STORAGE@
 MOZ_SAFE_BROWSING = @MOZ_SAFE_BROWSING@
 MOZ_URL_CLASSIFIER = @MOZ_URL_CLASSIFIER@
 MOZ_ZIPWRITER = @MOZ_ZIPWRITER@
 MOZ_OGG = @MOZ_OGG@
 MOZ_RAW = @MOZ_RAW@
 MOZ_SYDNEYAUDIO = @MOZ_SYDNEYAUDIO@
 MOZ_WAVE = @MOZ_WAVE@
 MOZ_MEDIA = @MOZ_MEDIA@
--- a/configure.in
+++ b/configure.in
@@ -4790,17 +4790,16 @@ MOZ_PLACES=1
 MOZ_PREF_EXTENSIONS=1
 MOZ_PROFILELOCKING=1
 MOZ_PSM=1
 MOZ_RDF=1
 MOZ_REFLOW_PERF=
 MOZ_SAFE_BROWSING=
 MOZ_HELP_VIEWER=
 MOZ_SPELLCHECK=1
-MOZ_STORAGE=1
 MOZ_SVG_DLISTS=
 MOZ_TOOLKIT_SEARCH=1
 MOZ_UI_LOCALE=en-US
 MOZ_UNIVERSALCHARDET=1
 MOZ_URL_CLASSIFIER=
 MOZ_XSLT_STANDALONE=
 MOZ_XTF=1
 MOZ_XUL=1
@@ -6542,28 +6541,16 @@ if test -n "$MOZ_FEEDS"; then
     AC_DEFINE(MOZ_FEEDS)
 else
     if test "$MOZ_BUILD_APP" = "browser"; then
         AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
     fi
 fi
 
 dnl ========================================================
-dnl = Enable mozStorage
-dnl ========================================================
-dnl Implicitly enabled by default if building calendar or places
-MOZ_ARG_ENABLE_BOOL(storage,
-[  --enable-storage        Enable mozStorage module and related components],
-    MOZ_STORAGE=1,
-    MOZ_STORAGE= )
-if test -n "$MOZ_STORAGE"; then
-    AC_DEFINE(MOZ_STORAGE)
-fi
-
-dnl ========================================================
 dnl Check for sqlite
 dnl ========================================================
 
 MOZ_NATIVE_SQLITE=
 MOZ_ARG_ENABLE_BOOL(system-sqlite,
 [  --enable-system-sqlite  Use system sqlite (located with pkgconfig)],
 MOZ_NATIVE_SQLITE=1,
 MOZ_NATIVE_SQLITE= )
@@ -8903,17 +8890,16 @@ AC_SUBST(MOZ_JPROF)
 AC_SUBST(MOZ_SHARK)
 AC_SUBST(MOZ_CALLGRIND)
 AC_SUBST(MOZ_VTUNE)
 AC_SUBST(MOZ_ETW)
 AC_SUBST(MOZ_PROFILING)
 AC_SUBST(MOZ_QUANTIFY)
 AC_SUBST(LIBICONV)
 AC_SUBST(MOZ_PLACES)
-AC_SUBST(MOZ_STORAGE)
 AC_SUBST(MOZ_TOOLKIT_SEARCH)
 AC_SUBST(MOZ_FEEDS)
 AC_SUBST(NS_PRINTING)
 AC_SUBST(MOZ_WEBGL)
 AC_SUBST(MOZ_HELP_VIEWER)
 
 AC_SUBST(JAVA)
 AC_SUBST(JAVAC)
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -8052,34 +8052,30 @@ nsGlobalWindow::GetSessionStorage(nsIDOM
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsGlobalWindow::GetGlobalStorage(nsIDOMStorageList ** aGlobalStorage)
 {
   NS_ENSURE_ARG_POINTER(aGlobalStorage);
 
-#ifdef MOZ_STORAGE
   if (!Preferences::GetBool(kStorageEnabled)) {
     *aGlobalStorage = nsnull;
     return NS_OK;
   }
 
   if (!sGlobalStorageList) {
     nsresult rv = NS_NewDOMStorageList(&sGlobalStorageList);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   *aGlobalStorage = sGlobalStorageList;
   NS_IF_ADDREF(*aGlobalStorage);
 
   return NS_OK;
-#else
-  return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
-#endif
 }
 
 NS_IMETHODIMP
 nsGlobalWindow::GetLocalStorage(nsIDOMStorage ** aLocalStorage)
 {
   FORWARD_TO_INNER(GetLocalStorage, (aLocalStorage), NS_ERROR_UNEXPECTED);
 
   NS_ENSURE_ARG(aLocalStorage);
--- a/dom/src/storage/Makefile.in
+++ b/dom/src/storage/Makefile.in
@@ -41,30 +41,27 @@ srcdir         = @srcdir@
 VPATH          = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE         = dom
 LIBRARY_NAME   = jsdomstorage_s
 LIBXUL_LIBRARY = 1
 
-
-
-CPPSRCS =                  \
-       nsDOMStorage.cpp    \
+CPPSRCS = \
+       nsDOMStorage.cpp \
+       nsDOMStorageDBWrapper.cpp \
+       nsDOMStoragePersistentDB.cpp \
+       nsDOMStorageMemoryDB.cpp \
+       StorageChild.cpp \
+       StorageParent.cpp \
        $(NULL)
 
-ifdef MOZ_STORAGE
-CPPSRCS += nsDOMStorageDBWrapper.cpp nsDOMStoragePersistentDB.cpp nsDOMStorageMemoryDB.cpp
-
-CPPSRCS += StorageChild.cpp StorageParent.cpp
-
 EXPORTS_NAMESPACES = mozilla/dom
 EXPORTS_mozilla/dom = StorageChild.h StorageParent.h
-endif
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
 LOCAL_INCLUDES = \
                 -I$(topsrcdir)/dom/base \
 		-I$(topsrcdir)/content/events/src
 
--- a/dom/src/storage/nsDOMStorage.cpp
+++ b/dom/src/storage/nsDOMStorage.cpp
@@ -281,22 +281,20 @@ nsDOMStorageManager::Initialize()
     return NS_OK;
 
   os->AddObserver(gStorageManager, "cookie-changed", PR_FALSE);
   os->AddObserver(gStorageManager, "offline-app-removed", PR_FALSE);
   os->AddObserver(gStorageManager, NS_PRIVATE_BROWSING_SWITCH_TOPIC, PR_FALSE);
   os->AddObserver(gStorageManager, "profile-after-change", PR_FALSE);
   os->AddObserver(gStorageManager, "perm-changed", PR_FALSE);
   os->AddObserver(gStorageManager, "browser:purge-domain-data", PR_FALSE);
-#ifdef MOZ_STORAGE
   // Used for temporary table flushing
   os->AddObserver(gStorageManager, "profile-before-change", PR_FALSE);
   os->AddObserver(gStorageManager, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_FALSE);
   os->AddObserver(gStorageManager, NS_DOMSTORAGE_FLUSH_TIMER_OBSERVER, PR_FALSE);
-#endif
 
   return NS_OK;
 }
 
 //static
 nsDOMStorageManager*
 nsDOMStorageManager::GetInstance()
 {
@@ -308,20 +306,18 @@ nsDOMStorageManager::GetInstance()
 
 //static
 void
 nsDOMStorageManager::Shutdown()
 {
   NS_IF_RELEASE(gStorageManager);
   gStorageManager = nsnull;
 
-#ifdef MOZ_STORAGE
   delete DOMStorageImpl::gStorageDB;
   DOMStorageImpl::gStorageDB = nsnull;
-#endif
 }
 
 static PLDHashOperator
 ClearStorage(nsDOMStorageEntry* aEntry, void* userArg)
 {
   aEntry->mStorage->ClearAll();
   return PL_DHASH_REMOVE;
 }
@@ -384,48 +380,42 @@ nsDOMStorageManager::Observe(nsISupports
 {
   if (!strcmp(aTopic, "profile-after-change")) {
     nsCOMPtr<nsIPrivateBrowsingService> pbs =
       do_GetService(NS_PRIVATE_BROWSING_SERVICE_CONTRACTID);
     if (pbs)
       pbs->GetPrivateBrowsingEnabled(&gStorageManager->mInPrivateBrowsing);
   }
   else if (!strcmp(aTopic, "offline-app-removed")) {
-#ifdef MOZ_STORAGE
     nsresult rv = DOMStorageImpl::InitDB();
     NS_ENSURE_SUCCESS(rv, rv);
     return DOMStorageImpl::gStorageDB->RemoveOwner(NS_ConvertUTF16toUTF8(aData),
                                                    PR_TRUE);
-#endif
   } else if (!strcmp(aTopic, "cookie-changed") &&
              !nsCRT::strcmp(aData, NS_LITERAL_STRING("cleared").get())) {
     mStorages.EnumerateEntries(ClearStorage, nsnull);
 
-#ifdef MOZ_STORAGE
     nsresult rv = DOMStorageImpl::InitDB();
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Remove global storage for domains that aren't marked for offline use.
     nsTArray<nsString> domains;
     rv = GetOfflineDomains(domains);
     NS_ENSURE_SUCCESS(rv, rv);
     return DOMStorageImpl::gStorageDB->RemoveOwners(domains, PR_TRUE, PR_FALSE);
-#endif
   } else if (!strcmp(aTopic, NS_PRIVATE_BROWSING_SWITCH_TOPIC)) {
     mStorages.EnumerateEntries(ClearStorage, nsnull);
     if (!nsCRT::strcmp(aData, NS_LITERAL_STRING(NS_PRIVATE_BROWSING_ENTER).get()))
       mInPrivateBrowsing = PR_TRUE;
     else if (!nsCRT::strcmp(aData, NS_LITERAL_STRING(NS_PRIVATE_BROWSING_LEAVE).get()))
       mInPrivateBrowsing = PR_FALSE;
-#ifdef MOZ_STORAGE
     nsresult rv = DOMStorageImpl::InitDB();
     NS_ENSURE_SUCCESS(rv, rv);
 
     return DOMStorageImpl::gStorageDB->DropPrivateBrowsingStorages();
-#endif
   } else if (!strcmp(aTopic, "perm-changed")) {
     // Check for cookie permission change
     nsCOMPtr<nsIPermission> perm(do_QueryInterface(aSubject));
     if (perm) {
       nsCAutoString type;
       perm->GetType(type);
       if (type != NS_LITERAL_CSTRING("cookie"))
         return NS_OK;
@@ -436,22 +426,20 @@ nsDOMStorageManager::Observe(nsISupports
           nsDependentString(aData) != NS_LITERAL_STRING("deleted"))
         return NS_OK;
 
       nsCAutoString host;
       perm->GetHost(host);
       if (host.IsEmpty())
         return NS_OK;
 
-#ifdef MOZ_STORAGE
       nsresult rv = DOMStorageImpl::InitDB();
       NS_ENSURE_SUCCESS(rv, rv);
 
       return DOMStorageImpl::gStorageDB->DropSessionOnlyStoragesForHost(host);
-#endif
     }
   } else if (!strcmp(aTopic, "timer-callback")) {
     nsCOMPtr<nsIObserverService> obsserv = mozilla::services::GetObserverService();
     if (obsserv)
       obsserv->NotifyObservers(nsnull, NS_DOMSTORAGE_FLUSH_TIMER_OBSERVER, nsnull);
   } else if (!strcmp(aTopic, "browser:purge-domain-data")) {
     // Convert the domain name to the ACE format
     nsCAutoString aceDomain;
@@ -469,17 +457,16 @@ nsDOMStorageManager::Observe(nsISupports
 
     nsCAutoString key;
     rv = nsDOMStorageDBWrapper::CreateDomainScopeDBKey(aceDomain, key);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Clear the storage entries for matching domains
     mStorages.EnumerateEntries(ClearStorageIfDomainMatches, &key);
 
-#ifdef MOZ_STORAGE
     rv = DOMStorageImpl::InitDB();
     NS_ENSURE_SUCCESS(rv, rv);
 
     DOMStorageImpl::gStorageDB->RemoveOwner(aceDomain, PR_TRUE);
   } else if (!strcmp(aTopic, "profile-before-change") || 
              !strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
     if (DOMStorageImpl::gStorageDB) {
       nsresult rv = DOMStorageImpl::gStorageDB->FlushAndDeleteTemporaryTables(true);
@@ -487,17 +474,16 @@ nsDOMStorageManager::Observe(nsISupports
         NS_WARNING("DOMStorage: temporary table commit failed");
     }
   } else if (!strcmp(aTopic, NS_DOMSTORAGE_FLUSH_TIMER_OBSERVER)) {
     if (DOMStorageImpl::gStorageDB) {
       nsresult rv = DOMStorageImpl::gStorageDB->FlushAndDeleteTemporaryTables(false);
       if (NS_FAILED(rv))
         NS_WARNING("DOMStorage: temporary table commit failed");
     }
-#endif
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMStorageManager::GetUsage(const nsAString& aDomain,
                               PRInt32 *aUsage)
@@ -560,19 +546,17 @@ nsDOMStorageManager::RemoveFromStoragesH
   if (entry)
     mStorages.RemoveEntry(aStorage);
 }
 
 //
 // nsDOMStorage
 //
 
-#ifdef MOZ_STORAGE
 nsDOMStorageDBWrapper* DOMStorageImpl::gStorageDB = nsnull;
-#endif
 
 nsDOMStorageEntry::nsDOMStorageEntry(KeyTypePointer aStr)
   : nsVoidPtrHashKey(aStr), mStorage(nsnull)
 {
 }
 
 nsDOMStorageEntry::nsDOMStorageEntry(const nsDOMStorageEntry& aToCopy)
   : nsVoidPtrHashKey(aToCopy), mStorage(nsnull)
@@ -642,74 +626,68 @@ DOMStorageBase::InitAsSessionStorage(nsI
 {
   // No need to check for a return value. If this would fail we would not get
   // here as we call GetPrincipalURIAndHost (nsDOMStorage.cpp:88) from
   // nsDOMStorage::CanUseStorage before we query the storage manager for a new
   // sessionStorage. It calls GetAsciiHost on innermost URI. If it fails, we
   // won't get to InitAsSessionStorage.
   aDomainURI->GetAsciiHost(mDomain);
 
-#ifdef MOZ_STORAGE
   mUseDB = PR_FALSE;
   mScopeDBKey.Truncate();
   mQuotaDomainDBKey.Truncate();
-#endif
   mStorageType = nsPIDOMStorage::SessionStorage;
 }
 
 void
 DOMStorageBase::InitAsLocalStorage(nsIURI* aDomainURI,
                                    bool aCanUseChromePersist)
 {
   // No need to check for a return value. If this would fail we would not get
   // here as we call GetPrincipalURIAndHost (nsDOMStorage.cpp:88) from
   // nsDOMStorage::CanUseStorage before we query the storage manager for a new
   // localStorage. It calls GetAsciiHost on innermost URI. If it fails, we won't
   // get to InitAsLocalStorage. Actually, mDomain will get replaced with
   // mPrincipal in bug 455070. It is not even used for localStorage.
   aDomainURI->GetAsciiHost(mDomain);
 
-#ifdef MOZ_STORAGE
   nsDOMStorageDBWrapper::CreateOriginScopeDBKey(aDomainURI, mScopeDBKey);
 
   // XXX Bug 357323, we have to solve the issue how to define
   // origin for file URLs. In that case CreateOriginScopeDBKey
   // fails (the result is empty) and we must avoid database use
   // in that case because it produces broken entries w/o owner.
   mUseDB = !mScopeDBKey.IsEmpty();
 
   nsDOMStorageDBWrapper::CreateQuotaDomainDBKey(mDomain,
                                                 PR_TRUE, PR_FALSE, mQuotaDomainDBKey);
   nsDOMStorageDBWrapper::CreateQuotaDomainDBKey(mDomain,
                                                 PR_TRUE, PR_TRUE, mQuotaETLDplus1DomainDBKey);
-#endif
   mCanUseChromePersist = aCanUseChromePersist;
   mStorageType = nsPIDOMStorage::LocalStorage;
 }
 
 void
 DOMStorageBase::InitAsGlobalStorage(const nsACString& aDomainDemanded)
 {
   mDomain = aDomainDemanded;
 
-#ifdef MOZ_STORAGE
   nsDOMStorageDBWrapper::CreateDomainScopeDBKey(aDomainDemanded, mScopeDBKey);
 
   // XXX Bug 357323, we have to solve the issue how to define
   // origin for file URLs. In that case CreateOriginScopeDBKey
   // fails (the result is empty) and we must avoid database use
   // in that case because it produces broken entries w/o owner.
   if (!(mUseDB = !mScopeDBKey.IsEmpty()))
     mScopeDBKey.AppendLiteral(":");
 
   nsDOMStorageDBWrapper::CreateQuotaDomainDBKey(aDomainDemanded,
                                                 PR_TRUE, PR_FALSE, mQuotaDomainDBKey);
   nsDOMStorageDBWrapper::CreateQuotaDomainDBKey(aDomainDemanded,
                                                 PR_TRUE, PR_TRUE, mQuotaETLDplus1DomainDBKey);
-#endif
   mStorageType = nsPIDOMStorage::GlobalStorage;
 }
 
 PLDHashOperator
 SessionStorageTraverser(nsSessionStorageEntry* aEntry, void* userArg) {
   nsCycleCollectionTraversalCallback *cb = 
       static_cast<nsCycleCollectionTraversalCallback*>(userArg);
 
@@ -759,17 +737,16 @@ DOMStorageImpl::~DOMStorageImpl()
 {
   if (nsDOMStorageManager::gStorageManager)
     nsDOMStorageManager::gStorageManager->RemoveFromStoragesHash(this);
 }
 
 nsresult
 DOMStorageImpl::InitDB()
 {
-#ifdef MOZ_STORAGE
   if (!gStorageDB) {
     gStorageDB = new nsDOMStorageDBWrapper();
     if (!gStorageDB)
       return NS_ERROR_OUT_OF_MEMORY;
 
     nsresult rv = gStorageDB->Init();
     if (NS_FAILED(rv)) {
       // Failed to initialize the DB, delete it and null out the
@@ -777,17 +754,16 @@ DOMStorageImpl::InitDB()
       // un-initialized DB later on.
 
       delete gStorageDB;
       gStorageDB = nsnull;
 
       return rv;
     }
   }
-#endif
 
   return NS_OK;
 }
 
 void
 DOMStorageImpl::InitFromChild(bool aUseDB, bool aCanUseChromePersist,
                               bool aSessionOnly, const nsACString& aDomain,
                               const nsACString& aScopeDBKey,
@@ -866,17 +842,16 @@ DOMStorageImpl::GetCachedValue(const nsA
 }
 
 nsresult
 DOMStorageImpl::GetDBValue(const nsAString& aKey, nsAString& aValue,
                            PRBool* aSecure)
 {
   aValue.Truncate();
 
-#ifdef MOZ_STORAGE
   if (!UseDB())
     return NS_OK;
 
   nsresult rv = InitDB();
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoString value;
   rv = gStorageDB->GetKeyValue(this, aKey, value, aSecure);
@@ -885,27 +860,25 @@ DOMStorageImpl::GetDBValue(const nsAStri
       mStorageType != nsPIDOMStorage::GlobalStorage) {
     SetDOMStringToNull(aValue);
   }
 
   if (NS_FAILED(rv))
     return rv;
 
   aValue.Assign(value);
-#endif
 
   return NS_OK;
 }
 
 nsresult
 DOMStorageImpl::SetDBValue(const nsAString& aKey,
                            const nsAString& aValue,
                            PRBool aSecure)
 {
-#ifdef MOZ_STORAGE
   if (!UseDB())
     return NS_OK;
 
   nsresult rv = InitDB();
   NS_ENSURE_SUCCESS(rv, rv);
 
   PRInt32 offlineAppPermission;
   PRInt32 quota;
@@ -935,34 +908,28 @@ DOMStorageImpl::SetDBValue(const nsAStri
       }
     }
 
     nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
     os->NotifyObservers(window, "dom-storage-warn-quota-exceeded",
                        NS_ConvertUTF8toUTF16(mDomain).get());
   }
 
-#endif
-
   return NS_OK;
 }
 
 nsresult
 DOMStorageImpl::SetSecure(const nsAString& aKey, PRBool aSecure)
 {
-#ifdef MOZ_STORAGE
   if (UseDB()) {
     nsresult rv = InitDB();
     NS_ENSURE_SUCCESS(rv, rv);
 
     return gStorageDB->SetSecure(this, aKey, aSecure);
   }
-#else
-  return NS_ERROR_NOT_IMPLEMENTED;
-#endif
 
   nsSessionStorageEntry *entry = mItems.GetEntry(aKey);
   NS_ASSERTION(entry, "Don't use SetSecure() with nonexistent keys!");
 
   if (entry) {
     entry->mItem->SetSecureInternal(aSecure);
   }  
 
@@ -1022,32 +989,30 @@ DOMStorageImpl::CloneFrom(bool aCallerSe
   CopyArgs args = { this, aCallerSecure };
   that->mItems.EnumerateEntries(CopyStorageItems, &args);
   return NS_OK;
 }
 
 nsresult
 DOMStorageImpl::CacheKeysFromDB()
 {
-#ifdef MOZ_STORAGE
   // cache all the keys in the hash. This is used by the Length and Key methods
   // use this cache for better performance. The disadvantage is that the
   // order may break if someone changes the keys in the database directly.
   if (!mItemsCached) {
     nsresult rv = InitDB();
     NS_ENSURE_SUCCESS(rv, rv);
 
     mItems.Clear();
 
     rv = gStorageDB->GetAllKeys(this, &mItems);
     NS_ENSURE_SUCCESS(rv, rv);
 
     mItemsCached = PR_TRUE;
   }
-#endif
 
   return NS_OK;
 }
 
 struct KeysArrayBuilderStruct
 {
   PRBool callerIsSecure;
   nsTArray<nsString> *keys;
@@ -1270,17 +1235,16 @@ DOMStorageImpl::RemoveValue(bool aCaller
   nsString oldValue;
   nsSessionStorageEntry *entry = mItems.GetEntry(aKey);
 
   if (entry && entry->mItem->IsSecure() && !aCallerSecure) {
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
   if (UseDB()) {
-#ifdef MOZ_STORAGE
     nsresult rv = InitDB();
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsAutoString value;
     PRBool secureItem;
     rv = GetDBValue(aKey, value, &secureItem);
     NS_ENSURE_SUCCESS(rv, rv);
     if (!aCallerSecure && secureItem)
@@ -1288,17 +1252,16 @@ DOMStorageImpl::RemoveValue(bool aCaller
 
     oldValue = value;
 
     rv = gStorageDB->RemoveKey(this, aKey, !IsOfflineAllowed(mDomain),
                                aKey.Length() + value.Length());
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Before bug 536544 got fixed we were dropping mItemsCached flag here
-#endif
   }
   else if (entry) {
     // clear string as StorageItems may be referencing this item
     oldValue = entry->mItem->GetValueInternal();
     entry->mItem->ClearValue();
   }
 
   if (entry) {
@@ -1330,25 +1293,23 @@ DOMStorageImpl::Clear(bool aCallerSecure
 
   PRBool foundSecureItem = PR_FALSE;
   mItems.EnumerateEntries(CheckSecure, &foundSecureItem);
 
   if (foundSecureItem && !aCallerSecure) {
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
-#ifdef MOZ_STORAGE
   if (UseDB()) {
     nsresult rv = InitDB();
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = gStorageDB->ClearStorage(this);
     NS_ENSURE_SUCCESS(rv, rv);
   }
-#endif
 
   *aOldCount = oldCount;
   mItems.Clear();
   return NS_OK;
 }
 
 nsDOMStorage::nsDOMStorage()
   : mStorageType(nsPIDOMStorage::Unknown)
--- a/dom/src/storage/nsDOMStorage.h
+++ b/dom/src/storage/nsDOMStorage.h
@@ -59,19 +59,17 @@
 #include "nsIDOMStorageManager.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIObserver.h"
 #include "nsITimer.h"
 #include "nsWeakReference.h"
 
 #define NS_DOMSTORAGE_FLUSH_TIMER_OBSERVER "domstorage-flush-timer"
 
-#ifdef MOZ_STORAGE
 #include "nsDOMStorageDBWrapper.h"
-#endif
 
 #define IS_PERMISSION_ALLOWED(perm) \
       ((perm) != nsIPermissionManager::UNKNOWN_ACTION && \
       (perm) != nsIPermissionManager::DENY_ACTION)
 
 class nsDOMStorage;
 class nsIDOMStorage;
 class nsDOMStorageItem;
@@ -306,19 +304,17 @@ public:
   void ClearAll();
 
   virtual nsresult
   CloneFrom(bool aCallerSecure, DOMStorageBase* aThat);
 
   virtual bool CacheStoragePermissions();
 
 private:
-#ifdef MOZ_STORAGE
   static nsDOMStorageDBWrapper* gStorageDB;
-#endif
   friend class nsDOMStorageManager;
   friend class nsDOMStoragePersistentDB;
   friend class StorageParent;
 
   void Init(nsDOMStorage*);
 
   // Cross-process storage implementations never have InitAs(Session|Local|Global)Storage
   // called, so the appropriate initialization needs to happen from the child.
--- a/netwerk/build/Makefile.in
+++ b/netwerk/build/Makefile.in
@@ -136,17 +136,15 @@ ifdef NECKO_WIFI
 SHARED_LIBRARY_LIBS += \
   ../wifi/$(LIB_PREFIX)neckowifi_s.$(LIB_SUFFIX) \
   $(NULL)
 LOCAL_INCLUDES += -I$(srcdir)/../wifi
 
 endif
 
 
-ifdef MOZ_STORAGE
 DEFINES += -DNECKO_OFFLINE_CACHE
-endif
 
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -DIMPL_NS_NET
--- a/netwerk/cache/Makefile.in
+++ b/netwerk/cache/Makefile.in
@@ -67,37 +67,32 @@ EXPORTS = \
 CPPSRCS = \
   nsCache.cpp \
   nsCacheEntry.cpp \
   nsCacheEntryDescriptor.cpp \
   nsCacheMetaData.cpp \
   nsCacheService.cpp \
   nsCacheSession.cpp \
   nsMemoryCacheDevice.cpp \
+  nsDiskCacheDeviceSQL.cpp \
   $(NULL)
 
 ifdef NECKO_DISK_CACHE
 CPPSRCS += \
   nsDiskCacheBinding.cpp \
   nsDiskCacheBlockFile.cpp \
   nsDiskCacheDevice.cpp \
   nsDiskCacheEntry.cpp \
   nsDiskCacheMap.cpp \
   nsDiskCacheStreams.cpp \
   nsDeleteDir.cpp \
   $(NULL)
 endif
 
-ifdef MOZ_STORAGE
-CPPSRCS += \
-  nsDiskCacheDeviceSQL.cpp \
-  $(NULL)
-
 DEFINES += -DNECKO_OFFLINE_CACHE
-endif
 
 LOCAL_INCLUDES = \
   -I$(srcdir)/../base/src \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -DIMPL_NS_NET
--- a/toolkit/library/libxul-config.mk
+++ b/toolkit/library/libxul-config.mk
@@ -137,16 +137,17 @@ COMPONENT_LIBS += \
 	toolkitcomps \
 	pipboot \
 	pipnss \
 	appcomps \
 	jsreflect \
 	composer \
 	jetpack_s \
 	telemetry \
+	storagecomps \
 	$(NULL)
 
 ifdef BUILD_CTYPES
 COMPONENT_LIBS += \
 	jsctypes \
 	$(NULL)
 endif
 
@@ -221,21 +222,16 @@ endif
 
 ifeq (,$(filter android qt os2 cocoa windows,$(MOZ_WIDGET_TOOLKIT)))
 ifdef MOZ_XUL
 COMPONENT_LIBS += fileview
 DEFINES += -DMOZ_FILEVIEW
 endif
 endif
 
-ifdef MOZ_STORAGE
-COMPONENT_LIBS += storagecomps
-EXTRA_DSO_LDOPTS += $(SQLITE_LIBS)
-endif
-
 ifdef MOZ_PLACES
 COMPONENT_LIBS += \
 	places \
 	$(NULL)
 endif
 
 ifdef MOZ_XUL
 COMPONENT_LIBS += \
@@ -325,16 +321,17 @@ EXTRA_DSO_LDOPTS += \
 	$(PNG_LIBS) \
 	$(QCMS_LIBS) \
 	$(MOZ_JS_LIBS) \
 	$(NSS_LIBS) \
 	$(MOZ_CAIRO_LIBS) \
 	$(MOZ_HARFBUZZ_LIBS) \
 	$(MOZ_OTS_LIBS) \
 	$(MOZ_APP_EXTRA_LIBS) \
+	$(SQLITE_LIBS) \
 	$(NULL)
 
 ifdef MOZ_NATIVE_ZLIB
 EXTRA_DSO_LDOPTS += $(ZLIB_LIBS)
 else
 EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS)
 endif
 
--- a/toolkit/library/nsStaticXULComponents.cpp
+++ b/toolkit/library/nsStaticXULComponents.cpp
@@ -145,22 +145,16 @@
 #endif
 
 #if defined(MOZ_FILEVIEW) && defined(MOZ_XUL)
 #define FILEVIEW_MODULE MODULE(nsFileViewModule)
 #else
 #define FILEVIEW_MODULE
 #endif
 
-#ifdef MOZ_STORAGE
-#define STORAGE_MODULE MODULE(mozStorageModule)
-#else
-#define STORAGE_MODULE
-#endif
-
 #ifdef MOZ_ZIPWRITER
 #define ZIPWRITER_MODULE MODULE(ZipWriterModule)
 #else
 #define ZIPWRITER_MODULE
 #endif
 
 #ifdef MOZ_PLACES
 #define PLACES_MODULES \
@@ -254,17 +248,17 @@
     ACCESS_MODULES                           \
     MODULE(appshell)                         \
     MODULE(nsTransactionManagerModule)       \
     MODULE(nsComposerModule)                 \
     MODULE(application)                      \
     MODULE(Apprunner)                        \
     MODULE(CommandLineModule)                \
     FILEVIEW_MODULE                          \
-    STORAGE_MODULE                           \
+    MODULE(mozStorageModule)                 \
     PLACES_MODULES                           \
     XULENABLED_MODULES                       \
     MODULE(nsToolkitCompsModule)             \
     XREMOTE_MODULES                          \
     JSDEBUGGER_MODULES                       \
     MODULE(BOOT)                             \
     MODULE(NSS)                              \
     SYSTEMPREF_MODULES                       \
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -35,16 +35,17 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 # This file contains makefiles that will be generated for every XUL app.
 
 MAKEFILES_db="
   db/Makefile
+  db/sqlite3/src/Makefile
 "
 
 MAKEFILES_dom="
   ipc/Makefile
   ipc/chromium/Makefile
   ipc/glue/Makefile
   ipc/ipdl/Makefile
   dom/Makefile
@@ -390,16 +391,24 @@ MAKEFILES_netwerk="
   netwerk/streamconv/test/Makefile
   netwerk/test/Makefile
   netwerk/locales/Makefile
   netwerk/system/Makefile
   netwerk/system/mac/Makefile
   netwerk/system/win32/Makefile
 "
 
+MAKEFILES_storage="
+  storage/Makefile
+  storage/public/Makefile
+  storage/src/Makefile
+  storage/build/Makefile
+  storage/test/Makefile
+"
+
 MAKEFILES_uriloader="
   uriloader/Makefile
   uriloader/base/Makefile
   uriloader/exthandler/Makefile
   uriloader/exthandler/tests/Makefile
   uriloader/prefetch/Makefile
 "
 
@@ -748,16 +757,17 @@ add_makefiles "
   $MAKEFILES_layout
   $MAKEFILES_libimg
   $MAKEFILES_libjar
   $MAKEFILES_libreg
   $MAKEFILES_libpref
   $MAKEFILES_mathml
   $MAKEFILES_plugin
   $MAKEFILES_netwerk
+  $MAKEFILES_storage
   $MAKEFILES_uriloader
   $MAKEFILES_profile
   $MAKEFILES_rdf
   $MAKEFILES_sun_java
   $MAKEFILES_caps
   $MAKEFILES_chrome
   $MAKEFILES_view
   $MAKEFILES_docshell
@@ -930,27 +940,16 @@ if [ "$MOZ_ZIPWRITER" ]; then
   add_makefiles "
     modules/libjar/zipwriter/Makefile
     modules/libjar/zipwriter/public/Makefile
     modules/libjar/zipwriter/src/Makefile
     modules/libjar/zipwriter/test/Makefile
   "
 fi
 
-if [ "$MOZ_STORAGE" ]; then
-  add_makefiles "
-    db/sqlite3/src/Makefile
-    storage/Makefile
-    storage/public/Makefile
-    storage/src/Makefile
-    storage/build/Makefile
-    storage/test/Makefile
-  "
-fi
-
 if [ "$MOZ_TREE_CAIRO" ] ; then
   add_makefiles "
     gfx/cairo/Makefile
     gfx/cairo/cairo/src/Makefile
     gfx/cairo/cairo/src/cairo-features.h
   "
   if [ "$MOZ_TREE_PIXMAN" ] ; then
     add_makefiles "
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -107,29 +107,26 @@ ifdef MOZ_ENABLE_GTK2
 ifdef MOZ_X11
 tier_platform_dirs     += widget/src/gtkxtbin
 endif
 endif
 
 tier_platform_dirs	+= \
 		modules/libjar \
 		db \
+		storage \
 		$(NULL)
 
 ifdef MOZ_PERMISSIONS
 tier_platform_dirs += \
 		extensions/cookie \
 		extensions/permissions \
 		$(NULL)
 endif
 
-ifdef MOZ_STORAGE
-tier_platform_dirs += storage
-endif
-
 ifdef MOZ_RDF
 tier_platform_dirs += rdf
 endif
 
 ifdef MOZ_JSDEBUGGER
 tier_platform_dirs += js/jsd
 endif
 
--- a/xulrunner/confvars.sh
+++ b/xulrunner/confvars.sh
@@ -37,13 +37,11 @@
 # ***** END LICENSE BLOCK *****
 
 MOZ_APP_NAME=xulrunner
 MOZ_APP_DISPLAYNAME=XULRunner
 MOZ_UPDATER=1
 MOZ_XULRUNNER=1
 MOZ_CHROME_FILE_FORMAT=omni
 MOZ_APP_VERSION=$MOZILLA_VERSION
-if test "$MOZ_STORAGE"; then
-  MOZ_PLACES=1
-fi
+MOZ_PLACES=1
 MOZ_EXTENSIONS_DEFAULT=" gnomevfs"
 MOZ_URL_CLASSIFIER=1