diff --git a/netwerk/protocol/http/public/nsIHTTPChannel.idl b/netwerk/protocol/http/public/nsIHTTPChannel.idl index 745133cd030..77f885bd42f 100644 --- a/netwerk/protocol/http/public/nsIHTTPChannel.idl +++ b/netwerk/protocol/http/public/nsIHTTPChannel.idl @@ -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; diff --git a/netwerk/protocol/http/src/nsHTTPChannel.cpp b/netwerk/protocol/http/src/nsHTTPChannel.cpp index 1ff7155a0dd..5042e494e6f 100644 --- a/netwerk/protocol/http/src/nsHTTPChannel.cpp +++ b/netwerk/protocol/http/src/nsHTTPChannel.cpp @@ -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) diff --git a/netwerk/protocol/http/src/nsHTTPChannel.h b/netwerk/protocol/http/src/nsHTTPChannel.h index 581d2b0f37e..1fbb8074a01 100644 --- a/netwerk/protocol/http/src/nsHTTPChannel.h +++ b/netwerk/protocol/http/src/nsHTTPChannel.h @@ -127,6 +127,7 @@ public: protected: nsCOMPtr mOriginalURI; nsCOMPtr mURI; + nsCOMPtr mReferrer; PRBool mConnected; HTTPState mState; nsCOMPtr mEventSink;