WebKit Bugzilla
Attachment 340651 Details for
Bug 185555
: -Wmemset-elt-size warning in LibWebRTCSocket constructor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185555-20180517145017.patch (text/plain), 3.05 KB, created by
youenn fablet
on 2018-05-17 14:50:18 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2018-05-17 14:50:18 PDT
Size:
3.05 KB
patch
obsolete
>Subversion Revision: 231917 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index f996e971c73784d0c99f24262e4e83031a62e6de..46e9e6eeb67cd6e74df24c851cbdf71531c3f36b 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,22 @@ >+2018-05-17 Youenn Fablet <youenn@apple.com> >+ >+ -Wmemset-elt-size warning in LibWebRTCSocket constructor >+ https://bugs.webkit.org/show_bug.cgi?id=185555 >+ <rdar://problem/40217250> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ GetOption implementation was broken in that it was not initializing properly its array of options. >+ This patch fixes it by using an array of optional<int> which are initialized by default. >+ When no value is set, we return the error code -1. >+ In theory, we should go to NetworkProcess to get the actual value. >+ Since GetOption is not used in practice, we just do this best effort implementation of storing previously set values. >+ >+ * WebProcess/Network/webrtc/LibWebRTCSocket.cpp: >+ (WebKit::LibWebRTCSocket::LibWebRTCSocket): >+ (WebKit::LibWebRTCSocket::GetOption): >+ * WebProcess/Network/webrtc/LibWebRTCSocket.h: >+ > 2018-05-17 Carlos Alberto Lopez Perez <clopez@igalia.com> > > [WPE] Implement and enable FULLSCREEN_API >diff --git a/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp b/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp >index c3014537093c46421fa6ed899768d0a0a342e0a6..7d5d077844165e1996bdfa8d9152e7bd61704a14 100644 >--- a/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp >+++ b/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp >@@ -54,7 +54,6 @@ LibWebRTCSocket::LibWebRTCSocket(LibWebRTCSocketFactory& factory, uint64_t ident > , m_localAddress(localAddress) > , m_remoteAddress(remoteAddress) > { >- memset(&m_options, 1, MAX_SOCKET_OPTION); > } > > LibWebRTCSocket::~LibWebRTCSocket() >@@ -157,10 +156,11 @@ int LibWebRTCSocket::Close() > int LibWebRTCSocket::GetOption(rtc::Socket::Option option, int* value) > { > ASSERT(option < MAX_SOCKET_OPTION); >- int storedValue = m_options[option]; >- if (storedValue != -1) >- *value = m_options[option]; >- return 0; >+ if (auto storedValue = m_options[option]) { >+ *value = *storedValue; >+ return 0; >+ } >+ return -1; > } > > int LibWebRTCSocket::SetOption(rtc::Socket::Option option, int value) >diff --git a/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.h b/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.h >index 107ef947d1ec2e50ff995fe59c75feb6bdf4a4db..81c08b89b065141c66813381b65fc431b247ba10 100644 >--- a/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.h >+++ b/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.h >@@ -93,7 +93,7 @@ private: > State m_state { STATE_BINDING }; > > static const unsigned MAX_SOCKET_OPTION { rtc::Socket::OPT_RTP_SENDTIME_EXTN_ID + 1 }; >- int m_options[MAX_SOCKET_OPTION]; >+ std::optional<int> m_options[MAX_SOCKET_OPTION]; > > Deque<size_t> m_beingSentPacketSizes; > size_t m_availableSendingBytes { 65536 };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185555
:
340210
| 340651 |
340671