Closed Bug 675267 Opened 13 years ago Closed 13 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
Try run is http://tbpl.mozilla.org/?tree=Try&rev=b683e4a9e6bf and looks good
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]
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
Closed: 13 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: