NEW 180305
Make some minor adjustments to TouchBarMenuData and TouchBarMenuItemData
https://bugs.webkit.org/show_bug.cgi?id=180305
Summary Make some minor adjustments to TouchBarMenuData and TouchBarMenuItemData
Wenson Hsieh
Reported 2017-12-01 20:49:50 PST
Followup to r225438.
Attachments
Patch (7.09 KB, patch)
2017-12-01 21:19 PST, Wenson Hsieh
no flags
Merge in dbates' suggestions as well (9.66 KB, patch)
2017-12-01 23:00 PST, Wenson Hsieh
joepeck: review+
Patch for landing (9.75 KB, patch)
2017-12-02 00:14 PST, Wenson Hsieh
no flags
Minor additional tweak (3.86 KB, patch)
2017-12-03 14:58 PST, Wenson Hsieh
no flags
Wenson Hsieh
Comment 1 2017-12-01 21:19:39 PST
Wenson Hsieh
Comment 2 2017-12-01 23:00:42 PST
Created attachment 328216 [details] Merge in dbates' suggestions as well
Joseph Pecoraro
Comment 3 2017-12-01 23:06:14 PST
Comment on attachment 328216 [details] Merge in dbates' suggestions as well View in context: https://bugs.webkit.org/attachment.cgi?id=328216&action=review r=me > Source/WebKit/ChangeLog:37 > + (WebKit::operator==): Heh, prepareChangeLog does the best it can do here. You could move this up above your comment on line 34-35 though, it is the TouchBarMenuItemData's operator== > Source/WebKit/Shared/TouchBarMenuItemData.cpp:36 > +static ItemType getItemType(const String&) The parameter is unused right now, but we plan on using it? Otherwise we could just inline this and avoid the attributeWithotuSynchronization for the `typeAttr` below. > Source/WebKit/Shared/TouchBarMenuItemData.h:54 > bool validTouchBarDisplay { true }; You can put the boolean at the bottom of the list of members to potentially avoid unnecessary padding bytes in the struct.
Wenson Hsieh
Comment 4 2017-12-01 23:12:17 PST
Comment on attachment 328216 [details] Merge in dbates' suggestions as well View in context: https://bugs.webkit.org/attachment.cgi?id=328216&action=review Thanks for the review! >> Source/WebKit/ChangeLog:37 >> + (WebKit::operator==): > > Heh, prepareChangeLog does the best it can do here. You could move this up above your comment on line 34-35 though, it is the TouchBarMenuItemData's operator== Done! >> Source/WebKit/Shared/TouchBarMenuItemData.cpp:36 >> +static ItemType getItemType(const String&) > > The parameter is unused right now, but we plan on using it? Otherwise we could just inline this and avoid the attributeWithotuSynchronization for the `typeAttr` below. Yes, we do plan on using it when we introduce more item types (the intent is that we can grow this function as we add richer support). >> Source/WebKit/Shared/TouchBarMenuItemData.h:54 >> bool validTouchBarDisplay { true }; > > You can put the boolean at the bottom of the list of members to potentially avoid unnecessary padding bytes in the struct. Good catch!
Wenson Hsieh
Comment 5 2017-12-02 00:14:37 PST
Created attachment 328220 [details] Patch for landing
WebKit Commit Bot
Comment 6 2017-12-02 00:47:26 PST
Comment on attachment 328220 [details] Patch for landing Clearing flags on attachment: 328220 Committed r225446: <https://trac.webkit.org/changeset/225446>
Darin Adler
Comment 7 2017-12-03 14:16:56 PST
Comment on attachment 328216 [details] Merge in dbates' suggestions as well View in context: https://bugs.webkit.org/attachment.cgi?id=328216&action=review >>> Source/WebKit/Shared/TouchBarMenuItemData.cpp:36 >>> +static ItemType getItemType(const String&) >> >> The parameter is unused right now, but we plan on using it? Otherwise we could just inline this and avoid the attributeWithotuSynchronization for the `typeAttr` below. > > Yes, we do plan on using it when we introduce more item types (the intent is that we can grow this function as we add richer support). WebKit coding style says this function should not have the word "get" in its name.
Wenson Hsieh
Comment 8 2017-12-03 14:55:59 PST
(In reply to Darin Adler from comment #7) > Comment on attachment 328216 [details] > Merge in dbates' suggestions as well > > View in context: > https://bugs.webkit.org/attachment.cgi?id=328216&action=review > > >>> Source/WebKit/Shared/TouchBarMenuItemData.cpp:36 > >>> +static ItemType getItemType(const String&) > >> > >> The parameter is unused right now, but we plan on using it? Otherwise we could just inline this and avoid the attributeWithotuSynchronization for the `typeAttr` below. > > > > Yes, we do plan on using it when we introduce more item types (the intent is that we can grow this function as we add richer support). > > WebKit coding style says this function should not have the word "get" in its > name. Good point! Patch forthcoming.
Wenson Hsieh
Comment 9 2017-12-03 14:58:13 PST
Created attachment 328309 [details] Minor additional tweak
WebKit Commit Bot
Comment 10 2017-12-04 16:13:12 PST
Comment on attachment 328309 [details] Minor additional tweak Clearing flags on attachment: 328309 Committed r225505: <https://trac.webkit.org/changeset/225505>
Note You need to log in before you can comment on or make changes to this bug.