mLoader->DidLoadStyle(aLoader, aDataStream, this, aStatus);   NS_RELEASE(aLoader); return NS_OK;
if (NS_FAILED(aStatus) || !aDataStream) { LOG_WARN(("  Load failed: status %u, data stream %p", aStatus, aDataStream)); mLoader->SheetComplete(this, PR_FALSE); return NS_OK; }  PRBool completed; return mLoader->ParseSheet(aDataStream, this, channelURI ? channelURI : mURI, completed);
SheetLoadData::OnStreamComplete(nsIUnicharStreamLoader* aLoader,                                nsISupports* aContext,                                nsresult aStatus,                                nsIUnicharInputStream* aDataStream){  nsCOMPtr<nsIChannel> channel;  nsresult result = aLoader->GetChannel(getter_AddRefs(channel));  if (NS_FAILED(result))    channel = nsnull;  NS_TIMELINE_OUTDENT();  NS_TIMELINE_MARK_CHANNEL("SheetLoadData::OnStreamComplete(%s)", channel);  // If it's an HTTP channel, we want to make sure this is not an  // error document we got.  PRBool realDocument = PR_TRUE;  nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));  if (httpChannel) {    PRBool requestSucceeded;    result = httpChannel->GetRequestSucceeded(&requestSucceeded);    if (NS_SUCCEEDED(result) && !requestSucceeded) {      realDocument = PR_FALSE;    }  }  if (realDocument && aDataStream) {    nsCAutoString contentType;    if (channel) {      channel->GetContentType(contentType);    }    if (mLoader->mCompatMode == eCompatibility_NavQuirks ||        contentType.Equals(NS_LITERAL_CSTRING("text/css")) ||        contentType.IsEmpty()) {      if (!contentType.IsEmpty() &&          contentType != NS_LITERAL_CSTRING("text/css")) {        nsCAutoString spec;        if (channel) {          nsCOMPtr<nsIURI> uri;          channel->GetURI(getter_AddRefs(uri));          if (uri)            uri->GetSpec(spec);        }        const nsAFlatString& specUCS2 = NS_ConvertUTF8toUCS2(spec);        const nsAFlatString& ctypeUCS2 = NS_ConvertASCIItoUCS2(contentType);        const PRUnichar *strings[] = { specUCS2.get(), ctypeUCS2.get() };        ReportToConsole(NS_LITERAL_STRING("MimeNotCssWarn").get(), strings, 2,                        nsIScriptError::warningFlag);      }    } else {      // Drop the data stream so that we do not load it      aDataStream = nsnull;            nsCAutoString spec;      if (channel) {        nsCOMPtr<nsIURI> uri;        channel->GetURI(getter_AddRefs(uri));        if (uri)          uri->GetSpec(spec);      }      const nsAFlatString& specUCS2 = NS_ConvertUTF8toUCS2(spec);      const nsAFlatString& ctypeUCS2 = NS_ConvertASCIItoUCS2(contentType);      const PRUnichar *strings[] = { specUCS2.get(), ctypeUCS2.get() };      ReportToConsole(NS_LITERAL_STRING("MimeNotCss").get(), strings, 2,                      nsIScriptError::errorFlag);    }  } else {    // Drop the data stream so that we do not load it    aDataStream = nsnull;  }    mLoader->DidLoadStyle(aLoader, aDataStream, this, aStatus);  // We added a reference when the loader was created. This  // release should destroy it.  NS_RELEASE(aLoader);  return NS_OK;}