Changeset 165321 in webkit


Ignore:
Timestamp:
Mar 7, 2014 7:36:23 PM (10 years ago)
Author:
thiago.lacerda@openbossa.org
Message:

[WebRTC] Throw SYNTAX_ERROR when maxRetransmits and maxRetransmitTime are both set in RTCDataChannelInit
https://bugs.webkit.org/show_bug.cgi?id=129894

Reviewed by Eric Carlson.

Source/WebCore:

Existing test was updated.

  • Modules/mediastream/RTCDataChannel.cpp:

(WebCore::RTCDataChannel::create):

LayoutTests:

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r165309 r165321  
     12014-03-07  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
     2
     3        [WebRTC] Throw SYNTAX_ERROR when maxRetransmits and maxRetransmitTime are both set in RTCDataChannelInit
     4        https://bugs.webkit.org/show_bug.cgi?id=129894
     5
     6        Reviewed by Eric Carlson.
     7
     8        * fast/mediastream/RTCPeerConnection-datachannel-expected.txt:
     9        * fast/mediastream/RTCPeerConnection-datachannel.html:
     10
    1112014-03-07  Martin Robinson  <mrobinson@igalia.com>
    212
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-datachannel-expected.txt

    r157892 r165321  
    44
    55
     6PASS dc = pc.createDataChannel("label", {maxRetransmitTime:0, maxRetransmits:0}); threw exception Error: SyntaxError: DOM Exception 12.
    67PASS dc = pc.createDataChannel("label1"); did not throw exception.
    78PASS dc = pc.createDataChannel("label2", {}); did not throw exception.
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-datachannel.html

    r164602 r165321  
    8383
    8484            pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
     85            shouldThrow('dc = pc.createDataChannel("label", {maxRetransmitTime:0, maxRetransmits:0});');
    8586            shouldNotThrow('dc = pc.createDataChannel("label1");');
    8687            shouldNotThrow('dc = pc.createDataChannel("label2", {});');
  • trunk/Source/WebCore/ChangeLog

    r165301 r165321  
     12014-03-07  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
     2
     3        [WebRTC] Throw SYNTAX_ERROR when maxRetransmits and maxRetransmitTime are both set in RTCDataChannelInit
     4        https://bugs.webkit.org/show_bug.cgi?id=129894
     5
     6        Reviewed by Eric Carlson.
     7
     8        Existing test was updated.
     9
     10        * Modules/mediastream/RTCDataChannel.cpp:
     11        (WebCore::RTCDataChannel::create):
     12
    1132014-03-07  Benjamin Poulain  <bpoulain@apple.com>
    214
  • trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp

    r159769 r165321  
    5858{
    5959    RTCDataChannelInit initData;
     60    String maxRetransmitsStr;
     61    String maxRetransmitTimeStr;
    6062    options.get("ordered", initData.ordered);
    6163    options.get("negotiated", initData.negotiated);
    6264    options.get("id", initData.id);
    63     options.get("maxRetransmits", initData.maxRetransmits);
    64     options.get("maxRetransmitTime", initData.maxRetransmitTime);
     65    options.get("maxRetransmits", maxRetransmitsStr);
     66    options.get("maxRetransmitTime", maxRetransmitTimeStr);
    6567    options.get("protocol", initData.protocol);
     68
     69    bool maxRetransmitsConversion;
     70    bool maxRetransmitTimeConversion;
     71    initData.maxRetransmits = maxRetransmitsStr.toUIntStrict(&maxRetransmitsConversion);
     72    initData.maxRetransmitTime = maxRetransmitTimeStr.toUIntStrict(&maxRetransmitTimeConversion);
     73    if (maxRetransmitsConversion && maxRetransmitTimeConversion) {
     74        ec = SYNTAX_ERR;
     75        return nullptr;
     76    }
    6677
    6778    std::unique_ptr<RTCDataChannelHandler> handler = peerConnectionHandler->createDataChannel(label, initData);
Note: See TracChangeset for help on using the changeset viewer.