PRBool bIsBackground = aURL->GetBackgroundLoad(); if (bIsBackground) { (void)channel->SetLoadAttributes(nsIChannel::LOAD_BACKGROUND);
NS_WITH_SERVICE(nsIURILoader, pURILoader, NS_URI_LOADER_PROGID, &rv); if (NS_SUCCEEDED(rv)) { nsURILoadCommand loadCmd = nsIURILoader::viewNormal; PRBool bIsBackground = aURL->GetBackgroundLoad(); if (bIsBackground) { loadCmd = nsIURILoader::viewNormalBackground; }  rv = pURILoader->OpenURI(nsurl, loadCmd, nsnull , window, nsnull , group, getter_AddRefs(openContext));
ImageNetContextImpl::GetURL (ilIURL * aURL,                              NET_ReloadMethod aLoadMethod,                             ilINetReader *aReader){  NS_PRECONDITION(nsnull != aURL, "null URL");  NS_PRECONDITION(nsnull != aReader, "null reader");  if (aURL == nsnull || aReader == nsnull) {    return -1;  }  if (mRequests == nsnull) {    mRequests = new nsVoidArray();    if (mRequests == nsnull) {      // XXX Should still call exit function      return -1;    }  }  nsresult rv;  nsCOMPtr<nsIURI> nsurl = do_QueryInterface(aURL, &rv);  if (NS_FAILED(rv)) return 0;  aURL->SetReader(aReader);  SetReloadPolicy(aLoadMethod);        // Find previously created ImageConsumer if possible  ImageConsumer *ic = new ImageConsumer(aURL, this);  if (ic == nsnull)    return -1;  NS_ADDREF(ic);          // See if a reconnect is being done...(XXX: hack!)  if (mReconnectCallback == nsnull      || !(*mReconnectCallback)(mReconnectArg, ic)) {    nsCOMPtr<nsIChannel> channel;    nsCOMPtr<nsILoadGroup> group = do_QueryReferent(mLoadGroup);    rv = NS_OpenURI(getter_AddRefs(channel), nsurl, group);    if (NS_FAILED(rv)) goto error;    PRBool bIsBackground = aURL->GetBackgroundLoad();    if (bIsBackground) {      (void)channel->SetLoadAttributes(nsIChannel::LOAD_BACKGROUND);    }    rv = channel->AsyncRead(0, -1, nsnull, ic);    if (NS_FAILED(rv)) goto error;  }  return mRequests->AppendElement((void *)ic) ? 0 : -1;error:  NS_RELEASE(ic);  return -1;}