diff --git a/mozilla/chrome/src/nsChromeProtocolHandler.cpp b/mozilla/chrome/src/nsChromeProtocolHandler.cpp index 7359ff57f49..80b329cc8c5 100644 --- a/mozilla/chrome/src/nsChromeProtocolHandler.cpp +++ b/mozilla/chrome/src/nsChromeProtocolHandler.cpp @@ -343,6 +343,12 @@ nsCachedChromeChannel::SetNotificationCallbacks(nsIInterfaceRequestor * aNotific } +NS_IMETHODIMP +nsCachedChromeChannel::GetSecurityInfo(nsISupports * *aSecurityInfo) +{ + *aSecurityInfo = nsnull; + return NS_OK; +} nsresult nsCachedChromeChannel::PostLoadEvent(nsCachedChromeChannel* aChannel, diff --git a/mozilla/extensions/datetime/nsDateTimeChannel.cpp b/mozilla/extensions/datetime/nsDateTimeChannel.cpp index 01df6eda510..bfd4a52db3e 100644 --- a/mozilla/extensions/datetime/nsDateTimeChannel.cpp +++ b/mozilla/extensions/datetime/nsDateTimeChannel.cpp @@ -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 diff --git a/mozilla/extensions/finger/nsFingerChannel.cpp b/mozilla/extensions/finger/nsFingerChannel.cpp index 4e6069f3413..21f865f3a85 100644 --- a/mozilla/extensions/finger/nsFingerChannel.cpp +++ b/mozilla/extensions/finger/nsFingerChannel.cpp @@ -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 diff --git a/mozilla/extensions/psm-glue/src/nsSSLSocketProvider.cpp b/mozilla/extensions/psm-glue/src/nsSSLSocketProvider.cpp index 48668160361..f731cc1e4f0 100644 --- a/mozilla/extensions/psm-glue/src/nsSSLSocketProvider.cpp +++ b/mozilla/extensions/psm-glue/src/nsSSLSocketProvider.cpp @@ -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; } diff --git a/mozilla/mailnews/base/util/nsMsgProtocol.cpp b/mozilla/mailnews/base/util/nsMsgProtocol.cpp index f7d61b176c5..4dc08120976 100644 --- a/mozilla/mailnews/base/util/nsMsgProtocol.cpp +++ b/mozilla/mailnews/base/util/nsMsgProtocol.cpp @@ -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 //////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/mailnews/compose/src/nsSmtpService.cpp b/mozilla/mailnews/compose/src/nsSmtpService.cpp index a9ed375ee24..e7b88b04e97 100644 --- a/mozilla/mailnews/compose/src/nsSmtpService.cpp +++ b/mozilla/mailnews/compose/src/nsSmtpService.cpp @@ -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) { diff --git a/mozilla/mailnews/imap/src/nsImapProtocol.cpp b/mozilla/mailnews/imap/src/nsImapProtocol.cpp index 798b9f1a486..f670847f818 100644 --- a/mozilla/mailnews/imap/src/nsImapProtocol.cpp +++ b/mozilla/mailnews/imap/src/nsImapProtocol.cpp @@ -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; +} diff --git a/mozilla/modules/libjar/nsJARChannel.cpp b/mozilla/modules/libjar/nsJARChannel.cpp index 9de8e4d738c..d48e211dd6d 100644 --- a/mozilla/modules/libjar/nsJARChannel.cpp +++ b/mozilla/modules/libjar/nsJARChannel.cpp @@ -586,6 +586,12 @@ nsJARChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCallb return NS_OK; } +NS_IMETHODIMP +nsJARChannel::GetSecurityInfo(nsISupports * *aSecurityInfo) +{ + *aSecurityInfo = nsnull; + return NS_OK; +} //////////////////////////////////////////////////////////////////////////////// // nsIStreamObserver methods: diff --git a/mozilla/netwerk/base/public/nsIChannel.idl b/mozilla/netwerk/base/public/nsIChannel.idl index 25fcf7a03a7..682bf3943f1 100644 --- a/mozilla/netwerk/base/public/nsIChannel.idl +++ b/mozilla/netwerk/base/public/nsIChannel.idl @@ -211,6 +211,12 @@ interface nsIChannel : nsIRequest */ attribute nsIInterfaceRequestor notificationCallbacks; + /** + * Any security information about this channel. This can be null. + */ + + readonly attribute nsISupports securityInfo; + }; //////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/netwerk/base/src/nsFileTransport.cpp b/mozilla/netwerk/base/src/nsFileTransport.cpp index afd2d7a1307..47c19438dd0 100644 --- a/mozilla/netwerk/base/src/nsFileTransport.cpp +++ b/mozilla/netwerk/base/src/nsFileTransport.cpp @@ -1279,4 +1279,11 @@ nsFileTransport::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCa return NS_OK; } + +NS_IMETHODIMP +nsFileTransport::GetSecurityInfo(nsISupports * *aSecurityInfo) +{ + *aSecurityInfo = nsnull; + return NS_OK; +} //////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/netwerk/base/src/nsInputStreamChannel.cpp b/mozilla/netwerk/base/src/nsInputStreamChannel.cpp index a5fbaf58dce..0f28f57dc21 100644 --- a/mozilla/netwerk/base/src/nsInputStreamChannel.cpp +++ b/mozilla/netwerk/base/src/nsInputStreamChannel.cpp @@ -338,6 +338,14 @@ nsInputStreamChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificat return NS_OK; } + +NS_IMETHODIMP +nsInputStreamChannel::GetSecurityInfo(nsISupports * *aSecurityInfo) +{ + *aSecurityInfo = nsnull; + return NS_OK; +} + //////////////////////////////////////////////////////////////////////////////// // nsIStreamListener methods: //////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/netwerk/base/src/nsSocketTransport.cpp b/mozilla/netwerk/base/src/nsSocketTransport.cpp index 96bfd379eb2..5cf6ea3c80e 100644 --- a/mozilla/netwerk/base/src/nsSocketTransport.cpp +++ b/mozilla/netwerk/base/src/nsSocketTransport.cpp @@ -735,12 +735,12 @@ nsresult nsSocketTransport::doConnection(PRInt16 aSelectFlags) // Step 1: // Create a new TCP socket structure... // - if (!mSocketType) - { + if (!mSocketType) + { mSocketFD = PR_NewTCPSocket(); - } - else - { + } + else + { NS_WITH_SERVICE(nsISocketProviderService, pProviderService, kSocketProviderService, @@ -752,8 +752,8 @@ 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) { PRSocketOptionData opt; @@ -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; +} + // // -------------------------------------------------------------------------- diff --git a/mozilla/netwerk/base/src/nsSocketTransport.h b/mozilla/netwerk/base/src/nsSocketTransport.h index c52362ed98a..bfc07799a14 100644 --- a/mozilla/netwerk/base/src/nsSocketTransport.h +++ b/mozilla/netwerk/base/src/nsSocketTransport.h @@ -209,6 +209,7 @@ protected: nsCOMPtr mOpenObserver; nsSocketOperation mOperation; nsCOMPtr mOwner; + nsCOMPtr mSecurityInfo; PRInt32 mPort; char* mPrintHost; // not the proxy nsCOMPtr mReadContext; diff --git a/mozilla/netwerk/cache/filecache/nsDiskCacheRecordChannel.cpp b/mozilla/netwerk/cache/filecache/nsDiskCacheRecordChannel.cpp index c9bd49f3ad4..16ced2a1ce4 100644 --- a/mozilla/netwerk/cache/filecache/nsDiskCacheRecordChannel.cpp +++ b/mozilla/netwerk/cache/filecache/nsDiskCacheRecordChannel.cpp @@ -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: //////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/netwerk/cache/memcache/nsMemCacheChannel.cpp b/mozilla/netwerk/cache/memcache/nsMemCacheChannel.cpp index ba989d17cf9..509928b2134 100644 --- a/mozilla/netwerk/cache/memcache/nsMemCacheChannel.cpp +++ b/mozilla/netwerk/cache/memcache/nsMemCacheChannel.cpp @@ -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; +} diff --git a/mozilla/netwerk/protocol/data/src/nsDataChannel.cpp b/mozilla/netwerk/protocol/data/src/nsDataChannel.cpp index 36e3265ef92..86c458eee41 100644 --- a/mozilla/netwerk/protocol/data/src/nsDataChannel.cpp +++ b/mozilla/netwerk/protocol/data/src/nsDataChannel.cpp @@ -431,3 +431,9 @@ nsDataChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCall return NS_OK; } +NS_IMETHODIMP +nsDataChannel::GetSecurityInfo(nsISupports * *aSecurityInfo) +{ + *aSecurityInfo = nsnull; + return NS_OK; +} diff --git a/mozilla/netwerk/protocol/datetime/src/nsDateTimeChannel.cpp b/mozilla/netwerk/protocol/datetime/src/nsDateTimeChannel.cpp index 01df6eda510..bfd4a52db3e 100644 --- a/mozilla/netwerk/protocol/datetime/src/nsDateTimeChannel.cpp +++ b/mozilla/netwerk/protocol/datetime/src/nsDateTimeChannel.cpp @@ -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 diff --git a/mozilla/netwerk/protocol/file/src/nsFileChannel.cpp b/mozilla/netwerk/protocol/file/src/nsFileChannel.cpp index cfd3926067d..b2246ddd461 100644 --- a/mozilla/netwerk/protocol/file/src/nsFileChannel.cpp +++ b/mozilla/netwerk/protocol/file/src/nsFileChannel.cpp @@ -426,6 +426,12 @@ nsFileChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCall return NS_OK; } +NS_IMETHODIMP +nsFileChannel::GetSecurityInfo(nsISupports * *aSecurityInfo) +{ + *aSecurityInfo = nsnull; + return NS_OK; +} //////////////////////////////////////////////////////////////////////////////// // nsIStreamListener methods: //////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/netwerk/protocol/finger/src/nsFingerChannel.cpp b/mozilla/netwerk/protocol/finger/src/nsFingerChannel.cpp index 4e6069f3413..21f865f3a85 100644 --- a/mozilla/netwerk/protocol/finger/src/nsFingerChannel.cpp +++ b/mozilla/netwerk/protocol/finger/src/nsFingerChannel.cpp @@ -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 diff --git a/mozilla/netwerk/protocol/ftp/src/nsFTPChannel.cpp b/mozilla/netwerk/protocol/ftp/src/nsFTPChannel.cpp index cbf393944e8..86859d16516 100644 --- a/mozilla/netwerk/protocol/ftp/src/nsFTPChannel.cpp +++ b/mozilla/netwerk/protocol/ftp/src/nsFTPChannel.cpp @@ -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); diff --git a/mozilla/netwerk/protocol/http/public/nsIHTTPChannel.idl b/mozilla/netwerk/protocol/http/public/nsIHTTPChannel.idl index 39276e6aab9..745133cd030 100644 --- a/mozilla/netwerk/protocol/http/public/nsIHTTPChannel.idl +++ b/mozilla/netwerk/protocol/http/public/nsIHTTPChannel.idl @@ -98,6 +98,7 @@ interface nsIHTTPChannel : nsIChannel to allow other non-http specs to be used in proxy cases. */ attribute string ProxyRequestURI; + }; diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp index b55b80784ee..e29667884be 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp @@ -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 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; @@ -1139,13 +1139,13 @@ nsHTTPChannel::Open(void) (void) ResponseCompleted(mResponseDataListener, rv, nsnull); return rv; } - + // 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); +} diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.h b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.h index 67a6893e49d..1f5dd62b9ed 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.h +++ b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.h @@ -148,7 +148,9 @@ protected: nsCOMPtr mLoadGroup; nsCOMPtr mOwner; - + + nsCOMPtr mTransport; + // Cache-related members nsCOMPtr mCacheEntry; nsHTTPResponse* mCachedResponse; diff --git a/mozilla/netwerk/protocol/jar/src/nsJARChannel.cpp b/mozilla/netwerk/protocol/jar/src/nsJARChannel.cpp index 9de8e4d738c..d48e211dd6d 100644 --- a/mozilla/netwerk/protocol/jar/src/nsJARChannel.cpp +++ b/mozilla/netwerk/protocol/jar/src/nsJARChannel.cpp @@ -586,6 +586,12 @@ nsJARChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCallb return NS_OK; } +NS_IMETHODIMP +nsJARChannel::GetSecurityInfo(nsISupports * *aSecurityInfo) +{ + *aSecurityInfo = nsnull; + return NS_OK; +} //////////////////////////////////////////////////////////////////////////////// // nsIStreamObserver methods: diff --git a/mozilla/netwerk/protocol/res/src/nsResChannel.cpp b/mozilla/netwerk/protocol/res/src/nsResChannel.cpp index 524fe81089e..d41a1842e2a 100644 --- a/mozilla/netwerk/protocol/res/src/nsResChannel.cpp +++ b/mozilla/netwerk/protocol/res/src/nsResChannel.cpp @@ -562,6 +562,13 @@ nsResChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCallb return NS_OK; } +NS_IMETHODIMP +nsResChannel::GetSecurityInfo(nsISupports * *aSecurityInfo) +{ + *aSecurityInfo = nsnull; + return NS_OK; +} + //////////////////////////////////////////////////////////////////////////////// // nsIStreamListener methods: //////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/netwerk/socket/base/nsISocketProvider.idl b/mozilla/netwerk/socket/base/nsISocketProvider.idl index 319cc3d87bb..8ab05d54b5e 100644 --- a/mozilla/netwerk/socket/base/nsISocketProvider.idl +++ b/mozilla/netwerk/socket/base/nsISocketProvider.idl @@ -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 ); }; diff --git a/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp b/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp index 7359ff57f49..80b329cc8c5 100644 --- a/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp +++ b/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp @@ -343,6 +343,12 @@ nsCachedChromeChannel::SetNotificationCallbacks(nsIInterfaceRequestor * aNotific } +NS_IMETHODIMP +nsCachedChromeChannel::GetSecurityInfo(nsISupports * *aSecurityInfo) +{ + *aSecurityInfo = nsnull; + return NS_OK; +} nsresult nsCachedChromeChannel::PostLoadEvent(nsCachedChromeChannel* aChannel,