Closed Bug 1204439 Opened 9 years ago Closed 9 years ago

mozilla::EventMessage shouldn't be defined with specific values

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(3 files)

By the fix of bug 895274, we made the event message values a named enum, mozilla::EventMessage. Therefore, gcc and VC can show the value of event message with the enum item names. So, we don't need to specify each value with "e*EventFirst".

However, I'm not sure the behavior of debugger of Xcode. Steven, do you use the debugger of Xcode? Do you know if the enum value is shown as enum item name instead of integer value? If Xcode just shows the value with integer value, perhaps, we shouldn't do this now.
Flags: needinfo?(smichaud)
> Steven, do you use the debugger of Xcode?

No, I don't.  And I don't know anybody who does :-(

As I understand it, XCode's "debugger" is just a wrapper around gdb (OS X 10.8.X and below) or lldb (OS X 10.9.X and above).  But we really should get an XCode user to check its behavior.  I'll ask in the #macdev chat room.  And if that doesn't work (which it probably won't), you might want to ask the dev.mozilla.platform for XCode debugger users to look at this bug.
Flags: needinfo?(smichaud)
Thank you, Steven. I confirmed that both lldb and Xcode shows the enum item name when I print the variable value. So, we don't have any problem to fix this bug.
Status: NEW → ASSIGNED
Preparation for the next patch. We should define e*EventFirst and e*EventLast with other macro since they are not actual event messages nor cannot available as case label of switch statement.
Attachment #8661713 - Flags: review?(bugs)
Let's remove the second argument of NS_EVENT_MESSAGE(). Then, the values are defined automatically. And the First and Last message should be defined with specified message.
Attachment #8661717 - Flags: review?(bugs)
Logging code should share a method to convert EventMessage to its name. And somebody may need this method at debugging with printf or something. We should generate it with the EventMessageList.h.
Attachment #8661721 - Flags: review?(bugs)
Attachment #8661713 - Flags: review?(bugs) → review+
Attachment #8661717 - Flags: review?(bugs) → review+
Comment on attachment 8661721 [details] [diff] [review]
part.3 Create methods to get enum item name

nice. This is what I've needed quite often, though now we have also sane
mMessage values.
Attachment #8661721 - Flags: review?(bugs) → review+
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.