nsCOMPtr<nsIURI> uri; aLoadData->mSheet->GetURL(*getter_AddRefs(uri));
nsCOMPtr<nsIURI> uri = aLoadData->mURI; if (!uri) { aLoadData->mSheet->GetURL(*getter_AddRefs(uri)); }
CSSLoaderImpl::ParseSheet(nsIUnicharInputStream* aStream,                          SheetLoadData* aLoadData,                          PRBool& aCompleted){  LOG(("CSSLoaderImpl::ParseSheet"));  NS_PRECONDITION(aStream, "Must have data to parse");  NS_PRECONDITION(aLoadData, "Must have load data");  NS_PRECONDITION(aLoadData->mSheet, "Must have sheet to parse into");  aCompleted = PR_FALSE;  nsCOMPtr<nsICSSParser> parser;  nsresult rv = GetParserFor(aLoadData->mSheet, getter_AddRefs(parser));  if (NS_FAILED(rv)) {    LOG_ERROR(("  Failed to get CSS parser"));    SheetComplete(aLoadData, PR_FALSE);    return rv;  }  // The parser insists on passing out a strong ref to the sheet it  // parsed.  We don't care.  nsCOMPtr<nsICSSStyleSheet> dummySheet;  // Push our load data on the stack so any kids can pick it up  mParsingDatas.AppendElement(aLoadData);  nsCOMPtr<nsIURI> uri;  aLoadData->mSheet->GetURL(*getter_AddRefs(uri));  rv = parser->Parse(aStream, uri, *getter_AddRefs(dummySheet));  mParsingDatas.RemoveElementAt(mParsingDatas.Count() - 1);  RecycleParser(parser);  NS_ASSERTION(aLoadData->mPendingChildren == 0 || !aLoadData->mSyncLoad,               "Sync load has leftover pending children!");    if (aLoadData->mPendingChildren == 0) {    LOG(("  No pending kids from parse"));    aCompleted = PR_TRUE;    if (!aLoadData->mURI) {      // inline sheet and we're all done with no kids, so we will not      // be blocking the parser      LOG(("  Inline sheet with no pending kids; nulling out parser"));      aLoadData->mParserToUnblock = nsnull;    }    SheetComplete(aLoadData, PR_TRUE);  }  // Otherwise, the children are holding strong refs to the data and  // will call SheetComplete() on it when they complete.    return NS_OK;}