mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
bug 223997
PluginHostImpl should use GetTypeFromURI not FromExtension r=peterlubczynski sr=bz
This commit is contained in:
parent
adbe194656
commit
e3dd841394
@ -3960,22 +3960,13 @@ nsresult nsPluginHostImpl::SetUpDefaultPluginInstance(const char *aMimeType, nsI
|
||||
if(mimetype == nsnull)
|
||||
{
|
||||
nsresult res = NS_OK;
|
||||
nsCOMPtr<nsIURL> url = do_QueryInterface(aURL);
|
||||
if(url)
|
||||
nsCOMPtr<nsIMIMEService> ms (do_GetService(NS_MIMESERVICE_CONTRACTID, &res));
|
||||
if(NS_SUCCEEDED(res))
|
||||
{
|
||||
nsCAutoString extension;
|
||||
url->GetFileExtension(extension);
|
||||
|
||||
if(!extension.IsEmpty())
|
||||
{
|
||||
nsCOMPtr<nsIMIMEService> ms (do_GetService(NS_MIMESERVICE_CONTRACTID, &res));
|
||||
if(NS_SUCCEEDED(res) && ms)
|
||||
{
|
||||
res = ms->GetTypeFromExtension(extension.get(), getter_Copies(mt));
|
||||
if(NS_SUCCEEDED(res))
|
||||
mimetype = mt;
|
||||
}
|
||||
}
|
||||
nsXPIDLCString mt;
|
||||
res = ms->GetTypeFromURI(aURL, getter_Copies(mt));
|
||||
if(NS_SUCCEEDED(res))
|
||||
mimetype = mt;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user