<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebRTC: Replace RTCPeerConnection custom constructor with a JS built-in constructor"
   href="https://bugs.webkit.org/show_bug.cgi?id=158832#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebRTC: Replace RTCPeerConnection custom constructor with a JS built-in constructor"
   href="https://bugs.webkit.org/show_bug.cgi?id=158832">bug 158832</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=158832#c6">comment #6</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=281665&amp;action=diff" name="attach_281665" title="Updated patch">attachment 281665</a> <a href="attachment.cgi?id=281665&amp;action=edit" title="Updated patch">[details]</a></span>
&gt; Updated patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=281665&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=281665&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp:83
&gt; &gt; +    Document&amp; document = downcast&lt;Document&gt;(*scriptExecutionContext());
&gt; 
&gt; It might be better to use CallWith=Document in the IDL to pass Document as
&gt; parameter to the IDL</span >

Fixed.

<span class="quote">&gt; &gt; Source/WebCore/Modules/mediastream/RTCPeerConnection.h:66
&gt; &gt; +    void initializeWith(const Dictionary&amp; rtcConfiguration, ExceptionCode&amp;);
&gt; 
&gt; Is &quot;rtcConfiguration&quot; needed?</span >

It contains all the settings passed to the constructor.

<span class="quote">&gt; &gt; Source/WebCore/Modules/mediastream/RTCPeerConnection.js:44
&gt; &gt; +        this.&#64;initializeWith(configuration);
&gt; 
&gt; I am not quite sure but can we find a better handling of errors than
&gt; catching-and-rethrowing?
&gt; Would it be more readable to make initializeWith return a status code
&gt; instead?</span >

I agree that catching and re-throwing is not ideal and that we should aim for something nicer. My plan is to revamp the RTCPeerConnection constructor, and probably the related setConfiguration() method, entirely in [1] to make them spec compliant. We probably want to define the RTCConfiguration dictionary (argument to constructor and setConfiguration()) properly in IDL or do something in the JS built-ins to get nice error messages. So further tweaks to this code will most likely be throw away soon. Is it OK going forward with that plan and commit this to unlock the blocked bugs?

[1] <a href="http://webkit.org/b/158936">http://webkit.org/b/158936</a></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>