RESOLVED FIXED 194232
Use constants for pointer types
https://bugs.webkit.org/show_bug.cgi?id=194232
Summary Use constants for pointer types
Antoine Quint
Reported 2019-02-04 11:32:49 PST
Use constants for pointer types
Attachments
Patch (3.20 KB, patch)
2019-02-04 11:34 PST, Antoine Quint
no flags
Patch (4.00 KB, patch)
2019-02-04 14:21 PST, Antoine Quint
no flags
Patch for landing (4.00 KB, patch)
2019-02-04 14:25 PST, Antoine Quint
graouts: commit-queue+
Antoine Quint
Comment 1 2019-02-04 11:34:22 PST
Sam Weinig
Comment 2 2019-02-04 13:49:58 PST
Comment on attachment 361077 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=361077&action=review > Source/WebCore/dom/PointerEvent.h:90 > + static const String& mousePointerType() { static NeverDestroyed<const String> mouse(MAKE_STATIC_STRING_IMPL("mouse")); return mouse; } > + static const String& penPointerType() { static NeverDestroyed<const String> pen(MAKE_STATIC_STRING_IMPL("pen")); return pen; } > + static const String& touchPointerType() { static NeverDestroyed<const String> touch(MAKE_STATIC_STRING_IMPL("touch")); return touch; } Generally we put static NeverDestroyed variables like this in the cpp file so that we only end up with one (otherwise you get one per cpp that includes this header).
Antoine Quint
Comment 3 2019-02-04 14:21:57 PST
Antoine Quint
Comment 4 2019-02-04 14:25:45 PST
Created attachment 361100 [details] Patch for landing
Antoine Quint
Comment 5 2019-02-04 14:28:49 PST
Radar WebKit Bug Importer
Comment 6 2019-02-04 14:30:13 PST
Note You need to log in before you can comment on or make changes to this bug.