From fa282d90632c08a4a2ddbb1fac61d5df85e82d92 Mon Sep 17 00:00:00 2001 From: "dveditz%netscape.com" Date: Fri, 5 May 2000 03:47:00 +0000 Subject: [PATCH] adding convenience macro to create always-proxied services necessary when creating the proxy on the same thread for use on a new thread git-svn-id: svn://10.0.0.236/trunk@68327 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/proxy/public/nsProxiedService.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mozilla/xpcom/proxy/public/nsProxiedService.h b/mozilla/xpcom/proxy/public/nsProxiedService.h index 9c4d7119977..3ec08c97c14 100644 --- a/mozilla/xpcom/proxy/public/nsProxiedService.h +++ b/mozilla/xpcom/proxy/public/nsProxiedService.h @@ -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)); }