Changeset 225505 in webkit
- Timestamp:
- Dec 4, 2017 4:13:09 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r225501 r225505 1 2017-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 1 23 2017-12-04 Brian Burg <bburg@apple.com> 2 24 -
trunk/Source/WebKit/Shared/TouchBarMenuItemData.cpp
r225446 r225505 34 34 namespace WebKit { 35 35 36 static ItemType getItemType(const String&)36 static ItemType itemType(const String&) 37 37 { 38 38 return ItemType::Button; … … 41 41 TouchBarMenuItemData::TouchBarMenuItemData(const WebCore::HTMLMenuItemElement& element) 42 42 { 43 itemType = getItemType(element.attributeWithoutSynchronization(WebCore::HTMLNames::typeAttr));43 type = itemType(element.attributeWithoutSynchronization(WebCore::HTMLNames::typeAttr)); 44 44 identifier = element.attributeWithoutSynchronization(WebCore::HTMLNames::idAttr); 45 45 priority = element.attributeWithoutSynchronization(WebCore::HTMLNames::valueAttr).toFloat(); … … 48 48 void TouchBarMenuItemData::encode(IPC::Encoder& encoder) const 49 49 { 50 encoder.encodeEnum( itemType);50 encoder.encodeEnum(type); 51 51 52 52 encoder << identifier; … … 57 57 { 58 58 TouchBarMenuItemData result; 59 if (!decoder.decodeEnum(result. itemType))59 if (!decoder.decodeEnum(result.type)) 60 60 return std::nullopt; 61 61 -
trunk/Source/WebKit/Shared/TouchBarMenuItemData.h
r225446 r225505 52 52 static std::optional<TouchBarMenuItemData> decode(IPC::Decoder&); 53 53 54 ItemType itemType { ItemType::Button };54 ItemType type { ItemType::Button }; 55 55 String identifier; 56 56 float priority { 0.0 }; … … 81 81 inline bool operator==(const TouchBarMenuItemData& lhs, const TouchBarMenuItemData& rhs) 82 82 { 83 return lhs. itemType == rhs.itemType84 && lhs.identifier == rhs.identifier85 && lhs.priority == rhs.priority;83 return lhs.type == rhs.type 84 && lhs.identifier == rhs.identifier 85 && lhs.priority == rhs.priority; 86 86 } 87 87
Note: See TracChangeset
for help on using the changeset viewer.