Bug 180305 - Make some minor adjustments to TouchBarMenuData and TouchBarMenuItemData
Summary: Make some minor adjustments to TouchBarMenuData and TouchBarMenuItemData
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-01 20:49 PST by Wenson Hsieh
Modified: 2017-12-04 16:13 PST (History)
6 users (show)

See Also:


Attachments
Patch (7.09 KB, patch)
2017-12-01 21:19 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Merge in dbates' suggestions as well (9.66 KB, patch)
2017-12-01 23:00 PST, Wenson Hsieh
joepeck: review+
Details | Formatted Diff | Diff
Patch for landing (9.75 KB, patch)
2017-12-02 00:14 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Minor additional tweak (3.86 KB, patch)
2017-12-03 14:58 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2017-12-01 20:49:50 PST
Followup to r225438.
Comment 1 Wenson Hsieh 2017-12-01 21:19:39 PST
Created attachment 328209 [details]
Patch
Comment 2 Wenson Hsieh 2017-12-01 23:00:42 PST
Created attachment 328216 [details]
Merge in dbates' suggestions as well
Comment 3 Joseph Pecoraro 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.
Comment 4 Wenson Hsieh 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!
Comment 5 Wenson Hsieh 2017-12-02 00:14:37 PST
Created attachment 328220 [details]
Patch for landing
Comment 6 WebKit Commit Bot 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>
Comment 7 Darin Adler 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.
Comment 8 Wenson Hsieh 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.
Comment 9 Wenson Hsieh 2017-12-03 14:58:13 PST
Created attachment 328309 [details]
Minor additional tweak
Comment 10 WebKit Commit Bot 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>