Changeset 164372 in webkit


Ignore:
Timestamp:
Feb 19, 2014 10:48:35 AM (10 years ago)
Author:
thiago.lacerda@openbossa.org
Message:

[WebRTC] Updating RTCConfiguration to match WebRTC editor's draft of 01/27/2014
https://bugs.webkit.org/show_bug.cgi?id=129000

Source/WebCore:

Reviewed by Eric Carlson.

Adding RTCIceTransports and RTCIdentityOption to RTCConfiguration object.

Existing test was updated.

  • Modules/mediastream/RTCPeerConnection.cpp:

(WebCore::RTCPeerConnection::parseConfiguration): Taking into account iceTransports and requestIdentity
parameters.

  • platform/mediastream/RTCConfiguration.h:

(WebCore::RTCConfiguration::iceTransports): Added.
(WebCore::RTCConfiguration::setIceTransports): Added.
(WebCore::RTCConfiguration::requestIdentity): Added.
(WebCore::RTCConfiguration::setRequestIdentity): Added.
(WebCore::RTCConfiguration::RTCConfiguration): Initialize iceTransports and requestIdentity with the default
values.

LayoutTests:

Adding RTCIceTransports and RTCIdentityOption to RTCConfiguration object.

Reviewed by Eric Carlson.

  • fast/mediastream/RTCPeerConnection-expected.txt:
  • fast/mediastream/RTCPeerConnection.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r164371 r164372  
     12014-02-19  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
     2
     3        [WebRTC] Updating RTCConfiguration to match WebRTC editor's draft of 01/27/2014
     4        https://bugs.webkit.org/show_bug.cgi?id=129000
     5
     6        Adding RTCIceTransports and RTCIdentityOption to RTCConfiguration object.
     7
     8        Reviewed by Eric Carlson.
     9
     10        * fast/mediastream/RTCPeerConnection-expected.txt:
     11        * fast/mediastream/RTCPeerConnection.html:
     12
    1132014-02-19  Mark Hahnenberg  <mhahnenberg@apple.com>
    214
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-expected.txt

    r159823 r164372  
    2626PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'},{url:'stun:bar.com', username:'user2', credential:'x'}]}, null); threw exception TypeError: Optional constraints argument of RTCPeerConnection must be a valid Dictionary.
    2727PASS new webkitRTCPeerConnection({iceServers:[]}); did not throw exception.
     28PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'none'}); did not throw exception.
     29PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay'}); did not throw exception.
     30PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'all'}); did not throw exception.
     31PASS new webkitRTCPeerConnection({iceServers:[], requestIdentity:'yes'}); did not throw exception.
     32PASS new webkitRTCPeerConnection({iceServers:[], requestIdentity:'no'}); did not throw exception.
     33PASS new webkitRTCPeerConnection({iceServers:[], requestIdentity:'ifconfigured'}); did not throw exception.
     34PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'foo', requestIdentity:'bar'}); did not throw exception.
     35PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'none', requestIdentity:'bar'}); did not throw exception.
     36PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'foo', requestIdentity:'no'}); did not throw exception.
     37PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'none', requestIdentity:'yes'}); did not throw exception.
     38PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'none', requestIdentity:'no'}); did not throw exception.
     39PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'none', requestIdentity:'ifconfigured'}); did not throw exception.
     40PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay', requestIdentity:'yes'}); did not throw exception.
     41PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay', requestIdentity:'no'}); did not throw exception.
     42PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay', requestIdentity:'ifconfigured'}); did not throw exception.
     43PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'all', requestIdentity:'yes'}); did not throw exception.
     44PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'all', requestIdentity:'no'}); did not throw exception.
     45PASS new webkitRTCPeerConnection({iceServers:[], iceTransports:'all', requestIdentity:'ifconfigured'}); did not throw exception.
    2846PASS new webkitRTCPeerConnection({iceServers:[]}, {}); did not throw exception.
    2947PASS new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]}, {}); did not throw exception.
     
    3351PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'}]}, {}); did not throw exception.
    3452PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'},{url:'stun:bar.com', username:'user2', credential:'x'}]}, {}); did not throw exception.
     53PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception.
     54PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'},{url:'stun:bar.com'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception.
     55PASS new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com', username:'user'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception.
     56PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception.
     57PASS new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'},{url:'stun:bar.com', username:'user2', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {}); did not throw exception.
    3558PASS new webkitRTCPeerConnection({fooServers:[]}, {}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.
    3659PASS new webkitRTCPeerConnection({iceServers:true}, {}); threw exception TypeError: Invalid RTCPeerConnection constructor arguments.
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection.html

    r158987 r164372  
    3131
    3232            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[]});");
     33
     34            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'none'});");
     35            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay'});");
     36            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'all'});");
     37            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], requestIdentity:'yes'});");
     38            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], requestIdentity:'no'});");
     39            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], requestIdentity:'ifconfigured'});");
     40            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'foo', requestIdentity:'bar'});");
     41            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'none', requestIdentity:'bar'});");
     42            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'foo', requestIdentity:'no'});");
     43            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'none', requestIdentity:'yes'});");
     44            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'none', requestIdentity:'no'});");
     45            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'none', requestIdentity:'ifconfigured'});");
     46            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay', requestIdentity:'yes'});");
     47            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay', requestIdentity:'no'});");
     48            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay', requestIdentity:'ifconfigured'});");
     49            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'all', requestIdentity:'yes'});");
     50            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'all', requestIdentity:'no'});");
     51            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'all', requestIdentity:'ifconfigured'});");
     52
    3353            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[]}, {});");
    3454            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]}, {});");
     
    3858            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'}]}, {});");
    3959            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'},{url:'stun:bar.com', username:'user2', credential:'x'}]}, {});");
     60
     61            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});");
     62            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'},{url:'stun:bar.com'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});");
     63            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com', username:'user'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});");
     64            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});");
     65            shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'user', credential:'x'},{url:'stun:bar.com', username:'user2', credential:'x'}], iceTransports:'all', requestIdentity:'ifconfigured'}, {});");
    4066
    4167            shouldThrow("new webkitRTCPeerConnection({fooServers:[]}, {});");
  • trunk/Source/WebCore/ChangeLog

    r164369 r164372  
     12014-02-19  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
     2
     3        [WebRTC] Updating RTCConfiguration to match WebRTC editor's draft of 01/27/2014
     4        https://bugs.webkit.org/show_bug.cgi?id=129000
     5
     6        Reviewed by Eric Carlson.
     7
     8        Adding RTCIceTransports and RTCIdentityOption to RTCConfiguration object.
     9
     10        Existing test was updated.
     11
     12        * Modules/mediastream/RTCPeerConnection.cpp:
     13        (WebCore::RTCPeerConnection::parseConfiguration): Taking into account iceTransports and requestIdentity
     14        parameters.
     15        * platform/mediastream/RTCConfiguration.h:
     16        (WebCore::RTCConfiguration::iceTransports): Added.
     17        (WebCore::RTCConfiguration::setIceTransports): Added.
     18        (WebCore::RTCConfiguration::requestIdentity): Added.
     19        (WebCore::RTCConfiguration::setRequestIdentity): Added.
     20        (WebCore::RTCConfiguration::RTCConfiguration): Initialize iceTransports and requestIdentity with the default
     21        values.
     22
    1232014-02-19  Antti Koivisto  <antti@apple.com>
    224
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp

    r164361 r164372  
    8686    }
    8787
     88    String iceTransports;
     89    String requestIdentity;
     90    configuration.get("iceTransports", iceTransports);
     91    configuration.get("requestIdentity", requestIdentity);
     92
    8893    RefPtr<RTCConfiguration> rtcConfiguration = RTCConfiguration::create();
     94
     95    rtcConfiguration->setIceTransports(iceTransports);
     96    rtcConfiguration->setRequestIdentity(requestIdentity);
    8997
    9098    for (size_t i = 0; i < numberOfServers; ++i) {
  • trunk/Source/WebCore/platform/mediastream/RTCConfiguration.h

    r157653 r164372  
    7575    size_t numberOfServers() { return m_servers.size(); }
    7676    RTCIceServer* server(size_t index) { return m_servers[index].get(); }
     77    const String& iceTransports() const { return m_iceTransports; }
     78    void setIceTransports(const String& iceTransports)
     79    {
     80        if (iceTransports == "none" || iceTransports == "relay" || iceTransports == "all")
     81            m_iceTransports = iceTransports;
     82    }
     83    const String& requestIdentity() const { return m_requestIdentity; }
     84    void setRequestIdentity(const String& requestIdentity)
     85    {
     86        if (requestIdentity == "yes" || requestIdentity == "no" || requestIdentity == "ifconfigured")
     87            m_requestIdentity = requestIdentity;
     88    }
    7789
    7890 private:
    79     RTCConfiguration() { }
     91    RTCConfiguration()
     92        : m_iceTransports("all")
     93        , m_requestIdentity("ifconfigured")
     94    {
     95    }
    8096
    8197    Vector<RefPtr<RTCIceServer>> m_servers;
     98    String m_iceTransports;
     99    String m_requestIdentity;
    82100};
    83101
Note: See TracChangeset for help on using the changeset viewer.