RESOLVED FIXED 163944
IceCandidate does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=163944
Summary IceCandidate does not need to be refcounted
youenn fablet
Reported 2016-10-25 08:15:09 PDT
IceCandidate does not need to be refcounted
Attachments
Patch (33.73 KB, patch)
2016-10-25 08:38 PDT, youenn fablet
no flags
Patch (33.77 KB, patch)
2016-10-25 08:52 PDT, youenn fablet
no flags
Patch (34.34 KB, patch)
2016-10-26 03:31 PDT, youenn fablet
no flags
Fixing debug build (34.22 KB, patch)
2016-10-26 04:35 PDT, youenn fablet
no flags
Patch for landing (34.45 KB, patch)
2016-10-26 07:17 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2016-10-25 08:38:49 PDT
youenn fablet
Comment 2 2016-10-25 08:40:05 PDT
Comment on attachment 292755 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=292755&action=review > Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:689 > + targetMediaDescription->addIceCandidate(IceCandidate(result.candidate())); Can we do that now? > Source/WebCore/platform/mediastream/IceCandidate.h:44 > + int priority { 0 }; Should it be an unsigned/unsigned long instead?
youenn fablet
Comment 3 2016-10-25 08:40:50 PDT
Adam, do you know the answers for these? (In reply to comment #2) > Comment on attachment 292755 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=292755&action=review > > > Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:689 > > + targetMediaDescription->addIceCandidate(IceCandidate(result.candidate())); > > Can we do that now? > > > Source/WebCore/platform/mediastream/IceCandidate.h:44 > > + int priority { 0 }; > > Should it be an unsigned/unsigned long instead?
youenn fablet
Comment 4 2016-10-25 08:42:44 PDT
(In reply to comment #0) > IceCandidate does not need to be refcounted In general, I think all struct-like classes in platform/mediastream probably do not need to be refcounted and should be converted to struct. This might also allow removing some uncertainty about null pointers triggered by using RefPtr<>.
youenn fablet
Comment 5 2016-10-25 08:52:16 PDT
Adam Bergkvist
Comment 6 2016-10-25 23:46:50 PDT
(In reply to comment #3) > Adam, do you know the answers for these? > > (In reply to comment #2) > > Comment on attachment 292755 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=292755&action=review > > > > > Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:689 > > > + targetMediaDescription->addIceCandidate(IceCandidate(result.candidate())); > > > > Can we do that now? That should be safe. > > > Source/WebCore/platform/mediastream/IceCandidate.h:44 > > > + int priority { 0 }; > > > > Should it be an unsigned/unsigned long instead? Yes, it should be a positive integer. See [1]. [1] https://tools.ietf.org/html/rfc5245#section-4.1.2
youenn fablet
Comment 7 2016-10-26 03:31:21 PDT
youenn fablet
Comment 8 2016-10-26 04:35:43 PDT
Created attachment 292915 [details] Fixing debug build
Eric Carlson
Comment 9 2016-10-26 06:06:57 PDT
Comment on attachment 292915 [details] Fixing debug build View in context: https://bugs.webkit.org/attachment.cgi?id=292915&action=review > Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:852 > + SDPProcessor::Result result = m_sdpProcessor->generateCandidateLine(candidate, candidateLine); Nit: can you use "auto" here? > Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:862 > RefPtr<RTCIceCandidate> iceCandidate = RTCIceCandidate::create(candidateLine, mid, mediaDescriptionIndex); Ditto (as long as you are editing this method)
youenn fablet
Comment 10 2016-10-26 07:17:19 PDT
Created attachment 292926 [details] Patch for landing
WebKit Commit Bot
Comment 11 2016-10-26 07:52:38 PDT
Comment on attachment 292926 [details] Patch for landing Clearing flags on attachment: 292926 Committed r207897: <http://trac.webkit.org/changeset/207897>
WebKit Commit Bot
Comment 12 2016-10-26 07:52:41 PDT
All reviewed patches have been landed. Closing bug.
youenn fablet
Comment 13 2016-10-26 09:14:09 PDT
Thanks for the review. > > Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:852 > > + SDPProcessor::Result result = m_sdpProcessor->generateCandidateLine(candidate, candidateLine); > > Nit: can you use "auto" here? Done > > Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:862 > > RefPtr<RTCIceCandidate> iceCandidate = RTCIceCandidate::create(candidateLine, mid, mediaDescriptionIndex); > > Ditto (as long as you are editing this method) Done
Darin Adler
Comment 14 2016-10-26 17:23:52 PDT
Comment on attachment 292926 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=292926&action=review > Source/WebCore/platform/mediastream/IceCandidate.h:63 > + IceCandidate() = default; > + IceCandidate(String&& type, String&& foundation, unsigned componentId, String&& transport, unsigned long priority, String&& address, unsigned port, String&& tcpType, String&& relatedAddress, unsigned relatedPort) > + : type(WTFMove(type)) > + , foundation(WTFMove(foundation)) > + , componentId(componentId) > + , transport(WTFMove(transport)) > + , priority(priority) > + , address(WTFMove(address)) > + , port(port) > + , tcpType(WTFMove(tcpType)) > + , relatedAddress(WTFMove(relatedAddress)) > + , relatedPort(relatedPort) > + { } Can we leave out both of these? Aggregate initialization syntax with { } should work without either of these constructors.
youenn fablet
Comment 15 2016-10-26 22:43:18 PDT
(In reply to comment #14) > Comment on attachment 292926 [details] > Patch for landing > > View in context: > https://bugs.webkit.org/attachment.cgi?id=292926&action=review > > > Source/WebCore/platform/mediastream/IceCandidate.h:63 > > + IceCandidate() = default; > > + IceCandidate(String&& type, String&& foundation, unsigned componentId, String&& transport, unsigned long priority, String&& address, unsigned port, String&& tcpType, String&& relatedAddress, unsigned relatedPort) > > + : type(WTFMove(type)) > > + , foundation(WTFMove(foundation)) > > + , componentId(componentId) > > + , transport(WTFMove(transport)) > > + , priority(priority) > > + , address(WTFMove(address)) > > + , port(port) > > + , tcpType(WTFMove(tcpType)) > > + , relatedAddress(WTFMove(relatedAddress)) > > + , relatedPort(relatedPort) > > + { } > > Can we leave out both of these? Aggregate initialization syntax with { } > should work without either of these constructors. I had to add them to make GTK bot happy. Probably I should add a FIXME.
Note You need to log in before you can comment on or make changes to this bug.