Bug 605264: Stop content script from mucking around with nsHTMLMediaElement::Observe. r=jst a=b

This commit is contained in:
Kyle Huey 2011-02-12 13:04:15 -05:00
parent 5cacf25656
commit 029b5aaed4
3 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<script>
var v = document.createElementNS("http://www.w3.org/1999/xhtml", "video");
v.QueryInterface(Components.interfaces.nsIObserver);
v.observe(null, null, null);
</script>

View File

@ -21,6 +21,7 @@ load 590387.html
load 596785-1.html
load 596785-2.html
load 604807.html
load 605264.html
load 606430-1.html
load 602117.html
load 613027.html

View File

@ -2397,6 +2397,8 @@ void nsHTMLMediaElement::DoRemoveSelfReference()
nsresult nsHTMLMediaElement::Observe(nsISupports* aSubject,
const char* aTopic, const PRUnichar* aData)
{
NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE);
if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
mShuttingDown = PR_TRUE;
AddRemoveSelfReference();