diff --git a/mozilla/network/module/nsINetService.h b/mozilla/network/module/nsINetService.h index 180ba99f2c3..bef9356a563 100644 --- a/mozilla/network/module/nsINetService.h +++ b/mozilla/network/module/nsINetService.h @@ -251,6 +251,14 @@ struct nsINetService : public nsISupports */ NS_IMETHOD CreateSocketTransport(nsITransport **aTransport, PRUint32 aPortToUse, const char * aHostName) = 0; + + /** + * Protocol connection pools should use this call into the service manager to produce + * a transport interface to a file based socket. You need to pass in the name of the file + * you want to associate with the socket transport + */ + + NS_IMETHOD CreateFileSocketTransport(nsITransport **aTransport, const char * aFileName) = 0; NS_IMETHOD AreThereActiveConnections(void) = 0; }; diff --git a/mozilla/network/module/nsNetService.cpp b/mozilla/network/module/nsNetService.cpp index aec30ab204b..a5733ee8ae4 100644 --- a/mozilla/network/module/nsNetService.cpp +++ b/mozilla/network/module/nsNetService.cpp @@ -1056,6 +1056,24 @@ NS_IMETHODIMP nsNetlibService::CreateSocketTransport(nsITransport **aTransport, return NS_OK; } +NS_IMETHODIMP nsNetlibService::CreateFileSocketTransport(nsITransport **aTransport, const char * aFileName) +{ + NS_PRECONDITION(aFileName, "You need to specify the file name of the file you wish to create a socket for"); + + nsSocketTransport *pNSSocketTransport = NULL; + + NS_DEFINE_IID(kITransportIID, NS_ITRANSPORT_IID); + + pNSSocketTransport = new nsSocketTransport(aFileName); + if (pNSSocketTransport->QueryInterface(kITransportIID, (void**)aTransport) != NS_OK) { + // then we're trying get a interface other than nsISupports and + // nsITransport + return NS_ERROR_FAILURE; + } + + return NS_OK; +} + NS_IMETHODIMP nsNetlibService::AreThereActiveConnections() diff --git a/mozilla/network/module/nsNetService.h b/mozilla/network/module/nsNetService.h index 042448516c7..5b9eb9477ee 100644 --- a/mozilla/network/module/nsNetService.h +++ b/mozilla/network/module/nsNetService.h @@ -100,6 +100,8 @@ public: NS_IMETHOD CreateSocketTransport(nsITransport **aTransport, PRUint32 aPortToUse, const char * aHostName); + NS_IMETHOD CreateFileSocketTransport(nsITransport **aTransport, const char * aFileName); + protected: virtual ~nsNetlibService();