landing patch for bug 326273 "Implement nsIThreadManager" (Mac portions by Mark Mentovai) with reviews from bienvenu, bsmedberg, bzbarsky, josh, roc, and ssieb
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIProxyObjectManager.h"
|
||||
#include "nsSupportsArray.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#include "nsConsoleService.h"
|
||||
#include "nsConsoleMessage.h"
|
||||
@@ -309,24 +310,12 @@ nsresult
|
||||
nsConsoleService::GetProxyForListener(nsIConsoleListener* aListener,
|
||||
nsIConsoleListener** aProxy)
|
||||
{
|
||||
nsresult rv;
|
||||
*aProxy = nsnull;
|
||||
|
||||
nsCOMPtr<nsIProxyObjectManager> proxyManager =
|
||||
(do_GetService(NS_XPCOMPROXY_CONTRACTID));
|
||||
|
||||
if (proxyManager == nsnull)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
/*
|
||||
* NOTE this will fail if the calling thread doesn't have an eventQ.
|
||||
*
|
||||
* Would it be better to catch that case and leave the listener unproxied?
|
||||
*/
|
||||
rv = proxyManager->GetProxyForObject(NS_CURRENT_EVENTQ,
|
||||
NS_GET_IID(nsIConsoleListener),
|
||||
aListener,
|
||||
PROXY_ASYNC | PROXY_ALWAYS,
|
||||
(void**) aProxy);
|
||||
return rv;
|
||||
return NS_GetProxyForObject(NS_PROXY_TO_CURRENT_THREAD,
|
||||
NS_GET_IID(nsIConsoleListener),
|
||||
aListener,
|
||||
NS_PROXY_ASYNC | NS_PROXY_ALWAYS,
|
||||
(void**) aProxy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user