147679 GetFromMIMEType on Windows only gets one extension and needs rethinking r=bzbarsky sr=darin
this merges nsIMIMEService::GetFromType and GetFromExtension git-svn-id: svn://10.0.0.236/trunk@145198 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -330,16 +330,11 @@ NS_IMETHODIMP nsIconChannel::AsyncOpen(nsIStreamListener *aListener, nsISupports
|
||||
|
||||
// if we were given an explicit content type, use it....
|
||||
nsCOMPtr<nsIMIMEInfo> mimeInfo;
|
||||
if (mimeService)
|
||||
if (mimeService && (!contentType.IsEmpty() || !fileExtension.IsEmpty()))
|
||||
{
|
||||
if (!contentType.IsEmpty())
|
||||
{
|
||||
mimeService->GetFromMIMEType(contentType.get(), getter_AddRefs(mimeInfo));
|
||||
}
|
||||
if (!mimeInfo) // try to grab an extension for the dummy file in the url.
|
||||
{
|
||||
mimeService->GetFromExtension(fileExtension.get(), getter_AddRefs(mimeInfo));
|
||||
}
|
||||
mimeService->GetFromTypeAndExtension(contentType.get(),
|
||||
fileExtension.get(),
|
||||
getter_AddRefs(mimeInfo));
|
||||
}
|
||||
|
||||
// if we don't have enough info to fetch an application icon, bail
|
||||
|
||||
@@ -409,7 +409,7 @@ NS_IMETHODIMP nsIconChannel::AsyncOpen(nsIStreamListener *aListener, nsISupports
|
||||
nsCOMPtr<nsIMIMEInfo> mimeObject;
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mimeService->GetFromMIMEType(contentType.get(), getter_AddRefs(mimeObject));
|
||||
mimeService->GetFromTypeAndExtension(contentType.get(), nsnull, getter_AddRefs(mimeObject));
|
||||
if (mimeObject)
|
||||
{
|
||||
nsXPIDLCString fileExt;
|
||||
|
||||
@@ -331,7 +331,7 @@ NS_IMETHODIMP nsIconChannel::AsyncOpen(nsIStreamListener *aListener, nsISupports
|
||||
nsCOMPtr<nsIMIMEInfo> mimeObject;
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mimeService->GetFromMIMEType(contentType.get(), getter_AddRefs(mimeObject));
|
||||
mimeService->GetFromTypeAndExtension(contentType.get(), nsnull, getter_AddRefs(mimeObject));
|
||||
if (mimeObject)
|
||||
{
|
||||
nsXPIDLCString fileExt;
|
||||
|
||||
Reference in New Issue
Block a user