<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#c11">Comment # 11</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:adam.bergkvist&#64;ericsson.com" title="Adam Bergkvist &lt;adam.bergkvist&#64;ericsson.com&gt;"> <span class="fn">Adam Bergkvist</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=154867#c8">comment #8</a>)
<span class="quote">&gt; Comment on <span class="bz_obsolete"><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>
&gt; Proposed patch
&gt; 
&gt; View in context:
&gt; <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 >

Thanks for taking time to review. Find answers inline.

<span class="quote">&gt; &gt; Source/WebCore/Modules/mediastream/SDPProcessor.cpp:74
&gt; &gt; +    candidateObject-&gt;setString(ASCIILiteral(&quot;type&quot;), candidate.type());
&gt; &gt; +    candidateObject-&gt;setString(ASCIILiteral(&quot;foundation&quot;), candidate.foundation());
&gt; &gt; +    candidateObject-&gt;setInteger(ASCIILiteral(&quot;componentId&quot;), candidate.componentId());
&gt; &gt; +    candidateObject-&gt;setString(ASCIILiteral(&quot;transport&quot;), candidate.transport());
&gt; &gt; +    candidateObject-&gt;setInteger(ASCIILiteral(&quot;priority&quot;), candidate.priority());
&gt; &gt; +    candidateObject-&gt;setString(ASCIILiteral(&quot;address&quot;), candidate.address());
&gt; &gt; +    candidateObject-&gt;setInteger(ASCIILiteral(&quot;port&quot;), candidate.port());
&gt; &gt; +    if (!candidate.tcpType().isEmpty())
&gt; &gt; +        candidateObject-&gt;setString(ASCIILiteral(&quot;tcpType&quot;), candidate.tcpType());
&gt; &gt; +    if (candidate.type().convertToASCIIUppercase() != &quot;HOST&quot;) {
&gt; &gt; +        candidateObject-&gt;setString(ASCIILiteral(&quot;relatedAddress&quot;), candidate.relatedAddress());
&gt; &gt; +        candidateObject-&gt;setInteger(ASCIILiteral(&quot;relatedPort&quot;), candidate.relatedPort());
&gt; &gt; +    }
&gt; 
&gt; It seems like a shame to have to create so many temporary String objects
&gt; just for the sake of passing through to the InspectorObject here (and later
&gt; in createCandidate).  Could you just use some static methods returning
&gt; NeverDestroyed&lt;String&gt; objects? E.g.:
&gt; 
&gt; static const String&amp; typeString()
&gt; {
&gt;     static NeverDestroyed&lt;const String&gt; type { ASCIILiteral(&quot;type&quot;) };
&gt;     return type;
&gt; }</span >

Yes. I created simple a macro to define a bunch of these functions.

<span class="quote">&gt; &gt; Source/WebCore/Modules/mediastream/SDPProcessor.cpp:86
&gt; &gt; +    if (candidateObject.getString(ASCIILiteral(&quot;type&quot;), stringValue))
&gt; &gt; +        candidate-&gt;setType(stringValue);
&gt; 
&gt; Ditto.
&gt; 
&gt; &gt; Source/WebCore/Modules/mediastream/SDPProcessor.cpp:153
&gt; &gt; +        if (mdescObject-&gt;getString(ASCIILiteral(&quot;type&quot;), stringValue))
&gt; &gt; +            mdesc-&gt;setType(stringValue);
&gt; 
&gt; Ditto.
&gt; 
&gt; &gt; Source/WebCore/Modules/mediastream/SDPProcessor.cpp:299
&gt; &gt; +    for (const RefPtr&lt;PeerMediaDescription&gt;&amp; mdesc : configuration.mediaDescriptions()) {
&gt; 
&gt; &quot;mdesc&quot; is not a very, ahem, descriptive name. &quot;description&quot;?</span >

Fixed. Went with mediaDescription.

<span class="quote">&gt; &gt; Source/WebCore/Modules/mediastream/SDPProcessor.cpp:300
&gt; &gt; +        RefPtr&lt;InspectorObject&gt; mdescObject = InspectorObject::create();
&gt; 
&gt; Same for &quot;mdescObject&quot;.</span >

Fixed. Went with mediaDescriptionObject.

<span class="quote">&gt; &gt; Source/WebCore/platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp:45
&gt; &gt; +String scriptString()
&gt; &gt; +{
&gt; &gt; +    return String(sdpJavaScript);
&gt; &gt; +}
&gt; 
&gt; This should probably return a const String&amp;, and store it locally in a
&gt; &quot;static NeverDestroyed&lt;const String&gt;&quot;.</span >

Indeed. Fixed.</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>