Skip to content
Browse files

Bug 675500 - Remove --disable-storage. r=khuey

  • Loading branch information...
1 parent b5e8ee8 commit 3d8fb18a2cc4fc75a341c5bdb83f7098143cd077 Matheus Kerschbaum committed Aug 6, 2011
View
1 config/autoconf.mk.in
@@ -143,7 +143,6 @@ 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@
View
14 configure.in
@@ -4795,7 +4795,6 @@ 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
@@ -6547,18 +6546,6 @@ else
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 ========================================================
@@ -8908,7 +8895,6 @@ 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)
View
4 dom/base/nsGlobalWindow.cpp
@@ -8057,7 +8057,6 @@ nsGlobalWindow::GetGlobalStorage(nsIDOMStorageList ** aGlobalStorage)
{
NS_ENSURE_ARG_POINTER(aGlobalStorage);
-#ifdef MOZ_STORAGE
if (!Preferences::GetBool(kStorageEnabled)) {
*aGlobalStorage = nsnull;
return NS_OK;
@@ -8072,9 +8071,6 @@ nsGlobalWindow::GetGlobalStorage(nsIDOMStorageList ** aGlobalStorage)
NS_IF_ADDREF(*aGlobalStorage);
return NS_OK;
-#else
- return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
-#endif
}
NS_IMETHODIMP
View
17 dom/src/storage/Makefile.in
@@ -46,20 +46,17 @@ 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
View
39 dom/src/storage/nsDOMStorage.cpp
@@ -286,12 +286,10 @@ nsDOMStorageManager::Initialize()
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;
}
@@ -313,10 +311,8 @@ nsDOMStorageManager::Shutdown()
NS_IF_RELEASE(gStorageManager);
gStorageManager = nsnull;
-#ifdef MOZ_STORAGE
delete DOMStorageImpl::gStorageDB;
DOMStorageImpl::gStorageDB = nsnull;
-#endif
}
static PLDHashOperator
@@ -389,17 +385,14 @@ nsDOMStorageManager::Observe(nsISupports *aSubject,
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);
@@ -408,19 +401,16 @@ nsDOMStorageManager::Observe(nsISupports *aSubject,
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));
@@ -441,12 +431,10 @@ nsDOMStorageManager::Observe(nsISupports *aSubject,
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();
@@ -474,7 +462,6 @@ nsDOMStorageManager::Observe(nsISupports *aSubject,
// Clear the storage entries for matching domains
mStorages.EnumerateEntries(ClearStorageIfDomainMatches, &key);
-#ifdef MOZ_STORAGE
rv = DOMStorageImpl::InitDB();
NS_ENSURE_SUCCESS(rv, rv);
@@ -492,7 +479,6 @@ nsDOMStorageManager::Observe(nsISupports *aSubject,
if (NS_FAILED(rv))
NS_WARNING("DOMStorage: temporary table commit failed");
}
-#endif
}
return NS_OK;
@@ -565,9 +551,7 @@ nsDOMStorageManager::RemoveFromStoragesHash(DOMStorageImpl* aStorage)
// nsDOMStorage
//
-#ifdef MOZ_STORAGE
nsDOMStorageDBWrapper* DOMStorageImpl::gStorageDB = nsnull;
-#endif
nsDOMStorageEntry::nsDOMStorageEntry(KeyTypePointer aStr)
: nsVoidPtrHashKey(aStr), mStorage(nsnull)
@@ -647,11 +631,9 @@ DOMStorageBase::InitAsSessionStorage(nsIURI* aDomainURI)
// won't get to InitAsSessionStorage.
aDomainURI->GetAsciiHost(mDomain);
-#ifdef MOZ_STORAGE
mUseDB = PR_FALSE;
mScopeDBKey.Truncate();
mQuotaDomainDBKey.Truncate();
-#endif
mStorageType = nsPIDOMStorage::SessionStorage;
}
@@ -667,7 +649,6 @@ DOMStorageBase::InitAsLocalStorage(nsIURI* aDomainURI,
// 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
@@ -680,7 +661,6 @@ DOMStorageBase::InitAsLocalStorage(nsIURI* aDomainURI,
PR_TRUE, PR_FALSE, mQuotaDomainDBKey);
nsDOMStorageDBWrapper::CreateQuotaDomainDBKey(mDomain,
PR_TRUE, PR_TRUE, mQuotaETLDplus1DomainDBKey);
-#endif
mCanUseChromePersist = aCanUseChromePersist;
mStorageType = nsPIDOMStorage::LocalStorage;
}
@@ -690,7 +670,6 @@ 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
@@ -704,7 +683,6 @@ DOMStorageBase::InitAsGlobalStorage(const nsACString& aDomainDemanded)
PR_TRUE, PR_FALSE, mQuotaDomainDBKey);
nsDOMStorageDBWrapper::CreateQuotaDomainDBKey(aDomainDemanded,
PR_TRUE, PR_TRUE, mQuotaETLDplus1DomainDBKey);
-#endif
mStorageType = nsPIDOMStorage::GlobalStorage;
}
@@ -764,7 +742,6 @@ DOMStorageImpl::~DOMStorageImpl()
nsresult
DOMStorageImpl::InitDB()
{
-#ifdef MOZ_STORAGE
if (!gStorageDB) {
gStorageDB = new nsDOMStorageDBWrapper();
if (!gStorageDB)
@@ -782,7 +759,6 @@ DOMStorageImpl::InitDB()
return rv;
}
}
-#endif
return NS_OK;
}
@@ -871,7 +847,6 @@ DOMStorageImpl::GetDBValue(const nsAString& aKey, nsAString& aValue,
{
aValue.Truncate();
-#ifdef MOZ_STORAGE
if (!UseDB())
return NS_OK;
@@ -890,7 +865,6 @@ DOMStorageImpl::GetDBValue(const nsAString& aKey, nsAString& aValue,
return rv;
aValue.Assign(value);
-#endif
return NS_OK;
}
@@ -900,7 +874,6 @@ DOMStorageImpl::SetDBValue(const nsAString& aKey,
const nsAString& aValue,
PRBool aSecure)
{
-#ifdef MOZ_STORAGE
if (!UseDB())
return NS_OK;
@@ -940,24 +913,18 @@ DOMStorageImpl::SetDBValue(const nsAString& aKey,
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!");
@@ -1027,7 +994,6 @@ DOMStorageImpl::CloneFrom(bool aCallerSecure, DOMStorageBase* aThat)
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.
@@ -1042,7 +1008,6 @@ DOMStorageImpl::CacheKeysFromDB()
mItemsCached = PR_TRUE;
}
-#endif
return NS_OK;
}
@@ -1275,7 +1240,6 @@ DOMStorageImpl::RemoveValue(bool aCallerSecure, const nsAString& aKey,
}
if (UseDB()) {
-#ifdef MOZ_STORAGE
nsresult rv = InitDB();
NS_ENSURE_SUCCESS(rv, rv);
@@ -1293,7 +1257,6 @@ DOMStorageImpl::RemoveValue(bool aCallerSecure, const nsAString& aKey,
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
@@ -1335,15 +1298,13 @@ DOMStorageImpl::Clear(bool aCallerSecure, PRInt32* aOldCount)
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();
View
4 dom/src/storage/nsDOMStorage.h
@@ -64,9 +64,7 @@
#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 && \
@@ -311,9 +309,7 @@ class DOMStorageImpl : public DOMStorageBase
virtual bool CacheStoragePermissions();
private:
-#ifdef MOZ_STORAGE
static nsDOMStorageDBWrapper* gStorageDB;
-#endif
friend class nsDOMStorageManager;
friend class nsDOMStoragePersistentDB;
friend class StorageParent;
View
2 netwerk/build/Makefile.in
@@ -141,9 +141,7 @@ 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
View
7 netwerk/cache/Makefile.in
@@ -72,6 +72,7 @@ CPPSRCS = \
nsCacheService.cpp \
nsCacheSession.cpp \
nsMemoryCacheDevice.cpp \
+ nsDiskCacheDeviceSQL.cpp \
$(NULL)
ifdef NECKO_DISK_CACHE
@@ -86,13 +87,7 @@ CPPSRCS += \
$(NULL)
endif
-ifdef MOZ_STORAGE
-CPPSRCS += \
- nsDiskCacheDeviceSQL.cpp \
- $(NULL)
-
DEFINES += -DNECKO_OFFLINE_CACHE
-endif
LOCAL_INCLUDES = \
-I$(srcdir)/../base/src \
View
7 toolkit/library/libxul-config.mk
@@ -142,6 +142,7 @@ COMPONENT_LIBS += \
composer \
jetpack_s \
telemetry \
+ storagecomps \
$(NULL)
ifdef BUILD_CTYPES
@@ -226,11 +227,6 @@ DEFINES += -DMOZ_FILEVIEW
endif
endif
-ifdef MOZ_STORAGE
-COMPONENT_LIBS += storagecomps
-EXTRA_DSO_LDOPTS += $(SQLITE_LIBS)
-endif
-
ifdef MOZ_PLACES
COMPONENT_LIBS += \
places \
@@ -330,6 +326,7 @@ EXTRA_DSO_LDOPTS += \
$(MOZ_HARFBUZZ_LIBS) \
$(MOZ_OTS_LIBS) \
$(MOZ_APP_EXTRA_LIBS) \
+ $(SQLITE_LIBS) \
$(NULL)
ifdef MOZ_NATIVE_ZLIB
View
8 toolkit/library/nsStaticXULComponents.cpp
@@ -150,12 +150,6 @@
#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
@@ -259,7 +253,7 @@
MODULE(Apprunner) \
MODULE(CommandLineModule) \
FILEVIEW_MODULE \
- STORAGE_MODULE \
+ MODULE(mozStorageModule) \
PLACES_MODULES \
XULENABLED_MODULES \
MODULE(nsToolkitCompsModule) \
View
21 toolkit/toolkit-makefiles.sh
@@ -40,6 +40,7 @@
MAKEFILES_db="
db/Makefile
+ db/sqlite3/src/Makefile
"
MAKEFILES_dom="
@@ -395,6 +396,14 @@ MAKEFILES_netwerk="
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
@@ -753,6 +762,7 @@ add_makefiles "
$MAKEFILES_mathml
$MAKEFILES_plugin
$MAKEFILES_netwerk
+ $MAKEFILES_storage
$MAKEFILES_uriloader
$MAKEFILES_profile
$MAKEFILES_rdf
@@ -935,17 +945,6 @@ if [ "$MOZ_ZIPWRITER" ]; then
"
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
View
5 toolkit/toolkit-tiers.mk
@@ -112,6 +112,7 @@ endif
tier_platform_dirs += \
modules/libjar \
db \
+ storage \
$(NULL)
ifdef MOZ_PERMISSIONS
@@ -121,10 +122,6 @@ tier_platform_dirs += \
$(NULL)
endif
-ifdef MOZ_STORAGE
-tier_platform_dirs += storage
-endif
-
ifdef MOZ_RDF
tier_platform_dirs += rdf
endif
View
4 xulrunner/confvars.sh
@@ -42,8 +42,6 @@ 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

0 comments on commit 3d8fb18

Please sign in to comment.
Something went wrong with that request. Please try again.