added nsNetModuleMgr.h to the src dir and added the Create method to the modMgr impl so it can be in the factory

This commit is contained in:
valeski%netscape.com 1999-06-09 14:30:20 +00:00
parent 3135f6a755
commit 79bd80fdf5
2 changed files with 65 additions and 0 deletions

View File

@ -191,3 +191,18 @@ nsNetModuleMgr::~nsNetModuleMgr() {
}
//PR_DestroyLock(mLock);
}
NS_METHOD
nsNetModuleMgr::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
if (aOuter)
return NS_ERROR_NO_AGGREGATION;
nsNetModuleMgr* mgr = new nsNetModuleMgr();
if (mgr == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(mgr);
nsresult rv = mgr->QueryInterface(aIID, aResult);
NS_RELEASE(mgr);
return rv;
}

View File

@ -0,0 +1,50 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef ___nsNetModuleMgr_h__
#define ___nsNetModuleMgr_h__
#include "nsINetModuleMgr.h"
//#include "prlock.h"
#include "nspr.h"
#include "nsISupportsArray.h"
class nsNetModuleMgr : public nsINetModuleMgr {
public:
// nsISupports
NS_DECL_ISUPPORTS
// nsINetModuleMgr
NS_IMETHOD RegisterModule(const char *aTopic, nsIEventQueue *aEventQueue, nsINetNotify *aNotify, const nsCID * aCID);
NS_IMETHOD UnregisterModule(const char *aTopic, nsIEventQueue *aEventQueue, nsINetNotify *aNotify, const nsCID * aCID);
NS_IMETHOD EnumerateModules(const char *aTopic, nsISimpleEnumerator **aEnumerator);
// nsNetModuleMgr
nsNetModuleMgr();
~nsNetModuleMgr();
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
nsISupportsArray *mEntries;
//PR_Lock *mLock;
};
#endif // ___nsNetModuleMgr_h__