25 #ifndef __SB_PROXIEDCOMPONENTMANAGER_H__
26 #define __SB_PROXIEDCOMPONENTMANAGER_H__
28 #include <nsIRunnable.h>
30 #include <nsComponentManagerUtils.h>
31 #include <nsServiceManagerUtils.h>
32 #include <nsThreadUtils.h>
33 #include <nsIProxyObjectManager.h>
34 #include <nsXPCOMCIDInternal.h>
35 #include <nsProxyRelease.h>
45 const char* aContractID,
68 mIsService(aIsService),
77 mContractID(aContractID),
78 mIsService(aIsService),
83 virtual nsresult NS_FASTCALL operator()(
const nsIID&,
void**)
const;
87 const char* mContractID;
128 nsIEventTarget *aTarget,
138 nsCOMPtr<nsIThread> thread;
139 nsCOMPtr<nsIEventTarget>
target;
140 if (aTarget == NS_PROXY_TO_CURRENT_THREAD) {
141 rv = NS_GetCurrentThread(getter_AddRefs(thread));
142 NS_ENSURE_SUCCESS(rv, rv);
146 else if (aTarget == NS_PROXY_TO_MAIN_THREAD) {
147 rv = NS_GetMainThread(getter_AddRefs(thread));
148 NS_ENSURE_SUCCESS(rv, rv);
156 rv = aProxyObjMgr->GetProxyForObject(target,
172 nsCOMPtr<nsIProxyObjectManager> proxyObjMgr =
174 NS_ENSURE_SUCCESS(rv, rv);
182 NS_ENSURE_SUCCESS(rv, rv);
192 void ** aProxyObject)
195 NS_GET_TEMPLATE_IID(T),
211 mSupports(aSupports),
216 virtual nsresult NS_FASTCALL operator()(
const nsIID&,
void**)
const;
245 nsresult* aResult = nsnull)
251 template <
class T>
inline void
253 nsresult* aResult = nsnull)
sbCreateProxiedComponent(const char *aContractID, PRBool aIsService, nsresult *aErrorPtr)
sbMainThreadQueryInterface(nsISupports *aSupports, nsresult *aResult)
nsresult do_GetProxyForObject(nsIEventTarget *aTarget, REFNSIID aIID, nsISupports *aObj, PRInt32 aProxyType, void **aProxyObject)
const sbCreateProxiedComponent do_ProxiedCreateInstance(const nsCID &aCID, nsresult *error=0)
nsCOMPtr< nsISupports > mSupports
const sbCreateProxiedComponent do_ProxiedGetService(const nsCID &aCID, nsresult *error=0)
sbMainThreadQueryInterface do_MainThreadQueryInterface(nsISupports *aSupports, nsresult *aResult=nsnull)
NS_DECL_ISUPPORTS NS_DECL_NSIRUNNABLE sbProxiedComponentManagerRunnable(PRBool aIsService, const nsCID &aCID, const char *aContractID, const nsIID &aIID)
nsresult do_GetProxyForObjectWithManager(nsIProxyObjectManager *aProxyObjMgr, nsIEventTarget *aTarget, REFNSIID aIID, nsISupports *aObj, PRInt32 aProxyType, void **aProxyObject)
sbCreateProxiedComponent(const nsCID &aCID, PRBool aIsService, nsresult *aErrorPtr)