Bug 180305

Summary: Make some minor adjustments to TouchBarMenuData and TouchBarMenuItemData
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: WebKit Misc.Assignee: Wenson Hsieh <wenson_hsieh>
Status: NEW ---    
Severity: Normal CC: aestes, commit-queue, darin, dbates, joepeck, thorton
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Merge in dbates' suggestions as well
joepeck: review+
Patch for landing
none
Minor additional tweak none

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>