nsIUnicharStreamLoader* loader; #ifdef NECKO nsIURI* urlClone; result = aKey.mURL->Clone(&urlClone); if (NS_SUCCEEDED(result)) { #else nsIURI* urlClone = CloneURL(aKey.mURL); if (urlClone) {
if (mDocument) { nsIUnicharStreamLoader* loader; nsIURI* urlClone; result = aKey.mURL->Clone(&urlClone); if (NS_SUCCEEDED(result)) { #ifdef NS_DEBUG mSyncCallback = PR_TRUE;
CSSLoaderImpl::LoadSheet(URLKey& aKey, SheetLoadData* aData){  nsresult result = NS_OK;  SheetLoadData* loadingData = (SheetLoadData*)mLoadingSheets.Get(&aKey);  if (loadingData) {  // already loading this sheet, glom on to the load    while (loadingData->mNext) {      loadingData = loadingData->mNext;    }    loadingData->mNext = aData;  }  else {  // not loading, go load it    nsIUnicharStreamLoader* loader;#ifdef NECKO    nsIURI* urlClone;    result = aKey.mURL->Clone(&urlClone); // dont give key URL to netlib, it gets munged    if (NS_SUCCEEDED(result)) {#else    nsIURI* urlClone = CloneURL(aKey.mURL); // don't give the key to netlib, it munges it    if (urlClone) {#endif#ifdef NS_DEBUG      mSyncCallback = PR_TRUE;#endif      result = NS_NewUnicharStreamLoader(&loader, urlClone, #ifdef NECKO                                         nsCOMPtr<nsILoadGroup>(mDocument->GetDocumentLoadGroup()),#endif                                         DoneLoadingStyle, aData);#ifdef NS_DEBUG      mSyncCallback = PR_FALSE;#endif      NS_RELEASE(urlClone);      if (NS_SUCCEEDED(result)) {        mLoadingSheets.Put(&aKey, aData);        // grab any pending alternates that have this URL        loadingData = aData;        PRInt32 index = 0;        while (index < mPendingAlternateSheets.Count()) {          SheetLoadData* data = (SheetLoadData*)mPendingAlternateSheets.ElementAt(index);#ifdef NECKO          PRBool equals = PR_FALSE;          result = aKey.mURL->Equals(data->mURL, &equals);          if (NS_SUCCEEDED(result) && equals)#else          if (aKey.mURL->Equals(data->mURL))#endif          {            mPendingAlternateSheets.RemoveElementAt(index);            loadingData->mNext = data;            loadingData = data;          }          else {            index++;          }        }      }    }  }  return result;}