Adding the attribute referrer so that you can get the referrer from the channel once you have previously set it.

This commit is contained in:
tbogard%aol.net 2000-03-30 02:18:52 +00:00
Родитель 3199e32b59
Коммит f2fba4f3de
3 изменённых файлов: 15 добавлений и 0 удалений

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

@ -77,6 +77,8 @@ interface nsIHTTPChannel : nsIChannel
*/
void SetReferrer(in nsIURI referrer, in unsigned long referrerLevel);
readonly attribute nsIURI referrer;
readonly attribute unsigned long ResponseStatus;
readonly attribute string ResponseString;

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

@ -2044,6 +2044,8 @@ nsHTTPChannel::SetReferrer(nsIURI *referrer, PRUint32 referrerLevel)
if (referrerLevel == 0)
return NS_OK;
mReferrer = referrer;
if (!referrer)
return NS_ERROR_NULL_POINTER;
@ -2059,6 +2061,16 @@ nsHTTPChannel::SetReferrer(nsIURI *referrer, PRUint32 referrerLevel)
return NS_OK;
}
NS_IMETHODIMP
nsHTTPChannel::GetReferrer(nsIURI** aReferrer)
{
NS_ENSURE_ARG_POINTER(aReferrer);
*aReferrer = mReferrer;
NS_IF_ADDREF(*aReferrer);
return NS_OK;
}
nsresult DupString(char* *o_Dest, const char* i_Src)
{
if (!o_Dest)

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

@ -127,6 +127,7 @@ public:
protected:
nsCOMPtr<nsIURI> mOriginalURI;
nsCOMPtr<nsIURI> mURI;
nsCOMPtr<nsIURI> mReferrer;
PRBool mConnected;
HTTPState mState;
nsCOMPtr<nsIHTTPEventSink> mEventSink;