зеркало из https://github.com/mozilla/gecko-dev.git
Implementing access to servicemanager from component manager via
nsIInterfaceRequestor. r=scc
This commit is contained in:
Родитель
5d32515178
Коммит
2df47b0c6d
|
@ -317,7 +317,8 @@ nsComponentManagerImpl::~nsComponentManagerImpl()
|
||||||
PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, ("nsComponentManager: Destroyed."));
|
PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, ("nsComponentManager: Destroyed."));
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS2(nsComponentManagerImpl, nsIComponentManager, nsISupportsWeakReference)
|
NS_IMPL_ISUPPORTS3(nsComponentManagerImpl, nsIComponentManager,
|
||||||
|
nsISupportsWeakReference, nsIInterfaceRequestor)
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// nsComponentManagerImpl: Platform methods
|
// nsComponentManagerImpl: Platform methods
|
||||||
|
@ -2241,6 +2242,25 @@ nsComponentManagerImpl::EnumerateProgIDs(nsIEnumerator** aEmumerator)
|
||||||
this, aEmumerator);
|
this, aEmumerator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
nsComponentManagerImpl::GetInterface(const nsIID & uuid, void **result)
|
||||||
|
{
|
||||||
|
nsresult rv = NS_OK;
|
||||||
|
if (uuid.Equals(NS_GET_IID(nsIServiceManager)))
|
||||||
|
{
|
||||||
|
// Return the global service manager
|
||||||
|
rv = nsServiceManager::GetGlobalServiceManager((nsIServiceManager **)result);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// fall through to QI as anything QIable is a superset of what canbe
|
||||||
|
// got via the GetInterface()
|
||||||
|
rv = QueryInterface(uuid, result);
|
||||||
|
}
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
NS_COM nsresult
|
NS_COM nsresult
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "nsIComponentManager.h"
|
#include "nsIComponentManager.h"
|
||||||
#include "nsIFactory.h"
|
#include "nsIFactory.h"
|
||||||
#include "nsIRegistry.h"
|
#include "nsIRegistry.h"
|
||||||
|
#include "nsIInterfaceRequestor.h"
|
||||||
#include "nsHashtable.h"
|
#include "nsHashtable.h"
|
||||||
#include "prtime.h"
|
#include "prtime.h"
|
||||||
#include "prmon.h"
|
#include "prmon.h"
|
||||||
|
@ -50,10 +51,13 @@ extern const char XPCOM_LIB_PREFIX[];
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class nsComponentManagerImpl : public nsIComponentManager, public nsSupportsWeakReference {
|
class nsComponentManagerImpl
|
||||||
|
: public nsIComponentManager, public nsSupportsWeakReference,
|
||||||
|
public nsIInterfaceRequestor {
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
NS_DECL_NSICOMPONENTMANAGER
|
NS_DECL_NSICOMPONENTMANAGER
|
||||||
|
NS_DECL_NSIINTERFACEREQUESTOR
|
||||||
|
|
||||||
// nsComponentManagerImpl methods:
|
// nsComponentManagerImpl methods:
|
||||||
nsComponentManagerImpl();
|
nsComponentManagerImpl();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче