From 6fbd73ca251b44f94b7db091834e2af8f54e8658 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 19 Feb 2009 09:13:23 -0500 Subject: [PATCH] Backed out changeset 9059416d26cf to see whether that fixes Linux unit tests --- dom/src/storage/nsDOMStorage.cpp | 21 --- dom/src/storage/nsDOMStorage.h | 11 +- dom/tests/mochitest/bugs/Makefile.in | 2 - .../mochitest/bugs/iframe_bug463000.html | 152 ------------------ dom/tests/mochitest/bugs/test_bug463000.html | 39 ----- 5 files changed, 1 insertion(+), 224 deletions(-) delete mode 100644 dom/tests/mochitest/bugs/iframe_bug463000.html delete mode 100644 dom/tests/mochitest/bugs/test_bug463000.html diff --git a/dom/src/storage/nsDOMStorage.cpp b/dom/src/storage/nsDOMStorage.cpp index 5bced876268b..c6da0c361846 100644 --- a/dom/src/storage/nsDOMStorage.cpp +++ b/dom/src/storage/nsDOMStorage.cpp @@ -22,7 +22,6 @@ * Contributor(s): * Neil Deakin * Johnny Stenback - * Ehsan Akhgari * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), @@ -60,8 +59,6 @@ #include "nsCycleCollectionParticipant.h" #include "nsIOfflineCacheUpdate.h" #include "nsIJSContextStack.h" -#include "nsIPrivateBrowsingService.h" -#include "nsNetCID.h" static const PRUint32 ASK_BEFORE_ACCEPT = 1; static const PRUint32 ACCEPT_SESSION = 2; @@ -213,11 +210,6 @@ nsSessionStorageEntry::~nsSessionStorageEntry() nsDOMStorageManager* nsDOMStorageManager::gStorageManager; -nsDOMStorageManager::nsDOMStorageManager() - : mInPrivateBrowsing(PR_FALSE) -{ -} - NS_IMPL_ISUPPORTS2(nsDOMStorageManager, nsIDOMStorageManager, nsIObserver) @@ -242,12 +234,6 @@ nsDOMStorageManager::Initialize() if (os) { 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); - - nsCOMPtr pbs = - do_GetService(NS_PRIVATE_BROWSING_SERVICE_CONTRACTID); - if (pbs) - pbs->GetPrivateBrowsingEnabled(&gStorageManager->mInPrivateBrowsing); } return NS_OK; @@ -346,12 +332,6 @@ nsDOMStorageManager::Observe(nsISupports *aSubject, NS_ENSURE_SUCCESS(rv, rv); return nsDOMStorage::gStorageDB->RemoveOwners(domains, 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; } return NS_OK; @@ -1030,7 +1010,6 @@ void nsDOMStorage::ClearAll() { mItems.EnumerateEntries(ClearStorageItem, nsnull); - mItemsCached = PR_FALSE; } static PLDHashOperator diff --git a/dom/src/storage/nsDOMStorage.h b/dom/src/storage/nsDOMStorage.h index 7dac629ab01c..8eb792299964 100644 --- a/dom/src/storage/nsDOMStorage.h +++ b/dom/src/storage/nsDOMStorage.h @@ -22,7 +22,6 @@ * Contributor(s): * Neil Deakin * Johnny Stenback - * Ehsan Akhgari * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), @@ -97,15 +96,11 @@ public: // nsIObserver NS_DECL_NSIOBSERVER - nsDOMStorageManager(); - void AddToStoragesHash(nsDOMStorage* aStorage); void RemoveFromStoragesHash(nsDOMStorage* aStorage); nsresult ClearAllStorages(); - PRBool InPrivateBrowsingMode() { return mInPrivateBrowsing; } - static nsresult Initialize(); static nsDOMStorageManager* GetInstance(); static void Shutdown(); @@ -115,7 +110,6 @@ public: protected: nsTHashtable mStorages; - PRBool mInPrivateBrowsing; }; class nsDOMStorage : public nsIDOMStorage, @@ -146,10 +140,7 @@ public: // This call relies on mSessionOnly, and should only be used // after a CacheStoragePermissions() call. See the comments // for mSessionOnly below. - PRBool UseDB() { - return mUseDB && !mSessionOnly && - !nsDOMStorageManager::gStorageManager->InPrivateBrowsingMode(); - } + PRBool UseDB() { return mUseDB && !mSessionOnly; } // Check whether storage may be used by the caller, and whether it // is session only. Returns true if storage may be used. diff --git a/dom/tests/mochitest/bugs/Makefile.in b/dom/tests/mochitest/bugs/Makefile.in index 6d0eef18c99d..b87ddeefabc9 100644 --- a/dom/tests/mochitest/bugs/Makefile.in +++ b/dom/tests/mochitest/bugs/Makefile.in @@ -93,8 +93,6 @@ _TEST_FILES = \ test_bug458091.html \ bug458091_child.html \ test_bug459848.html \ - test_bug463000.html \ - iframe_bug463000.html \ test_bug465263.html \ test_bug479143.html \ $(NULL) diff --git a/dom/tests/mochitest/bugs/iframe_bug463000.html b/dom/tests/mochitest/bugs/iframe_bug463000.html deleted file mode 100644 index 0357868f85d3..000000000000 --- a/dom/tests/mochitest/bugs/iframe_bug463000.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - Child window for the private browsing test - - - - - diff --git a/dom/tests/mochitest/bugs/test_bug463000.html b/dom/tests/mochitest/bugs/test_bug463000.html deleted file mode 100644 index 128f125a9eef..000000000000 --- a/dom/tests/mochitest/bugs/test_bug463000.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Test for Bug 463000 - - - - - - -Mozilla Bug 463000 -

- - - -
-
-
- -