if (!prompt) return nsnull;
if (!prompt) { NS_ASSERTION(PR_FALSE, "callbacks does not implement nsIPrompt"); return nsnull; }
char* PK11PasswordPrompt(PK11SlotInfo* slot, PRBool retry, void* arg) {  nsresult rv = NS_OK;  PRUnichar *password = nsnull;  PRBool value = PR_FALSE;  nsIInterfaceRequestor *ir = NS_STATIC_CAST(nsIInterfaceRequestor*, arg);  nsCOMPtr<nsIPrompt> proxyPrompt;  // If no context is provided, no prompt is possible.  if (!ir)    return nsnull;  /* TODO: Retry should generate a different dialog message *//*  if (retry)    return nsnull;*/  // The interface requestor object may not be safe, so  // proxy the call to get the nsIPrompt.  nsCOMPtr<nsIProxyObjectManager> proxyman(do_GetService(NS_XPCOMPROXY_CONTRACTID));  if (!proxyman) return nsnull;  nsCOMPtr<nsIInterfaceRequestor> proxiedCallbacks;  proxyman->GetProxyForObject(NS_UI_THREAD_EVENTQ,                              NS_GET_IID(nsIInterfaceRequestor),                              ir,                              PROXY_SYNC,                              getter_AddRefs(proxiedCallbacks));  // Get the desired interface  nsCOMPtr<nsIPrompt> prompt(do_GetInterface(proxiedCallbacks));  if (!prompt) return nsnull;  // Finally, get a proxy for the nsIPrompt  proxyman->GetProxyForObject(NS_UI_THREAD_EVENTQ,	                      NS_GET_IID(nsIPrompt),                              prompt,                              PROXY_SYNC,                              getter_AddRefs(proxyPrompt));  if (!proxyPrompt) {    NS_ASSERTION(PR_FALSE, "callbacks does not implement nsIPrompt");    return nsnull;  }  nsString promptString;  nsCOMPtr<nsINSSComponent> nssComponent(do_GetService(kNSSComponentCID, &rv));  if (NS_FAILED(rv))    return nsnull;   nssComponent->GetPIPNSSBundleString(NS_LITERAL_STRING("CertPassPrompt"),                                      promptString);  PRUnichar *uniString = promptString.ToNewUnicode();  rv = proxyPrompt->PromptPassword(nsnull, uniString,                                   NS_LITERAL_STRING(" "),                                   nsIPrompt::SAVE_PASSWORD_NEVER,                                   &password, &value);  nsMemory::Free(uniString);  if (NS_SUCCEEDED(rv) && value) {    char* str = nsString(password).ToNewCString();    Recycle(password);    return str;  }  return nsnull;}