Use QI for type-safety check in StopMediaInstance/StartMediaInstance. r=chris.double sr=roc

This commit is contained in:
Daniel Holbert 2008-12-04 05:08:39 -08:00
Родитель 98b2a31dfa
Коммит 15dac51c42
1 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -6080,8 +6080,12 @@ StopPluginInstance(PresShell *aShell, nsIContent *aContent)
static void
StopMediaInstance(PresShell *aShell, nsIContent *aContent)
{
nsHTMLMediaElement* element = static_cast<nsHTMLMediaElement*>(aContent);
element->Freeze();
nsCOMPtr<nsIDOMHTMLMediaElement> domMediaElem(do_QueryInterface(aContent));
if (!domMediaElem)
return;
nsHTMLMediaElement* mediaElem = static_cast<nsHTMLMediaElement*>(aContent);
mediaElem->Freeze();
}
#endif
@ -6133,8 +6137,12 @@ StartPluginInstance(PresShell *aShell, nsIContent *aContent)
static void
StartMediaInstance(PresShell *aShell, nsIContent *aContent)
{
nsHTMLMediaElement* element = static_cast<nsHTMLMediaElement*>(aContent);
element->Thaw();
nsCOMPtr<nsIDOMHTMLMediaElement> domMediaElem(do_QueryInterface(aContent));
if (!domMediaElem)
return;
nsHTMLMediaElement* mediaElem = static_cast<nsHTMLMediaElement*>(aContent);
mediaElem->Thaw();
}
#endif