Summary: | Flatten RTC enum naming | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Jon Lee <jonlee> | ||||||||
Component: | WebKit Misc. | Assignee: | Jon Lee <jonlee> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | webkit-bug-importer, youennf | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=169709 | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 169662 | ||||||||||
Attachments: |
|
Description
Jon Lee
2017-03-15 00:17:07 PDT
Created attachment 304486 [details]
Patch
Patch is built on top of 169660. Comment on attachment 304486 [details] Patch LGTM! Some comments below. Will r+ once rebased. View in context: https://bugs.webkit.org/attachment.cgi?id=304486&action=review > Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:333 > + if (m_peerConnection.signalingState() == RTCSignalingState::Closed) Nice! > Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:821 > + case RTCIceTransportState::New: ++newCount; break; This does not match WebKit style. > 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. > Source/WebCore/Modules/mediastream/RTCConfiguration.idl:29 > + ImplementedAs=RTCIceTransportPolicy Out of curiosity why do you need to add ImplementedAs? Is it because otherwise it would be named RTCConfiguration::RTCIceTransportPolicy? > Source/WebCore/Modules/mediastream/RTCConfiguration.idl:39 > +] enum RTCBundlePolicy { Given the direction, I guess we should put RTCBundlePolicy and RTCIceTransportPolicy enum class definitions in RTCConfiguration.h It is not very clear why this enum does not have its own IDL file and others will. I guess it is ok anyway. > Source/WebCore/Modules/mediastream/RTCIceConnectionState.h:28 > +#include "PeerConnectionStates.h" That seems a bit strange, could we not move connection state enum here and include this file in PeerConnectionStates.h? Ditto for the other files. Comment on attachment 304486 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=304486&action=review >> Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:821 >> + case RTCIceTransportState::New: ++newCount; break; > > This does not match WebKit style. I can split these out into separate lines. >> Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:865 >> + Vector<RTCIceTransportState> transportStates; > > I know this is untouched code. > Would you be able to use reserveInitialCapacity/uncheckedAppend I prefer not doing fly-by fixes in these kinds of patches; it'll be confusing during blaming. >> 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. Ditto. >> Source/WebCore/Modules/mediastream/RTCConfiguration.idl:29 >> + ImplementedAs=RTCIceTransportPolicy > > Out of curiosity why do you need to add ImplementedAs? Is it because otherwise it would be named RTCConfiguration::RTCIceTransportPolicy? Then it is generated as RTCIceTransportPolicy rather than RTCConfiguration::IceTransportPolicy (the script removes common prefixes). >> Source/WebCore/Modules/mediastream/RTCConfiguration.idl:39 >> +] enum RTCBundlePolicy { > > Given the direction, I guess we should put RTCBundlePolicy and RTCIceTransportPolicy enum class definitions in RTCConfiguration.h > It is not very clear why this enum does not have its own IDL file and others will. I guess it is ok anyway. I include enums in the same file as the main IDL definition if they are not used elsewhere in the spec. If they are used in multiple places, then the enum has to be declared separately. >> Source/WebCore/Modules/mediastream/RTCIceConnectionState.h:28 >> +#include "PeerConnectionStates.h" > > That seems a bit strange, could we not move connection state enum here and include this file in PeerConnectionStates.h? > Ditto for the other files. This would be a layering violation, no? Created attachment 304538 [details]
Patch
Created attachment 304558 [details]
Patch
(In reply to comment #3) > > > > 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. > For these two comments, filed bug 169709. > > I know this is untouched code. > > Would you be able to use reserveInitialCapacity/uncheckedAppend > > I prefer not doing fly-by fixes in these kinds of patches; it'll be > confusing during blaming. This kind of refactoring is usual, like doing Ref/RefPtr things. > >> 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. > > Ditto. Put a FIXME then? Committed r214030: <http://trac.webkit.org/changeset/214030> |