return extProtService->LoadUrl(mUrl);
PRBool allowLoad    = PR_FALSE; nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));  if (prefs) {  nsCAutoString schemePref(kExternalProtocolPrefPrefix); schemePref += urlScheme;  nsresult rv = prefs->GetBoolPref(schemePref.get(), &allowLoad);  if (NS_FAILED(rv)) {  const PRInt32 kExternalProtocolNever  = 0; const PRInt32 kExternalProtocolAlways = 1; const PRInt32 kExternalProtocolAsk    = 2;  PRInt32 externalDefault = kExternalProtocolAsk; prefs->GetIntPref("network.protocol-handler.external-default", &externalDefault);  if (externalDefault == kExternalProtocolAlways) {  allowLoad = PR_TRUE; } else if (externalDefault == kExternalProtocolAsk) { allowLoad = PromptForScheme(mUrl, urlScheme); } } }  if (allowLoad) return extProtService->LoadUrl(mUrl);
nsresult nsExtProtocolChannel::OpenURL(){  nsCOMPtr<nsIExternalProtocolService> extProtService (do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID));  nsCAutoString urlScheme;  mUrl->GetScheme(urlScheme);  if (extProtService)  {#ifdef DEBUG    PRBool haveHandler = PR_FALSE;    extProtService->ExternalProtocolHandlerExists(urlScheme.get(), &haveHandler);    NS_ASSERTION(haveHandler, "Why do we have a channel for this url if we don't support the protocol?");#endif    return extProtService->LoadUrl(mUrl);  }    return NS_ERROR_FAILURE;}