зеркало из https://github.com/mozilla/pjs.git
Stream loader now saves principals from channel; needed for signed scripts. r=norris
(this is mstoltz's checkin)
This commit is contained in:
Родитель
23d42070a9
Коммит
6756e81012
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче