nsCOMPtr<nsIProxyObjectManager> proxyman(do_GetService(NS_XPCOMPROXY_CONTRACTID)); if (!proxyman) return NS_ERROR_FAILURE;  nsCOMPtr<nsIInterfaceRequestor> proxiedCallbacks; proxyman->GetProxyForObject(NS_UI_THREAD_EVENTQ, NS_GET_IID(nsIInterfaceRequestor), NS_STATIC_CAST(nsIInterfaceRequestor*,socketInfo), PROXY_SYNC, getter_AddRefs(proxiedCallbacks));  nsCOMPtr<nsIPrompt> prompt (do_GetInterface(proxiedCallbacks));  if (!prompt) return NS_ERROR_NO_INTERFACE;  nsCOMPtr<nsIPrompt> proxyPrompt;  proxyman->GetProxyForObject(NS_UI_THREAD_EVENTQ, NS_GET_IID(nsIPrompt), prompt, PROXY_SYNC, getter_AddRefs(proxyPrompt)); proxyPrompt->Alert(nsnull, formattedString.get()); return NS_OK;
rv = displayAlert(formattedString, socketInfo); return rv;
nsHandleSSLError(nsNSSSocketInfo *socketInfo, PRInt32 err){  nsresult rv;  NS_DEFINE_CID(nssComponentCID, NS_NSSCOMPONENT_CID);  nsCOMPtr<nsINSSComponent> nssComponent(do_GetService(nssComponentCID, &rv));  if (NS_FAILED(rv))    return rv;  nsXPIDLCString hostName;  socketInfo->GetHostName(getter_Copies(hostName));  NS_ConvertASCIItoUCS2 hostNameU(hostName);  const PRUnichar *params[2];  nsXPIDLString formattedString;  switch (err) {  case SSL_ERROR_SSL_DISABLED:    params[0] = hostNameU.get();    nssComponent->PIPBundleFormatStringFromName(NS_LITERAL_STRING("SSLDisabled").get(),                                                params, 1,                                                getter_Copies(formattedString));    break;  case SSL_ERROR_SSL2_DISABLED:    params[0] = hostNameU.get();    nssComponent->PIPBundleFormatStringFromName(NS_LITERAL_STRING("SSL2Disabled").get(),                                                params, 1,                                                getter_Copies(formattedString));    break;  case SSL_ERROR_EXPORT_ONLY_SERVER:  case SSL_ERROR_US_ONLY_SERVER:  case SSL_ERROR_NO_CYPHER_OVERLAP:    {      NS_DEFINE_CID(StringBundleServiceCID,  NS_STRINGBUNDLESERVICE_CID);      nsCOMPtr<nsIStringBundleService> service =                                   do_GetService(StringBundleServiceCID, &rv);      nsCOMPtr<nsIStringBundle> brandBundle;      service->CreateBundle("chrome://global/locale/brand.properties",                            getter_AddRefs(brandBundle));      nsXPIDLString brandShortName;      brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),                                     getter_Copies(brandShortName));      params[0] = brandShortName.get();      params[1] = hostNameU.get();      nssComponent->PIPBundleFormatStringFromName(NS_LITERAL_STRING("SSLNoMatchingCiphers").get(),                                                  params, 2,                                                  getter_Copies(formattedString));                                                      }    break;  default:    {      char buf[80];      PR_snprintf(buf, 80, "%ld", err);      NS_ConvertASCIItoUCS2 errorCode(buf);      params[0] = hostNameU.get();      params[1] = errorCode.get();       nssComponent->PIPBundleFormatStringFromName(NS_LITERAL_STRING("SSLGenericError").get(),                                                  params, 2,                                                   getter_Copies(formattedString));          }                                               break;  }  // 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 NS_ERROR_FAILURE;   nsCOMPtr<nsIInterfaceRequestor> proxiedCallbacks;  proxyman->GetProxyForObject(NS_UI_THREAD_EVENTQ,                              NS_GET_IID(nsIInterfaceRequestor),                              NS_STATIC_CAST(nsIInterfaceRequestor*,socketInfo),                              PROXY_SYNC,                              getter_AddRefs(proxiedCallbacks));  nsCOMPtr<nsIPrompt> prompt (do_GetInterface(proxiedCallbacks));    if (!prompt)    return NS_ERROR_NO_INTERFACE;  nsCOMPtr<nsIPrompt> proxyPrompt;  // Finally, get a proxy for the nsIPrompt  proxyman->GetProxyForObject(NS_UI_THREAD_EVENTQ,                              NS_GET_IID(nsIPrompt),                              prompt,                              PROXY_SYNC,                              getter_AddRefs(proxyPrompt));  proxyPrompt->Alert(nsnull, formattedString.get());  return NS_OK;}