nsContentUtils::SendKeyEvent() should take nsIWidget* rather than nsCOMPtr<nsIWidget> at its first argument

RESOLVED FIXED in Firefox 41

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: masayuki, Assigned: masayuki)

Tracking

Trunk
mozilla41
Points:
---

Firefox Tracking Flags

(firefox41 fixed)

Details

Attachments

(1 attachment)

nsContentUtils::SendKeyEvent() is defined as:

> 2360   static nsresult SendKeyEvent(nsCOMPtr<nsIWidget> aWidget,
> 2361                                const nsAString& aType,
> 2362                                int32_t aKeyCode,
> 2363                                int32_t aCharCode,
> 2364                                int32_t aModifiers,
> 2365                                uint32_t aAdditionalFlags,
> 2366                                bool* aDefaultActionTaken);

However, this means that the caller needs to create a local variable of nsCOMPtr<nsIWidget> if the caller has a pointer to an nsIWidget derived class. So, it should be nsIWidget* for allowing to accept all nsIWidget derived classes.
Created attachment 8623627 [details] [diff] [review]
Patch
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Attachment #8623627 - Flags: review?(bugs)
Attachment #8623627 - Flags: review?(bugs) → review+
Out of interest, what about SendMouseEvent?
(In reply to neil@parkwaycc.co.uk from comment #3)
> Out of interest, what about SendMouseEvent?

I'm not sure. It takes nsCOMPtr<nsIPresShell>, but its concrete class is only PresShell and I don't see such code which holds with nsRefPtr. But if some callers making nsCOMPtr<nsIPresShell> from raw pointer (nsIPresShell*), we should do that too.
https://hg.mozilla.org/mozilla-central/rev/328551ccf9ee
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
status-firefox41: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.