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