Changeset 225505 in webkit


Ignore:
Timestamp:
Dec 4, 2017 4:13:09 PM (6 years ago)
Author:
Wenson Hsieh
Message:

Rename a static helper in TouchBarMenuItemData.cpp to match style guidelines.
https://bugs.webkit.org/show_bug.cgi?id=180305

Reviewed by Andy Estes.

Style guidelines state that we should use bare words for getters, so getItemType should just be
itemType. Since this collides with the itemType member variable, this patch also renames that
member variable to the more concise "type".

No change in behavior.

  • Shared/TouchBarMenuItemData.cpp:

(WebKit::itemType):
(WebKit::TouchBarMenuItemData::TouchBarMenuItemData):
(WebKit::TouchBarMenuItemData::encode const):
(WebKit::TouchBarMenuItemData::decode):
(WebKit::getItemType): Deleted.

  • Shared/TouchBarMenuItemData.h:

(WebKit::operator==):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r225501 r225505  
     12017-12-04  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Rename a static helper in TouchBarMenuItemData.cpp to match style guidelines.
     4        https://bugs.webkit.org/show_bug.cgi?id=180305
     5
     6        Reviewed by Andy Estes.
     7
     8        Style guidelines state that we should use bare words for getters, so getItemType should just be
     9        itemType. Since this collides with the itemType member variable, this patch also renames that
     10        member variable to the more concise "type".
     11
     12        No change in behavior.
     13
     14        * Shared/TouchBarMenuItemData.cpp:
     15        (WebKit::itemType):
     16        (WebKit::TouchBarMenuItemData::TouchBarMenuItemData):
     17        (WebKit::TouchBarMenuItemData::encode const):
     18        (WebKit::TouchBarMenuItemData::decode):
     19        (WebKit::getItemType): Deleted.
     20        * Shared/TouchBarMenuItemData.h:
     21        (WebKit::operator==):
     22
    1232017-12-04  Brian Burg  <bburg@apple.com>
    224
  • trunk/Source/WebKit/Shared/TouchBarMenuItemData.cpp

    r225446 r225505  
    3434namespace WebKit {
    3535
    36 static ItemType getItemType(const String&)
     36static ItemType itemType(const String&)
    3737{
    3838    return ItemType::Button;
     
    4141TouchBarMenuItemData::TouchBarMenuItemData(const WebCore::HTMLMenuItemElement& element)
    4242{
    43     itemType = getItemType(element.attributeWithoutSynchronization(WebCore::HTMLNames::typeAttr));
     43    type = itemType(element.attributeWithoutSynchronization(WebCore::HTMLNames::typeAttr));
    4444    identifier = element.attributeWithoutSynchronization(WebCore::HTMLNames::idAttr);
    4545    priority = element.attributeWithoutSynchronization(WebCore::HTMLNames::valueAttr).toFloat();
     
    4848void TouchBarMenuItemData::encode(IPC::Encoder& encoder) const
    4949{
    50     encoder.encodeEnum(itemType);
     50    encoder.encodeEnum(type);
    5151   
    5252    encoder << identifier;
     
    5757{
    5858    TouchBarMenuItemData result;
    59     if (!decoder.decodeEnum(result.itemType))
     59    if (!decoder.decodeEnum(result.type))
    6060        return std::nullopt;
    6161   
  • trunk/Source/WebKit/Shared/TouchBarMenuItemData.h

    r225446 r225505  
    5252    static std::optional<TouchBarMenuItemData> decode(IPC::Decoder&);
    5353   
    54     ItemType itemType { ItemType::Button };
     54    ItemType type { ItemType::Button };
    5555    String identifier;
    5656    float priority { 0.0 };
     
    8181inline bool operator==(const TouchBarMenuItemData& lhs, const TouchBarMenuItemData& rhs)
    8282{
    83     return lhs.itemType == rhs.itemType
    84     && lhs.identifier == rhs.identifier
    85     && lhs.priority == rhs.priority;
     83    return lhs.type == rhs.type
     84        && lhs.identifier == rhs.identifier
     85        && lhs.priority == rhs.priority;
    8686}
    8787
Note: See TracChangeset for help on using the changeset viewer.