Closed Bug 675267 Opened 14 years ago Closed 14 years ago

Remove unnecessary target arguments from some event listener manager apis

Categories

(Core :: DOM: Events, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla8

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

As far as I can tell, all the callers pass exactly what we have in mTarget.
Summary: Remove unnecessary target attributes from some event listener manager apis → Remove unnecessary target arguments from some event listener manager apis
Attached patch FixSplinter Review
Attachment #549425 - Flags: review?(Olli.Pettay)
Comment on attachment 549425 [details] [diff] [review] Fix > if (document && > (win = document->GetInnerWindow()) && win->IsInnerWindow()) { > nsCOMPtr<nsIDOMEventTarget> piTarget(do_QueryInterface(win)); >- NS_ENSURE_TRUE(piTarget, NS_ERROR_FAILURE); >- >- *aManager = piTarget->GetListenerManager(PR_TRUE); >- >- if (*aManager) { >- NS_ADDREF(*aTarget = win); >- NS_ADDREF(*aManager); >- } >- *aDefer = PR_FALSE; >- } else { >- *aManager = nsnull; >- *aTarget = nsnull; >- *aDefer = PR_FALSE; >+ NS_ENSURE_TRUE(piTarget, nsnull); You could just drop NS_ENSURE_TRUE. If nsPIDOMWindow doesn't implement nsIDOMEventTarget, something is badly wrong and it is ok to crash, IMO.
Attachment #549425 - Flags: review?(Olli.Pettay) → review+
Done.
Whiteboard: [need landing]
Flags: in-testsuite-
Whiteboard: [need landing]
Target Milestone: --- → mozilla8
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: