From 814a71587e527fe30bf53b32790755dae01a8541 Mon Sep 17 00:00:00 2001 From: "tbogard%aol.net" Date: Tue, 25 Jan 2000 10:51:57 +0000 Subject: [PATCH] Backing out generic module as it causes a problem in webshell loading for now. --- docshell/build/nsDocShellModule.cpp | 83 +++++++++++++++++++++++++---- 1 file changed, 73 insertions(+), 10 deletions(-) diff --git a/docshell/build/nsDocShellModule.cpp b/docshell/build/nsDocShellModule.cpp index b007d52a2790..51c6e4c23cd9 100644 --- a/docshell/build/nsDocShellModule.cpp +++ b/docshell/build/nsDocShellModule.cpp @@ -20,30 +20,93 @@ * Travis Bogard */ -#include "nsIModule.h" +#include "nsIGenericFactory.h" +#include "nsIComponentManager.h" +#include "nsIServiceManager.h" + +#include "nsDocShell.h" + +static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID); +static NS_DEFINE_CID(kDocShellCID, NS_DOCSHELL_CID); + +//***************************************************************************** +//*** Library Exports +//***************************************************************************** + +extern "C" PR_IMPLEMENT(nsresult) +NSGetFactory(nsISupports* aServMgr, + const nsCID &aClass, + const char *aClassName, + const char *aProgID, + nsIFactory **aFactory) +{ + NS_ENSURE_ARG_POINTER(aFactory); + nsresult rv; + + nsIGenericFactory* fact; + + if(aClass.Equals(kDocShellCID)) + rv = NS_NewGenericFactory(&fact, nsDocShell::Create); + else + rv = NS_NOINTERFACE; + + if(NS_SUCCEEDED(rv)) + *aFactory = fact; + return rv; +} + +extern "C" PR_IMPLEMENT(nsresult) +NSRegisterSelf(nsISupports* aServMgr , const char* aPath) +{ + nsresult rv; + NS_WITH_SERVICE1(nsIComponentManager, compMgr, aServMgr, kComponentManagerCID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + rv = compMgr->RegisterComponent(kDocShellCID, + "nsDocShell", + NS_DOCSHELL_PROGID, + aPath, PR_TRUE, PR_TRUE); + NS_ENSURE_SUCCESS(rv, rv); + + return rv; +} + +extern "C" PR_IMPLEMENT(nsresult) +NSUnregisterSelf(nsISupports* aServMgr, const char* aPath) +{ + nsresult rv; + + NS_WITH_SERVICE1(nsIComponentManager, compMgr, aServMgr, kComponentManagerCID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + rv = compMgr->UnregisterComponent(kDocShellCID, aPath); + NS_ENSURE_SUCCESS(rv, rv); + + return rv; +} + + +/*#include "nsIModule.h" #include "nsIGenericFactory.h" #include "nsDocShell.h" -/* - Factory Constructors -*/ + +// Factory Constructors //NS_GENERIC_FACTORY_CONSTRUCTOR(nsDocShell) -/* - Component Table -*/ + +// Component Table static nsModuleComponentInfo components[] = { { "DocShell Component", NS_DOCSHELL_CID, NS_DOCSHELL_PROGID, nsDocShell::Create } }; -/* - NSGetModule implementation. -*/ + +// NSGetModule implementation. NS_IMPL_NSGETMODULE("nsDocShellModule", components) + */ \ No newline at end of file