45723. r=rpotts. webshell-docshell consolodation changes.

git-svn-id: svn://10.0.0.236/trunk@74406 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
valeski%netscape.com
2000-07-18 23:13:07 +00:00
parent 4d88da0c4a
commit 37012edc37
28 changed files with 221 additions and 499 deletions

View File

@@ -20,98 +20,27 @@
* Travis Bogard <travis@netscape.com>
*/
#include "nsIModule.h"
#include "nsIGenericFactory.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsWebShell.h"
#include "nsDocShell.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebShell);
// Factory Constructors
// Currently no-one is instanciating docshell's directly because
// nsWebShell is still our main "shell" class. nsWebShell is a subclass
// of nsDocShell. Once migration is complete, docshells will be the main
// "shell" class and this module will need to register the docshell as
// a component
//NS_GENERIC_FACTORY_CONSTRUCTOR(nsDocShell);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDocShell)
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, nsDocShellConstructor);
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
//NS_GENERIC_FACTORY_CONSTRUCTOR(nsDocShell)
// Component Table
static nsModuleComponentInfo components[] =
{
{ "DocShell Component", NS_DOCSHELL_CID, NS_DOCSHELL_PROGID, nsDocShellConstructor }
static nsModuleComponentInfo gDocShellModuleInfo[] = {
{ "WebShell",
NS_WEB_SHELL_CID,
"component://netscape/webshell",
nsWebShellConstructor }
};
// NSGetModule implementation.
NS_IMPL_NSGETMODULE("nsDocShellModule", components)
*/
// "docshell provider" to illustrate that this thing really *should*
// be dispensing docshells rather than webshells.
NS_IMPL_NSGETMODULE("docshell provider", gDocShellModuleInfo)