Bug 732708 - Part e: Pass nsDOMStorage* to InitAsSessionStorageFork; r=mayhemer

This commit is contained in:
Ms2ger 2012-05-05 11:00:05 +02:00
parent 25be92c77d
commit 56504c3389
2 changed files with 8 additions and 18 deletions

View File

@ -1808,16 +1808,8 @@ already_AddRefed<nsIDOMStorage>
nsDOMStorage2::Fork(const nsSubstring &aDocumentURI)
{
nsRefPtr<nsDOMStorage2> storage = new nsDOMStorage2();
if (!storage)
return nsnull;
nsresult rv = storage->InitAsSessionStorageFork(mPrincipal, aDocumentURI, mStorage);
if (NS_FAILED(rv))
return nsnull;
nsIDOMStorage* result = static_cast<nsIDOMStorage*>(storage.get());
storage.forget();
return result;
storage->InitAsSessionStorageFork(mPrincipal, aDocumentURI, mStorage);
return storage.forget();
}
bool nsDOMStorage2::IsForkOf(nsIDOMStorage* aThat)
@ -1829,14 +1821,12 @@ bool nsDOMStorage2::IsForkOf(nsIDOMStorage* aThat)
return mStorage == storage->mStorage;
}
nsresult
nsDOMStorage2::InitAsSessionStorageFork(nsIPrincipal *aPrincipal, const nsSubstring &aDocumentURI, nsIDOMStorageObsolete* aStorage)
void
nsDOMStorage2::InitAsSessionStorageFork(nsIPrincipal *aPrincipal, const nsSubstring &aDocumentURI, nsDOMStorage* aStorage)
{
mPrincipal = aPrincipal;
mDocumentURI = aDocumentURI;
mStorage = static_cast<nsDOMStorage*>(aStorage);
return NS_OK;
mStorage = aStorage;
}
nsTArray<nsString> *

View File

@ -447,9 +447,9 @@ public:
void BroadcastChangeNotification(const nsSubstring &aKey,
const nsSubstring &aOldValue,
const nsSubstring &aNewValue);
nsresult InitAsSessionStorageFork(nsIPrincipal *aPrincipal,
const nsSubstring &aDocumentURI,
nsIDOMStorageObsolete* aStorage);
void InitAsSessionStorageFork(nsIPrincipal *aPrincipal,
const nsSubstring &aDocumentURI,
nsDOMStorage* aStorage);
private:
// storages bound to an origin hold the principal to