Adding GetSecurityInfo to the nsIChannel. bug 29646. r=warren.

This commit is contained in:
dougt%netscape.com 2000-03-17 22:06:32 +00:00
Родитель 78f623abb8
Коммит 8126ff53b4
27 изменённых файлов: 177 добавлений и 21 удалений

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

@ -343,6 +343,12 @@ nsCachedChromeChannel::SetNotificationCallbacks(nsIInterfaceRequestor * aNotific
}
NS_IMETHODIMP
nsCachedChromeChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
nsresult
nsCachedChromeChannel::PostLoadEvent(nsCachedChromeChannel* aChannel,

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

@ -303,6 +303,12 @@ nsDateTimeChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotification
return NS_OK;
}
NS_IMETHODIMP
nsDateTimeChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
// nsIStreamObserver methods
NS_IMETHODIMP

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

@ -341,6 +341,12 @@ nsFingerChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCa
return NS_OK;
}
NS_IMETHODIMP
nsFingerChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
// nsIStreamObserver methods
NS_IMETHODIMP

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

@ -71,9 +71,8 @@ nsSSLSocketProvider::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
}
NS_IMETHODIMP
nsSSLSocketProvider::NewSocket(const char *hostName, PRFileDesc **_result)
nsSSLSocketProvider::NewSocket(const char *hostName, PRFileDesc **_result, nsISupports **securityInfo)
{
*_result = nsSSLIOLayerNewSocket(hostName);
return (nsnull == *_result) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK;
nsresult rv = nsSSLIOLayerNewSocket(hostName, _result, securityInfo);
return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK;
}

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

@ -437,6 +437,14 @@ nsMsgProtocol::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCall
return NS_OK; // don't fail when trying to set this
}
NS_IMETHODIMP
nsMsgProtocol::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// From nsIRequest
////////////////////////////////////////////////////////////////////////////////

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

@ -284,6 +284,12 @@ NS_IMETHODIMP nsMailtoChannel::SetNotificationCallbacks(nsIInterfaceRequestor* a
return NS_OK; // don't fail when trying to set this
}
NS_IMETHODIMP
nsMailtoChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsMailtoChannel::GetOriginalURI(nsIURI * *aURI)
{

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

@ -6622,3 +6622,10 @@ nsImapMockChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotification
{
return NS_OK; // don't fail when trying to set this
}
NS_IMETHODIMP
nsImapMockChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}

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

@ -586,6 +586,12 @@ nsJARChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCallb
return NS_OK;
}
NS_IMETHODIMP
nsJARChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsIStreamObserver methods:

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

@ -211,6 +211,12 @@ interface nsIChannel : nsIRequest
*/
attribute nsIInterfaceRequestor notificationCallbacks;
/**
* Any security information about this channel. This can be null.
*/
readonly attribute nsISupports securityInfo;
};
////////////////////////////////////////////////////////////////////////////////

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

@ -1279,4 +1279,11 @@ nsFileTransport::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCa
return NS_OK;
}
NS_IMETHODIMP
nsFileTransport::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////

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

@ -338,6 +338,14 @@ nsInputStreamChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificat
return NS_OK;
}
NS_IMETHODIMP
nsInputStreamChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsIStreamListener methods:
////////////////////////////////////////////////////////////////////////////////

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

@ -752,7 +752,7 @@ nsresult nsSocketTransport::doConnection(PRInt16 aSelectFlags)
rv = pProviderService->GetSocketProvider(mSocketType, getter_AddRefs(pProvider));
if (NS_SUCCEEDED(rv))
rv = pProvider->NewSocket(mHostName, &mSocketFD);
rv = pProvider->NewSocket(mHostName, &mSocketFD, getter_AddRefs(mSecurityInfo));
}
if (mSocketFD) {
@ -1330,6 +1330,14 @@ nsSocketTransport::SetBytesExpected (PRInt32 bytes)
return NS_OK;
}
NS_IMETHODIMP
nsSocketTransport::GetSecurityInfo(nsISupports **info)
{
*info = mSecurityInfo.get();
NS_IF_ADDREF(*info);
return NS_OK;
}
//
// --------------------------------------------------------------------------

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

@ -209,6 +209,7 @@ protected:
nsCOMPtr<nsIStreamObserver> mOpenObserver;
nsSocketOperation mOperation;
nsCOMPtr<nsISupports> mOwner;
nsCOMPtr<nsISupports> mSecurityInfo;
PRInt32 mPort;
char* mPrintHost; // not the proxy
nsCOMPtr<nsISupports> mReadContext;

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

@ -520,6 +520,13 @@ nsDiskCacheRecordChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotif
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsDiskCacheRecordChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsIStreamListener methods:
////////////////////////////////////////////////////////////////////////////////

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

@ -535,3 +535,10 @@ nsMemCacheChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotification
NS_ASSERTION(0, "nsMemCacheChannel method unexpectedly called");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsMemCacheChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}

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

@ -431,3 +431,9 @@ nsDataChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCall
return NS_OK;
}
NS_IMETHODIMP
nsDataChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}

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

