From f206a8d6fcbe407b4c6edc5113b57f5ec2eb3ee2 Mon Sep 17 00:00:00 2001 From: "darin%meer.net" Date: Sat, 11 Mar 2006 02:08:10 +0000 Subject: [PATCH] support passing NS_PROXY_TO_MAIN_THREAD to GetProxyForObject git-svn-id: svn://10.0.0.236/branches/THREADS_20060307_BRANCH@192205 18797224-902f-48f8-a5cc-f745e15eee43 --- .../xpcom/proxy/src/nsProxyObjectManager.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/mozilla/xpcom/proxy/src/nsProxyObjectManager.cpp b/mozilla/xpcom/proxy/src/nsProxyObjectManager.cpp index b6a97a7d1e1..3c2bd2bbb6c 100644 --- a/mozilla/xpcom/proxy/src/nsProxyObjectManager.cpp +++ b/mozilla/xpcom/proxy/src/nsProxyObjectManager.cpp @@ -134,10 +134,14 @@ nsProxyObjectManager::GetProxyForObject(nsIEventTarget* aTarget, *aProxyObject = nsnull; - nsCOMPtr currentThread; - if (!aTarget) { - currentThread = do_GetCurrentThread(); - aTarget = currentThread.get(); + // handle special values + nsCOMPtr thread; + if (aTarget == NS_PROXY_TO_CURRENT_THREAD) { + thread = do_GetCurrentThread(); + aTarget = thread.get(); + } else if (aTarget == NS_PROXY_TO_MAIN_THREAD) { + thread = do_GetMainThread(); + aTarget = thread.get(); } // check to see if the target is on our thread. If so, just return the @@ -179,12 +183,6 @@ NS_GetProxyForObject(nsIEventTarget *target, nsresult rv; - nsCOMPtr mainThread; - if (target == NS_PROXY_TO_MAIN_THREAD) { - mainThread = do_GetMainThread(); - target = mainThread.get(); - } - // get the proxy object manager // nsCOMPtr proxyObjMgr =