adding convenience macro to create always-proxied services necessary when creating the proxy on the same thread for use on a new thread

This commit is contained in:
dveditz%netscape.com 2000-05-05 03:47:00 +00:00
Родитель 3982325c1b
Коммит 7d59f7b2e6
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -64,7 +64,11 @@
// static member functions from nsServiceManager.
#define NS_WITH_PROXIED_SERVICE(T, var, cid, Q, rvAddr) \
nsProxiedService _serv##var(cid, NS_GET_IID(T), Q, rvAddr); \
nsProxiedService _serv##var(cid, NS_GET_IID(T), Q, PR_FALSE, rvAddr); \
T* var = (T*)(nsISupports*)_serv##var;
#define NS_WITH_ALWAYS_PROXIED_SERVICE(T, var, cid, Q, rvAddr) \
nsProxiedService _serv##var(cid, NS_GET_IID(T), Q, PR_TRUE, rvAddr); \
T* var = (T*)(nsISupports*)_serv##var;
////////////////////////////////////////////////////////////////////////////////
@ -76,7 +80,7 @@ class nsProxiedService
public:
nsProxiedService(const nsCID &aClass, const nsIID &aIID,
nsIEventQueue* pIProxyQueue, nsresult*rv)
nsIEventQueue* pIProxyQueue, PRBool always, nsresult*rv)
{
static NS_DEFINE_CID(kProxyObjectManagerCID, NS_PROXYEVENT_MANAGER_CID);
@ -90,10 +94,12 @@ class nsProxiedService
kProxyObjectManagerCID, rv);
if (NS_FAILED(*rv)) return;
PRInt32 proxyType = PROXY_SYNC;
if (always) proxyType |= PROXY_ALWAYS;
*rv = pIProxyObjectManager->GetProxyObject(pIProxyQueue,
aIID,
mService,
PROXY_SYNC,
proxyType,
getter_AddRefs(mProxiedService));
}