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
This commit is contained in:
@@ -134,10 +134,14 @@ nsProxyObjectManager::GetProxyForObject(nsIEventTarget* aTarget,
|
||||
|
||||
*aProxyObject = nsnull;
|
||||
|
||||
nsCOMPtr<nsIThread> currentThread;
|
||||
if (!aTarget) {
|
||||
currentThread = do_GetCurrentThread();
|
||||
aTarget = currentThread.get();
|
||||
// handle special values
|
||||
nsCOMPtr<nsIThread> 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<nsIThread> mainThread;
|
||||
if (target == NS_PROXY_TO_MAIN_THREAD) {
|
||||
mainThread = do_GetMainThread();
|
||||
target = mainThread.get();
|
||||
}
|
||||
|
||||
// get the proxy object manager
|
||||
//
|
||||
nsCOMPtr<nsIProxyObjectManager> proxyObjMgr =
|
||||
|
||||
Reference in New Issue
Block a user