Closed Bug 787393 Opened 12 years ago Closed 12 years ago

nsEventSource::Observe code is wrong

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 740862

People

(Reporter: ayg, Unassigned)

References

Details

(In reply to Boris Zbarsky (:bz) from bug 782594 comment #21) > The event source code is totally bogus. I can only assume no one tried > actually exercising it. Please file a bug on it! > > Morph() only returns errors or NS_OK, so that part is fine. > > r=me, but please get that bug on the event source stuff filed. And maybe cc > whoever wrote/reviewed that code? The code of interest: if (strcmp(aTopic, DOM_WINDOW_FROZEN_TOPIC) == 0) { rv = Freeze(); NS_ASSERTION(rv, "Freeze() failed"); } else if (strcmp(aTopic, DOM_WINDOW_THAWED_TOPIC) == 0) { rv = Thaw(); NS_ASSERTION(rv, "Thaw() failed"); } else if (strcmp(aTopic, DOM_WINDOW_DESTROYED_TOPIC) == 0) { Close(); } Bug 338583 is what added the code. CCing author and reviewers.
bz, I assume you meant NS_ASSERTION(rv, ) is wrong? Or something else?
Yes. That's asserting that Thaw() returned a non-NS_OK result! Which means that in practice any time this code runs, it will assert, right?
You need just apply this patch, already reviewed: https://bugzilla.mozilla.org/show_bug.cgi?id=740862
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.