зеркало из https://github.com/mozilla/pjs.git
Fixing bug 393756. Get the plugin mimetype from the file extension in the URI if no other type information is available. r+sr=bzbarsky@mit.edu
This commit is contained in:
Родитель
21f2582968
Коммит
a79df711bf
|
@ -353,7 +353,8 @@ nsObjectLoadingContent::~nsObjectLoadingContent()
|
||||||
|
|
||||||
// nsIRequestObserver
|
// nsIRequestObserver
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext)
|
nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest,
|
||||||
|
nsISupports *aContext)
|
||||||
{
|
{
|
||||||
if (aRequest != mChannel) {
|
if (aRequest != mChannel) {
|
||||||
// This is a bit of an edge case - happens when a new load starts before the
|
// This is a bit of an edge case - happens when a new load starts before the
|
||||||
|
@ -409,6 +410,17 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest, nsISupports *aConte
|
||||||
mContentType = channelType;
|
mContentType = channelType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsCOMPtr<nsIURI> uri;
|
||||||
|
chan->GetURI(getter_AddRefs(uri));
|
||||||
|
|
||||||
|
if (mContentType.EqualsASCII(APPLICATION_OCTET_STREAM)) {
|
||||||
|
nsCAutoString extType;
|
||||||
|
if (IsPluginEnabledByExtension(uri, extType)) {
|
||||||
|
mContentType = extType;
|
||||||
|
chan->SetContentType(extType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Now find out what type the content is
|
// Now find out what type the content is
|
||||||
// UnloadContent will set our type to null; need to be sure to only set it to
|
// UnloadContent will set our type to null; need to be sure to only set it to
|
||||||
// the real value on success
|
// the real value on success
|
||||||
|
@ -430,8 +442,6 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest, nsISupports *aConte
|
||||||
contentPolicyType = nsIContentPolicy::TYPE_OBJECT;
|
contentPolicyType = nsIContentPolicy::TYPE_OBJECT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
nsCOMPtr<nsIURI> uri;
|
|
||||||
chan->GetURI(getter_AddRefs(uri));
|
|
||||||
nsCOMPtr<nsIContent> thisContent =
|
nsCOMPtr<nsIContent> thisContent =
|
||||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
||||||
NS_ASSERTION(thisContent, "must be a content");
|
NS_ASSERTION(thisContent, "must be a content");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче