зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
3199e32b59
Коммит
f2fba4f3de
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче