This commit is contained in:
Kyle Huey 2012-05-28 00:53:57 -07:00
Родитель 6aade7d74c
Коммит 3ab011f0e6
6 изменённых файлов: 11 добавлений и 30 удалений

Просмотреть файл

@ -394,15 +394,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;
@ -415,8 +412,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);

Просмотреть файл

@ -32,11 +32,6 @@ BEGIN_INDEXEDDB_NAMESPACE
class FileInfo;
enum FactoryPrivilege {
Content,
Chrome
};
struct StructuredCloneReadInfo {
void Swap(StructuredCloneReadInfo& aCloneReadInfo) {
mCloneBuffer.swap(aCloneReadInfo.mCloneBuffer);

Просмотреть файл

@ -623,7 +623,6 @@ IndexedDatabaseManager::GetIndexedDBQuotaMB()
nsresult
IndexedDatabaseManager::EnsureOriginIsInitialized(const nsACString& aOrigin,
FactoryPrivilege mPrivilege,
nsIFile** aDirectory)
{
#ifdef DEBUG
@ -671,17 +670,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
@ -769,10 +766,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);
validSubdirs.PutEntry(dbBaseFilename);
}

Просмотреть файл

@ -120,7 +120,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

Просмотреть файл

@ -1589,7 +1589,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);

Просмотреть файл

@ -23,12 +23,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)
{
@ -97,7 +95,6 @@ private:
nsCString mASCIIOrigin;
PRUint64 mRequestedVersion;
bool mForDeletion;
FactoryPrivilege mPrivilege;
nsCOMPtr<nsIAtom> mDatabaseId;
// Out-params.