Back out bug 754142 due to bustage.

This commit is contained in:
Kyle Huey 2012-05-16 15:21:58 -07:00
parent 0ceb106711
commit 32b77ac8c5
5 changed files with 11 additions and 32 deletions

View File

@ -427,15 +427,12 @@ IDBFactory::OpenCommon(const nsAString& aName,
nsCOMPtr<nsPIDOMWindow> window;
nsCOMPtr<nsIScriptGlobalObject> sgo;
JSObject* scriptOwner = nsnull;
FactoryPrivilege privilege;
if (mWindow) {
window = mWindow;
privilege = Content;
}
else {
scriptOwner = mOwningObject;
privilege = Chrome;
}
nsCString origin;
@ -448,8 +445,7 @@ IDBFactory::OpenCommon(const nsAString& aName,
NS_ENSURE_TRUE(request, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
nsRefPtr<OpenDatabaseHelper> openHelper =
new OpenDatabaseHelper(request, aName, origin, aVersion, aDeleting,
privilege);
new OpenDatabaseHelper(request, aName, origin, aVersion, aDeleting);
rv = openHelper->Init();
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);

View File

@ -662,7 +662,6 @@ IndexedDatabaseManager::GetIndexedDBQuotaMB()
nsresult
IndexedDatabaseManager::EnsureOriginIsInitialized(const nsACString& aOrigin,
FactoryPrivilege mPrivilege,
nsIFile** aDirectory)
{
#ifdef DEBUG
@ -710,17 +709,15 @@ IndexedDatabaseManager::EnsureOriginIsInitialized(const nsACString& aOrigin,
rv = patternFile->GetNativePath(pattern);
NS_ENSURE_SUCCESS(rv, rv);
// Now tell SQLite to start tracking this pattern for content.
// Now tell SQLite to start tracking this pattern.
nsCOMPtr<mozIStorageServiceQuotaManagement> ss =
do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID);
do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID);
NS_ENSURE_TRUE(ss, NS_ERROR_FAILURE);
if (mPrivilege != Chrome) {
rv = ss->SetQuotaForFilenamePattern(pattern,
GetIndexedDBQuotaMB() * 1024 * 1024,
mQuotaCallbackSingleton, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
}
rv = ss->SetQuotaForFilenamePattern(pattern,
GetIndexedDBQuotaMB() * 1024 * 1024,
mQuotaCallbackSingleton, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
// We need to see if there are any files in the directory already. If they
// are database files then we need to create file managers for them and also
@ -808,10 +805,8 @@ IndexedDatabaseManager::EnsureOriginIsInitialized(const nsACString& aOrigin,
fileManagers->AppendElement(fileManager);
if (mPrivilege != Chrome) {
rv = ss->UpdateQuotaInformationForFile(file);
NS_ENSURE_SUCCESS(rv, rv);
}
rv = ss->UpdateQuotaInformationForFile(file);
NS_ENSURE_SUCCESS(rv, rv);
if (!validSubdirs.PutEntry(dbBaseFilename)) {
NS_WARNING("Out of memory?");

View File

@ -69,8 +69,6 @@ class AsyncConnectionHelper;
class CheckQuotaHelper;
enum FactoryPrivilege;
class IndexedDatabaseManager MOZ_FINAL : public nsIIndexedDatabaseManager,
public nsIObserver
{
@ -155,7 +153,6 @@ public:
GetIndexedDBQuotaMB();
nsresult EnsureOriginIsInitialized(const nsACString& aOrigin,
FactoryPrivilege aPrivilege,
nsIFile** aDirectory);
// Determine if the quota is lifted for the Window the current thread is

View File

@ -1623,7 +1623,6 @@ OpenDatabaseHelper::DoDatabaseWork()
NS_ASSERTION(mgr, "This should never be null!");
nsresult rv = mgr->EnsureOriginIsInitialized(mASCIIOrigin,
mPrivilege,
getter_AddRefs(dbDirectory));
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);

View File

@ -50,11 +50,6 @@ class mozIStorageConnection;
BEGIN_INDEXEDDB_NAMESPACE
enum FactoryPrivilege {
Content,
Chrome
};
class OpenDatabaseHelper : public HelperBase
{
public:
@ -62,12 +57,10 @@ public:
const nsAString& aName,
const nsACString& aASCIIOrigin,
PRUint64 aRequestedVersion,
bool aForDeletion,
FactoryPrivilege aPrivilege)
bool aForDeletion)
: HelperBase(aRequest), mOpenDBRequest(aRequest), mName(aName),
mASCIIOrigin(aASCIIOrigin), mRequestedVersion(aRequestedVersion),
mForDeletion(aForDeletion), mPrivilege(aPrivilege),
mDatabaseId(nsnull), mCurrentVersion(0),
mForDeletion(aForDeletion), mDatabaseId(nsnull), mCurrentVersion(0),
mLastObjectStoreId(0), mLastIndexId(0), mState(eCreated),
mResultCode(NS_OK), mLoadDBMetadata(false)
{
@ -136,7 +129,6 @@ private:
nsCString mASCIIOrigin;
PRUint64 mRequestedVersion;
bool mForDeletion;
FactoryPrivilege mPrivilege;
nsCOMPtr<nsIAtom> mDatabaseId;
// Out-params.