Changeset 231956 in webkit
- Timestamp:
- May 18, 2018 9:08:09 AM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r231948 r231956 1 2018-05-18 Youenn Fablet <youenn@apple.com> 2 3 -Wmemset-elt-size warning in LibWebRTCSocket constructor 4 https://bugs.webkit.org/show_bug.cgi?id=185555 5 <rdar://problem/40217250> 6 7 Reviewed by Darin Adler. 8 9 GetOption implementation was broken in that it was not initializing properly its array of options. 10 This patch fixes it by using an array of optional<int> which are initialized by default. 11 When no value is set, we return the error code -1. 12 In theory, we should go to NetworkProcess to get the actual value. 13 Since GetOption is not used in practice, we just do this best effort implementation of storing previously set values. 14 15 * WebProcess/Network/webrtc/LibWebRTCSocket.cpp: 16 (WebKit::LibWebRTCSocket::LibWebRTCSocket): 17 (WebKit::LibWebRTCSocket::GetOption): 18 * WebProcess/Network/webrtc/LibWebRTCSocket.h: 19 1 20 2018-05-18 Antoine Quint <graouts@apple.com> 2 21 -
trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp
r231781 r231956 55 55 , m_remoteAddress(remoteAddress) 56 56 { 57 memset(&m_options, 1, MAX_SOCKET_OPTION);58 57 } 59 58 … … 158 157 { 159 158 ASSERT(option < MAX_SOCKET_OPTION); 160 int storedValue = m_options[option]; 161 if (storedValue != -1) 162 *value = m_options[option]; 163 return 0; 159 if (auto storedValue = m_options[option]) { 160 *value = *storedValue; 161 return 0; 162 } 163 return -1; 164 164 } 165 165 -
trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.h
r229378 r231956 94 94 95 95 static const unsigned MAX_SOCKET_OPTION { rtc::Socket::OPT_RTP_SENDTIME_EXTN_ID + 1 }; 96 intm_options[MAX_SOCKET_OPTION];96 std::optional<int> m_options[MAX_SOCKET_OPTION]; 97 97 98 98 Deque<size_t> m_beingSentPacketSizes;
Note: See TracChangeset
for help on using the changeset viewer.