<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>18486</bug_id>
          
          <creation_ts>2012-08-04 00:22:02 +0000</creation_ts>
          <short_desc>Let RTCSessionDescription take a Dictionary parameter</short_desc>
          <delta_ts>2012-09-13 14:49:59 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebRTC Working Group</product>
          <component>WebRTC API</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Harald Alvestrand">harald</reporter>
          <assigned_to name="Adam Bergkvist">adam.bergkvist</assigned_to>
          <cc>adam.bergkvist</cc>
    
    <cc>public-webrtc</cc>
    
    <cc>tommyw</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71838</commentid>
    <comment_count>0</comment_count>
    <who name="Harald Alvestrand">harald</who>
    <bug_when>2012-08-04 00:22:02 +0000</bug_when>
    <thetext>From Tommy Widenflycht, July 31 (see mailing list for discussion):

Today I would like to propose a small change to RTCSessionDescription and RTCIceCandidate which would make the much more flexible:

[Constructor(optional Dictionary description)]
interface RTCSessionDescription {
             attribute RTCSdpType type;
             attribute DOMString  sdp;
};

In short the single constructor takes an Dictionary which is expected to mimic its members, and the stringifier method is removed.


This has the advantages of being extremely powerful:

sd = new RTCSessionDescription();
sd.sdp = ...;
sd.type = ...;

sd = new RTCSessionDescription({sdp:&quot;...&quot;});
sd.type = ...;

sd = new RTCSessionDescription({type:&quot;answer&quot;, sdp:&quot;...&quot;});

sd = new RTCSessionDescription(JSON.parse(some_json_string));

sd2 = new RTCSessionDescription(sd);

and in the other direction

jsonified_sd = JSON.stringify(sd);


There&apos;s some precedence in using a constructor like this in some of the base Event classes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72113</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2012-08-13 09:29:59 +0000</bug_when>
    <thetext>It&apos;s nice that the constructor takes an object rather than a string of JSON. I&apos;ll go ahead and add this to the spec.

I&apos;m not sure this cloning functionality works though:
&gt; sd2 = new RTCSessionDescription(sd);</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>