diff --git a/netwerk/base/src/nsNetModuleMgr.cpp b/netwerk/base/src/nsNetModuleMgr.cpp index 3440ff3172ce..43e6dbfc012f 100644 --- a/netwerk/base/src/nsNetModuleMgr.cpp +++ b/netwerk/base/src/nsNetModuleMgr.cpp @@ -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; +} diff --git a/netwerk/base/src/nsNetModuleMgr.h b/netwerk/base/src/nsNetModuleMgr.h new file mode 100644 index 000000000000..70a4f59c20fa --- /dev/null +++ b/netwerk/base/src/nsNetModuleMgr.h @@ -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__ \ No newline at end of file