PRBool& aCompleted, nsICSSStyleSheet*& aSheet)
nsIURI* aSheetURI, PRBool& aCompleted)
CSSLoaderImpl::ParseSheet(nsIUnicharInputStream* aIn,                          SheetLoadData* aLoadData,                          PRBool& aCompleted,                          nsICSSStyleSheet*& aSheet){  nsresult result;  PRBool  failed = PR_TRUE;  aCompleted = PR_TRUE;  aSheet = nsnull;  result = NS_NewCSSStyleSheet(&aSheet, aLoadData->mURL);  if (NS_SUCCEEDED(result)) {    nsCOMPtr<nsICSSParser> parser;    result = GetParserFor(aSheet, getter_AddRefs(parser));    if (NS_SUCCEEDED(result)) {      mParsingData.AppendElement(aLoadData);      if (kNameSpaceID_Unknown != aLoadData->mDefaultNameSpaceID) {        aSheet->SetDefaultNameSpaceID(aLoadData->mDefaultNameSpaceID);      }      result = parser->Parse(aIn, aLoadData->mURL, aSheet);  // this may result in re-entrant load child sheet calls      mParsingData.RemoveElementAt(mParsingData.Count() - 1);      if (NS_SUCCEEDED(result)) {        aSheet->SetModified(PR_FALSE);  // make it clean from the load        failed = PR_FALSE;        if (0 == aLoadData->mPendingChildren) { // sheet isn't still loading children          if (aLoadData->mIsInline) {            aLoadData->mDidBlockParser = PR_FALSE;  // don't need to unblock, we're done and won't block          }          SheetComplete(aSheet, aLoadData);        }        else {  // else sheet is still waiting for children to load, last child will complete it          aCompleted = PR_FALSE;        }      }      RecycleParser(parser);    }  }  if (failed) {    URLKey  key(aLoadData->mURL);    Cleanup(key, aLoadData);  }  return result;}