<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebRTC: Add RTCRtpTransceiver interface and RTCPeerConnection.addTransceiver()"
   href="https://bugs.webkit.org/show_bug.cgi?id=158189">bug 158189</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #280145 Flags</td>
           <td>review?
           </td>
           <td>review+
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebRTC: Add RTCRtpTransceiver interface and RTCPeerConnection.addTransceiver()"
   href="https://bugs.webkit.org/show_bug.cgi?id=158189#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebRTC: Add RTCRtpTransceiver interface and RTCPeerConnection.addTransceiver()"
   href="https://bugs.webkit.org/show_bug.cgi?id=158189">bug 158189</a>
              from <span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=280145&amp;action=diff" name="attach_280145" title="Updated patch">attachment 280145</a> <a href="attachment.cgi?id=280145&amp;action=edit" title="Updated patch">[details]</a></span>
Updated patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=280145&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=280145&amp;action=review</a>

<span class="quote">&gt; Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp:195
&gt; +    transceiver-&gt;setDirection(static_cast&lt;RTCRtpTransceiver::Direction&gt;(init.direction));</span >

This typecast should not be needed. It’s currently only needed because we are defining the enum twice (see my other comments).

<span class="quote">&gt; Source/WebCore/Modules/mediastream/RTCPeerConnection.h:67
&gt;      Vector&lt;RefPtr&lt;RTCRtpSender&gt;&gt; getSenders() const override { return m_senderSet; }
&gt;      Vector&lt;RefPtr&lt;RTCRtpReceiver&gt;&gt; getReceivers() const { return m_receiverSet; }</span >

It’s expensive to have functions that return an existing Vector by copying it. We should not do that unless we have to.

<span class="quote">&gt; Source/WebCore/Modules/mediastream/RTCPeerConnection.h:78
&gt; +    enum class RtpTransceiverDirection {
&gt; +        Sendrecv,
&gt; +        Sendonly,
&gt; +        Recvonly,
&gt; +        Inactive
&gt; +    };</span >

Instead of re-defining this here, we should write this:

    using RtpTransceiverDirection = RTCRtpTransceiver::Direction;

<span class="quote">&gt; Source/WebCore/Modules/mediastream/RTCPeerConnection.h:82
&gt; +    struct RtpTransceiverInit {
&gt; +        RtpTransceiverDirection direction;
&gt; +    };</span >

Eventually, we probably also want to define this in RTCRtpTransceiver and use &quot;using&quot; to pull it in here with the appropriate name.

<span class="quote">&gt; Source/WebCore/Modules/mediastream/RTCPeerConnection.idl:125
&gt; +enum RTCRtpTransceiverDirection {
&gt; +    &quot;sendrecv&quot;,
&gt; +    &quot;sendonly&quot;,
&gt; +    &quot;recvonly&quot;,
&gt; +    &quot;inactive&quot;
&gt; +};</span >

Eventually we will make the bindings script smarter so we don’t have to repeat this in multiple IDL files. In the mean time we might want to comment so anyone modifying one knows they should modify the other.

<span class="quote">&gt; Source/WebCore/Modules/mediastream/RTCRtpSender.h:60
&gt; +    bool isStopped() const { return m_client == nullptr; }</span >

WebKit coding style says we write this !m_client rather than m_client == nullptr.

<span class="quote">&gt; Source/WebCore/Modules/mediastream/RTCRtpTransceiver.cpp:80
&gt; +    return emptyString();</span >

Maybe return inactiveString() here instead of emptyString()?

<span class="quote">&gt; Source/WebCore/Modules/mediastream/RTCRtpTransceiver.h:52
&gt; +    enum class Direction {
&gt; +        Sendrecv,
&gt; +        Sendonly,
&gt; +        Recvonly,
&gt; +        Inactive
&gt; +    };</span >

I find short enumerations like this really nice when writing out all on one line.

<span class="quote">&gt; Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp:50
&gt; +    Ref&lt;MockRealtimeAudioSource&gt; source = adoptRef(*new MockRealtimeAudioSource(name));</span >

I think auto works better here than writing the type a second time. I’d also omit the empty line below.

<span class="quote">&gt; Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp:59
&gt; +    Ref&lt;MockRealtimeVideoSource&gt; source = adoptRef(*new MockRealtimeVideoSource(name));</span >

I think auto works better here than writing the type a second time. I’d also omit the empty line below.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>