@ -303,6 +303,12 @@ nsDateTimeChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotification
return NS_OK;
}
NS_IMETHODIMP
nsDateTimeChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
// nsIStreamObserver methods
NS_IMETHODIMP

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

@ -426,6 +426,12 @@ nsFileChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCall
return NS_OK;
}
NS_IMETHODIMP
nsFileChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsIStreamListener methods:
////////////////////////////////////////////////////////////////////////////////

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

@ -341,6 +341,12 @@ nsFingerChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCa
return NS_OK;
}
NS_IMETHODIMP
nsFingerChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
// nsIStreamObserver methods
NS_IMETHODIMP

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

@ -501,6 +501,13 @@ nsFTPChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCallb
return NS_OK;
}
NS_IMETHODIMP
nsFTPChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsFTPChannel::SetContentLength(PRInt32 aLength) {
nsAutoLock lock(mLock);

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

@ -98,6 +98,7 @@ interface nsIHTTPChannel : nsIChannel
to allow other non-http specs to be used in proxy cases.
*/
attribute string ProxyRequestURI;
};

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

@ -53,7 +53,7 @@
#include "nsIProxy.h"
#include "nsMimeTypes.h"
#include "nsIPrompt.h"
#include "nsISocketTransport.h"
// FIXME - Temporary include. Delete this when cache is enabled on all platforms
#include "nsIPref.h"
@ -105,7 +105,8 @@ nsHTTPChannel::nsHTTPChannel(nsIURI* i_URL,
mProxy(0),
mProxyPort(-1),
mBufferSegmentSize(bufferSegmentSize),
mBufferMaxSize(bufferMaxSize)
mBufferMaxSize(bufferMaxSize),
mTransport(nsnull)
{
NS_INIT_REFCNT();
@ -1091,7 +1092,6 @@ nsHTTPChannel::Open(void)
// Set up a new request observer and a response listener and pass
// to the transport
nsresult rv = NS_OK;
nsCOMPtr<nsIChannel> transport;
// If this is the first time, then add the channel to its load group
if (mState == HS_IDLE) {
@ -1128,7 +1128,7 @@ nsHTTPChannel::Open(void)
rv = mHandler->RequestTransport(mURI, this,
mBufferSegmentSize, mBufferMaxSize,
getter_AddRefs(transport));
getter_AddRefs(mTransport));
if (NS_ERROR_BUSY == rv) {
mState = HS_WAITING_FOR_OPEN;
@ -1141,11 +1141,11 @@ nsHTTPChannel::Open(void)
}
// pass ourself in to act as a proxy for progress callbacks
rv = transport->SetNotificationCallbacks(this);
rv = mTransport->SetNotificationCallbacks(this);
if (NS_FAILED(rv)) {
// Unable to create a transport... End the request...
(void) ResponseCompleted(mResponseDataListener, rv, nsnull);
(void) ReleaseTransport(transport);
(void) ReleaseTransport(mTransport);
return rv;
}
@ -1183,7 +1183,7 @@ nsHTTPChannel::Open(void)
rv = pModules->GetNext(getter_AddRefs(supEntry)); // go around again
}
mRequest->SetTransport(transport);
mRequest->SetTransport(mTransport);
// if using proxy...
nsXPIDLCString requestSpec;
@ -1997,3 +1997,18 @@ nsHTTPChannel::GetUsingProxy(PRBool *aUsingProxy)
*aUsingProxy = (mProxy && *mProxy);
return NS_OK;
}
NS_IMETHODIMP
nsHTTPChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
if (!aSecurityInfo)
return NS_ERROR_NULL_POINTER;
if (!mTransport)
return NS_OK;
return mTransport->GetSecurityInfo(aSecurityInfo);
}

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

@ -149,6 +149,8 @@ protected:
nsCOMPtr<nsISupports> mOwner;
nsCOMPtr<nsIChannel> mTransport;
// Cache-related members
nsCOMPtr<nsICachedNetData> mCacheEntry;
nsHTTPResponse* mCachedResponse;

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

@ -586,6 +586,12 @@ nsJARChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCallb
return NS_OK;
}
NS_IMETHODIMP
nsJARChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsIStreamObserver methods:

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

@ -562,6 +562,13 @@ nsResChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCallb
return NS_OK;
}
NS_IMETHODIMP
nsResChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsIStreamListener methods:
////////////////////////////////////////////////////////////////////////////////

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

@ -31,7 +31,7 @@
[noscript, uuid(0906de00-5414-11d3-bbc8-0000861d1237)]
interface nsISocketProvider : nsISupports {
nsFileDescStar NewSocket ( in string hostName );
void NewSocket ( in string hostName, out nsFileDescStar fileDesc, out nsISupports securityInfo );
};

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

@ -343,6 +343,12 @@ nsCachedChromeChannel::SetNotificationCallbacks(nsIInterfaceRequestor * aNotific
}
NS_IMETHODIMP
nsCachedChromeChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
*aSecurityInfo = nsnull;
return NS_OK;
}
nsresult
nsCachedChromeChannel::PostLoadEvent(nsCachedChromeChannel* aChannel,