Bug 169709

Summary: Follow-up on comments for bug 169664
Product: WebKit Reporter: Jon Lee <jonlee>
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: alex, commit-queue, youennf
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=169664
Bug Depends on:    
Bug Blocks: 169662    
Attachments:
Description Flags
Patch
youennf: review+, youennf: commit-queue-
Patch for landing
none
Patch for landing none

Description Jon Lee 2017-03-15 15:43:33 PDT
From Youenn:
> Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:865
> +    Vector<RTCIceTransportState> transportStates;

I know this is untouched code.
Would you be able to use reserveInitialCapacity/uncheckedAppend

> Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:870
> +    m_peerConnection.updateIceConnectionState(static_cast<RTCIceConnectionState>(derivedState));

This looks bad, deriveAggregatedIceConnectionState should really be changed to return RTCIceConnectionState.
Comment 1 Jon Lee 2017-03-19 12:48:37 PDT
(In reply to comment #0)
> From Youenn:
> > Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:865
> > +    Vector<RTCIceTransportState> transportStates;
> 
> I know this is untouched code.
> Would you be able to use reserveInitialCapacity/uncheckedAppend
> 
> > Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:870
> > +    m_peerConnection.updateIceConnectionState(static_cast<RTCIceConnectionState>(derivedState));
> 
> This looks bad, deriveAggregatedIceConnectionState should really be changed
> to return RTCIceConnectionState.

I have a patch for this, but should MediaEndpointPeerConnection be part of the xcodeproj at all?
Comment 2 Jon Lee 2017-03-19 21:30:44 PDT
Created attachment 304913 [details]
Patch
Comment 3 youenn fablet 2017-03-20 08:24:59 PDT
Comment on attachment 304913 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=304913&action=review

> Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:879
> +    Vector<RTCIceTransportState> transportStates(m_peerConnection.getTransceivers().size());

Please use reserveInitialCapacity to preallocate without creating the objects.
Comment 4 Jon Lee 2017-03-20 14:59:46 PDT
Comment on attachment 304913 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=304913&action=review

>> Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:879
>> +    Vector<RTCIceTransportState> transportStates(m_peerConnection.getTransceivers().size());
> 
> Please use reserveInitialCapacity to preallocate without creating the objects.

Done.
Comment 5 Jon Lee 2017-03-20 15:01:50 PDT
Created attachment 304954 [details]
Patch for landing
Comment 6 Jon Lee 2017-03-20 19:10:11 PDT
Created attachment 304981 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2017-03-20 19:51:03 PDT
Comment on attachment 304981 [details]
Patch for landing

Clearing flags on attachment: 304981

Committed r214207: <http://trac.webkit.org/changeset/214207>