diff --git a/netwerk/base/public/nsIStreamIO.idl b/netwerk/base/public/nsIStreamIO.idl index 31e344583f35..67b4b2d9abd4 100644 --- a/netwerk/base/public/nsIStreamIO.idl +++ b/netwerk/base/public/nsIStreamIO.idl @@ -115,6 +115,7 @@ interface nsIFileIO : nsIStreamIO %{C++ #include "nsCOMPtr.h" +#include "nsXPCOM.h" #include "nsIComponentManager.h" #define NS_FILEIO_CLASSNAME "File I/O" @@ -135,12 +136,17 @@ NS_NewFileIO(nsIFileIO **result, PRInt32 perm = -1) { nsresult rv; - nsCOMPtr fileIO; static NS_DEFINE_CID(kFileIOCID, NS_FILEIO_CID); - rv = nsComponentManager::CreateInstance(kFileIOCID, - nsnull, - NS_GET_IID(nsIFileIO), - getter_AddRefs(fileIO)); + nsCOMPtr fileIO; + + nsCOMPtr compMgr; + rv = NS_GetComponentManager(getter_AddRefs(compMgr)); + + if (NS_FAILED(rv)) return rv; + rv = compMgr->CreateInstance(kFileIOCID, + nsnull, + NS_GET_IID(nsIFileIO), + getter_AddRefs(fileIO)); if (NS_FAILED(rv)) return rv; rv = fileIO->Init(file, ioFlags, perm); if (NS_FAILED(rv)) return rv; @@ -196,10 +202,14 @@ NS_NewInputStreamIO(nsIInputStreamIO* *result, nsresult rv; nsCOMPtr io; static NS_DEFINE_CID(kInputStreamIOCID, NS_INPUTSTREAMIO_CID); - rv = nsComponentManager::CreateInstance(kInputStreamIOCID, - nsnull, - NS_GET_IID(nsIInputStreamIO), - getter_AddRefs(io)); + nsCOMPtr compMgr; + rv = NS_GetComponentManager(getter_AddRefs(compMgr)); + + if (NS_FAILED(rv)) return rv; + rv = compMgr->CreateInstance(kInputStreamIOCID, + nsnull, + NS_GET_IID(nsIInputStreamIO), + getter_AddRefs(io)); if (NS_FAILED(rv)) return rv; rv = io->Init(name, inStr, contentType, contentCharset, contentLength); if (NS_FAILED(rv)) return rv;