Bug 673674 - Fennec freezes when viewing a non .txt file from disk. Mime handler was returning a valid type when it clearly didn't know. r=blassey

This commit is contained in:
Doug Turner 2011-07-26 23:50:47 -07:00
parent 6a28121ce1
commit 769d560e77

View File

@ -112,6 +112,10 @@ nsMIMEInfoAndroid::GetMimeInfoForFileExt(const nsACString& aFileExt,
mozilla::AndroidBridge::Bridge()->
GetMimeTypeFromExtensions(aFileExt, mimeType);
// "*/*" means that the bridge didn't know.
if (mimeType.Equals(nsDependentCString("*/*"), nsCaseInsensitiveCStringComparator()))
return false;
PRBool found = GetMimeInfoForMimeType(mimeType, aMimeInfo);
(*aMimeInfo)->SetPrimaryExtension(aFileExt);
return found;
@ -384,8 +388,8 @@ nsMIMEInfoAndroid::GetPossibleLocalHandlers(nsIArray * *aPossibleLocalHandlers)
NS_IMETHODIMP
nsMIMEInfoAndroid::LaunchWithFile(nsIFile *aFile)
{
nsIURI* uri;
NS_NewFileURI(&uri, aFile);
nsCOMPtr<nsIURI> uri;
NS_NewFileURI(getter_AddRefs(uri), aFile);
LoadUriInternal(uri);
return NS_OK;
}