Stream loader now saves principals from channel; needed for signed scripts. r=norris

(this is mstoltz's checkin)
This commit is contained in:
norris%netscape.com 2000-03-21 04:16:03 +00:00
Родитель 23d42070a9
Коммит 6756e81012
3 изменённых файлов: 15 добавлений и 0 удалений

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

@ -55,6 +55,11 @@ interface nsIStreamLoader : nsISupports
* Gets the number of bytes read so far.
*/
readonly attribute unsigned long numBytesRead;
/**
* Gets the owner of this file
*/
readonly attribute nsISupports owner;
};
%{C++

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

@ -96,6 +96,14 @@ nsStreamLoader::GetNumBytesRead(PRUint32* aNumBytes)
return NS_OK;
}
NS_IMETHODIMP
nsStreamLoader::GetOwner(nsISupports** aOwner)
{
*aOwner = mOwner.get();
NS_IF_ADDREF(*aOwner);
return NS_OK;
}
NS_IMETHODIMP
nsStreamLoader::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
{
@ -106,6 +114,7 @@ NS_IMETHODIMP
nsStreamLoader::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
nsresult status, const PRUnichar *errorMsg)
{
(void)channel->GetOwner(getter_AddRefs(mOwner));
nsresult rv = mObserver->OnStreamComplete(this, mContext, status,
mData.Length(),
mData.GetBuffer());

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

@ -47,6 +47,7 @@ protected:
nsCOMPtr<nsIStreamLoaderObserver> mObserver;
nsCOMPtr<nsISupports> mContext; // the observer's context
nsCString mData;
nsCOMPtr<nsISupports> mOwner;
/// nsCOMPtr<nsILoadGroup> mLoadGroup;
};