*result = dialog; NS_ADDREF(dialog);
nsCOMPtr<nsIPrompt> prompter; nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1")); if (wwatch) { wwatch->GetNewPrompter(0, getter_AddRefs(prompter)); if (prompter) { nsCOMPtr<nsIPrompt> proxyPrompt; proxyman->GetProxyForObject(NS_UI_THREAD_EVENTQ, NS_GET_IID(nsIPrompt), prompter, PROXY_SYNC, getter_AddRefs(proxyPrompt)); if (!proxyPrompt) return NS_ERROR_FAILURE; *result = proxyPrompt; NS_ADDREF(proxyPrompt); } }
NS_IMETHODIMP CertDownloaderContext::GetInterface(const nsIID & uuid, void * *result){  nsresult rv;  if (uuid.Equals(NS_GET_IID(nsIPrompt))) {    NS_WITH_PROXIED_SERVICE(nsIPrompt, dialog, kNetSupportDialogCID,                          NS_UI_THREAD_EVENTQ, &rv);    if (NS_FAILED(rv)) return rv;    *result = dialog;    NS_ADDREF(dialog);  } else {    rv = NS_ERROR_NO_INTERFACE;  }  return rv;}