<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebRTC: Implement MediaEndpointPeerConnection::createOffer()"
   href="https://bugs.webkit.org/show_bug.cgi?id=154867#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebRTC: Implement MediaEndpointPeerConnection::createOffer()"
   href="https://bugs.webkit.org/show_bug.cgi?id=154867">bug 154867</a>
              from <span class="vcard"><a class="email" href="mailto:eric.carlson&#64;apple.com" title="Eric Carlson &lt;eric.carlson&#64;apple.com&gt;"> <span class="fn">Eric Carlson</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=272580&amp;action=diff" name="attach_272580" title="Proposed patch">attachment 272580</a> <a href="attachment.cgi?id=272580&amp;action=edit" title="Proposed patch">[details]</a></span>
Proposed patch

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

<span class="quote">&gt; LayoutTests/fast/mediastream/RTCPeerConnection-inspect-offer.html:19
&gt; +                debug(&quot;This test can not be run without the testRunner&quot;);
&gt; +                finishJSTest();</span >

Nit: add this might as well return to avoid a bunch of script errors

<span class="quote">&gt; LayoutTests/fast/mediastream/RTCPeerConnection-inspect-offer.html:76
&gt; +                    var mline;
&gt; +
&gt; +                    if (mline = match(line, regexp.mline)) {</span >

Nit: this local variable isn't used.

<span class="quote">&gt; LayoutTests/fast/mediastream/RTCPeerConnection-inspect-offer.html:82
&gt; +                        var msidsemantic;</span >

Ditto.

<span class="quote">&gt; Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:61
&gt; +    static Ref&lt;WrappedSessionDescriptionPromise&gt; create(SessionDescriptionPromise&amp;&amp; promise)
&gt; +    {</span >

Nit: this brace should be on the previous line.

<span class="quote">&gt; Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp:158
&gt; +        mediaDescription-&gt;setMediaStreamId(sender-&gt;mediaStreamIds()[0]);
&gt; +        mediaDescription-&gt;setMediaStreamTrackId(track-&gt;id());
&gt; +        mediaDescription-&gt;setType(track-&gt;kind());
&gt; +        mediaDescription-&gt;setPort(9);
&gt; +        mediaDescription-&gt;setAddress(&quot;0.0.0.0&quot;);
&gt; +        mediaDescription-&gt;setMode(&quot;sendrecv&quot;);
&gt; +        mediaDescription-&gt;setPayloads(track-&gt;kind() == &quot;audio&quot; ? m_defaultAudioPayloads : m_defaultVideoPayloads);
&gt; +        mediaDescription-&gt;setRtcpMux(true);
&gt; +        mediaDescription-&gt;setDtlsSetup(&quot;actpass&quot;);
&gt; +        mediaDescription-&gt;setDtlsFingerprintHashFunction(m_dtlsFingerprintFunction);
&gt; +        mediaDescription-&gt;setDtlsFingerprint(m_dtlsFingerprint);
&gt; +        mediaDescription-&gt;setCname(m_cname);
&gt; +        mediaDescription-&gt;addSsrc(cryptographicallyRandomNumber());
&gt; +        mediaDescription-&gt;setIceUfrag(m_iceUfrag);
&gt; +        mediaDescription-&gt;setIcePassword(m_icePassword);</span >

Nit: This is a lot of setup Might it make sense to add a PeerMediaDescription constructor that takes a MediaStreamTrack (or maybe RtpSender)? If &quot;0.0.0.0&quot; the default address, can you set it in the constructor?

<span class="quote">&gt; Source/WebCore/Modules/mediastream/SDPProcessor.cpp:384
&gt; +    if (!callScript(&quot;generate&quot;, configurationToJSON(configuration), sdpString))
&gt; +        return Result::InternalError;</span >

Nit: It could be helpful to log this error.

<span class="quote">&gt; Source/WebCore/Modules/mediastream/SDPProcessor.cpp:401
&gt; +    if (!callScript(&quot;parse&quot;, sdp, scriptOutput))
&gt; +        return Result::InternalError;
&gt; +
&gt; +    if (scriptOutput == &quot;ParseError&quot;)
&gt; +        return Result::ParseError;
&gt; +
&gt; +    RefPtr&lt;MediaEndpointSessionConfiguration&gt; configuration = configurationFromJSON(scriptOutput);
&gt; +    if (!configuration)
&gt; +        return Result::InternalError;</span >

Ditto.

<span class="quote">&gt; Source/WebCore/Modules/mediastream/SDPProcessor.cpp:411
&gt; +    if (!callScript(&quot;generateCandidateLine&quot;, iceCandidateToJSON(candidate), candidateLine))
&gt; +        return Result::InternalError;</span >

Ditto.

<span class="quote">&gt; Source/WebCore/Modules/mediastream/SDPProcessor.cpp:428
&gt; +    if (!callScript(&quot;parseCandidateLine&quot;, candidateLine, scriptOutput))
&gt; +        return Result::InternalError;
&gt; +
&gt; +    if (scriptOutput == &quot;ParseError&quot;)
&gt; +        return Result::ParseError;
&gt; +
&gt; +    RefPtr&lt;IceCandidate&gt; candidate = iceCandidateFromJSON(scriptOutput);
&gt; +    if (!candidate)
&gt; +        return Result::InternalError;</span >

Ditto.

<span class="quote">&gt; Source/WebCore/Modules/mediastream/SDPProcessor.cpp:469
&gt; +        if (exec-&gt;hadException()) {
&gt; +            exec-&gt;clearException();
&gt; +            return false;
&gt; +        }
&gt; +    }
&gt; +
&gt; +    JSC::JSValue functionValue = globalObject-&gt;get(exec, JSC::Identifier::fromString(exec, functionName));
&gt; +    if (!functionValue.isFunction())
&gt; +        return false;
&gt; +
&gt; +    JSC::JSObject* function = functionValue.toObject(exec);
&gt; +    JSC::CallData callData;
&gt; +    JSC::CallType callType = function-&gt;methodTable()-&gt;getCallData(function, callData);
&gt; +    if (callType == JSC::CallTypeNone)
&gt; +        return false;</span >

Ditto.

<span class="quote">&gt; Source/WebCore/Modules/mediastream/SDPProcessor.cpp:482
&gt; +    if (!result.isString())
&gt; +        return false;</span >

Ditto.</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>