From bb554f06d2eb06cea5d2354416c394ebcb81f6d6 Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Mon, 25 Oct 1999 22:48:44 +0000 Subject: [PATCH] adding nsIFile to nsXPComInit. Currently it is #ifdef'ed off. bug 13320 git-svn-id: svn://10.0.0.236/trunk@51766 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/build/nsXPComInit.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mozilla/xpcom/build/nsXPComInit.cpp b/mozilla/xpcom/build/nsXPComInit.cpp index ad33143e38e..d4ed80d46c3 100644 --- a/mozilla/xpcom/build/nsXPComInit.cpp +++ b/mozilla/xpcom/build/nsXPComInit.cpp @@ -48,6 +48,11 @@ #include "nsThread.h" +#include _NEW_NSIFILE +#include "nsIFileImpl.h" +#include "nsIDirEnumeratorImpl.h" +#endif + #ifdef GC_LEAK_DETECTOR #include "nsLeakDetector.h" #endif @@ -83,6 +88,7 @@ static NS_DEFINE_CID(kSupportsVoidCID, NS_SUPPORTS_VOID_CID); // io static NS_DEFINE_CID(kFileSpecCID, NS_FILESPEC_CID); static NS_DEFINE_CID(kDirectoryIteratorCID, NS_DIRECTORYITERATOR_CID); + // components static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID); static NS_DEFINE_CID(kGenericFactoryCID, NS_GENERICFACTORY_CID); @@ -441,6 +447,21 @@ nsresult NS_COM NS_InitXPCOM(nsIServiceManager* *result, nsSupportsVoidImplConstructor); if (NS_FAILED(rv)) return rv; +#include _NEW_NSIFILE + rv = RegisterGenericFactory(compMgr, nsIFileImpl::GetCID(), + NS_FILE_CLASSNAME, + NS_FILE_PROGID, + nsIFileImpl::Create); + if (NS_FAILED(rv)) return rv; + + rv = RegisterGenericFactory(compMgr, nsIDirEnumeratorImpl::GetCID(), + NS_DIRECTORY_ENUMERATOR_CLASS, + NS_DIRECTORY_ENUMERATOR_PROGID, + nsIDirEnumeratorImpl::Create); + if (NS_FAILED(rv)) return rv; +#endif + + // Prepopulate registry for performance // Ignore return value. It is ok if this fails. nsComponentManagerImpl::gComponentManager->PlatformPrePopulateRegistry();