Whenever we get the NSS Dialogs, make it a proxied service to avoid

all the assertions and eventual abort my JavaScript when we try to
open a window on a thread other than the UI thread.


git-svn-id: svn://10.0.0.236/trunk@86963 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
javi%netscape.com
2001-02-14 01:45:28 +00:00
parent 845066bbe2
commit 04f4b5e3d0

View File

@@ -34,6 +34,7 @@
#include "nsIStringBundle.h"
#include "nsIDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "nsIProxyObjectManager.h"
#include "nsINSSDialogs.h"
#include "prlog.h"
@@ -499,13 +500,23 @@ getNSSDialogs(void **_result, REFNSIID aIID)
{
nsresult rv;
nsISupports *result;
nsCOMPtr<nsISupports> proxiedResult;
rv = nsServiceManager::GetService(kNSSDialogsContractId,
NS_GET_IID(nsINSSDialogs),
&result);
if (NS_FAILED(rv)) return rv;
if (NS_FAILED(rv))
return rv;
rv = result->QueryInterface(aIID, _result);
nsCOMPtr<nsIProxyObjectManager> proxyman(do_GetService(NS_XPCOMPROXY_CONTRACTID));
if (!proxyman)
return NS_ERROR_FAILURE;
proxyman->GetProxyForObject(NS_UI_THREAD_EVENTQ,
aIID, result, PROXY_SYNC,
getter_AddRefs(proxiedResult));
rv = proxiedResult->QueryInterface(aIID, _result);
NS_RELEASE(result);