Remove unnecessary target arguments from some event listener manager apis

RESOLVED FIXED in mozilla8

Status

()

Core
DOM: Events
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

Trunk
mozilla8
x86
Mac OS X
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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
Created attachment 549425 [details] [diff] [review]
Fix

Try run is http://tbpl.mozilla.org/?tree=Try&rev=b683e4a9e6bf and looks good
Attachment #549425 - Flags: review?(Olli.Pettay)

Comment 2

6 years ago
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]
http://hg.mozilla.org/integration/mozilla-inbound/rev/c5defc500925
Flags: in-testsuite-
Whiteboard: [need landing]
Target Milestone: --- → mozilla8
http://hg.mozilla.org/mozilla-central/rev/c5defc500925
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.