if (aAlias.IsEmpty()) return NS_ERROR_NULL_POINTER; NS_TIMELINE_START_TIMER("nsCharsetAlias2:GetPreferred");  nsAutoString aKey(aAlias); ToLowerCase(aKey); oResult.Truncate();   if(!mDelegate) { if(aKey.Equals(NS_LITERAL_STRING("utf-8"))) { oResult = NS_LITERAL_STRING("UTF-8"); NS_TIMELINE_STOP_TIMER("nsCharsetAlias2:GetPreferred"); return NS_OK; } if(aKey.Equals(NS_LITERAL_STRING("iso-8859-1"))) { oResult = NS_LITERAL_STRING("ISO-8859-1"); NS_TIMELINE_STOP_TIMER("nsCharsetAlias2:GetPreferred"); return NS_OK; } if(aKey.Equals(NS_LITERAL_STRING("x-sjis")) || aKey.Equals(NS_LITERAL_STRING("shift_jis"))) { oResult = NS_LITERAL_STRING("Shift_JIS"); NS_TIMELINE_STOP_TIMER("nsCharsetAlias2:GetPreferred"); return NS_OK; }    mDelegate = new nsURLProperties( NS_LITERAL_STRING("resource:/res/charsetalias.properties") ); NS_ASSERTION(mDelegate, "cannot create nsURLProperties"); if(nsnull == mDelegate) return NS_ERROR_OUT_OF_MEMORY; }  NS_TIMELINE_STOP_TIMER("nsCharsetAlias2:GetPreferred"); NS_TIMELINE_MARK_TIMER("nsCharsetAlias2:GetPreferred");  return mDelegate->Get(aKey, oResult);
return NS_ERROR_NOT_IMPLEMENTED;
NS_IMETHODIMP nsCharsetAlias2::GetPreferred(const nsAReadableString& aAlias, nsAWritableString& oResult){   if (aAlias.IsEmpty()) return NS_ERROR_NULL_POINTER;   NS_TIMELINE_START_TIMER("nsCharsetAlias2:GetPreferred");   nsAutoString aKey(aAlias);   ToLowerCase(aKey);   oResult.Truncate();   //delay loading charsetalias.properties by resolving most freq. aliases   if(!mDelegate) {     if(aKey.Equals(NS_LITERAL_STRING("utf-8"))) {       oResult = NS_LITERAL_STRING("UTF-8");       NS_TIMELINE_STOP_TIMER("nsCharsetAlias2:GetPreferred");       return NS_OK;     }      if(aKey.Equals(NS_LITERAL_STRING("iso-8859-1"))) {       oResult = NS_LITERAL_STRING("ISO-8859-1");       NS_TIMELINE_STOP_TIMER("nsCharsetAlias2:GetPreferred");       return NS_OK;     }      if(aKey.Equals(NS_LITERAL_STRING("x-sjis")) ||        aKey.Equals(NS_LITERAL_STRING("shift_jis"))) {       oResult = NS_LITERAL_STRING("Shift_JIS");       NS_TIMELINE_STOP_TIMER("nsCharsetAlias2:GetPreferred");       return NS_OK;     }      //load charsetalias.properties string bundle with all remaining aliases     // we may need to protect the following section with a lock so we won't call the      // 'new nsURLProperties' from two different threads     mDelegate = new nsURLProperties( NS_LITERAL_STRING("resource:/res/charsetalias.properties") );     NS_ASSERTION(mDelegate, "cannot create nsURLProperties");     if(nsnull == mDelegate)       return NS_ERROR_OUT_OF_MEMORY;   }   NS_TIMELINE_STOP_TIMER("nsCharsetAlias2:GetPreferred");   NS_TIMELINE_MARK_TIMER("nsCharsetAlias2:GetPreferred");   return mDelegate->Get(aKey, oResult);}