Commit 49d46905 authored by Maxim Kolosovskiy's avatar Maxim Kolosovskiy Committed by Commit Bot

Revert "Add datachannel.maxPacketLifeTime"

This reverts commit e557c49c.

Reason for revert: I suspect this CL causes the following test failures:
external/wpt/xhr/idlharness.any.html
external/wpt/storage/idlharness.https.any.html
external/wpt/background-fetch/idlharness.https.any.serviceworker.html

The first failed build: https://ci.chromium.org/p/chromium/builders/ci/WebKit%20Linux%20MSAN/938

Original change's description:
> Add datachannel.maxPacketLifeTime
> 
> Delete nonstandard attribute maxRetransmitTime, and make both
> maxPacketLifeTime and maxRetransmits nullable.
> (Usage of both attributes has been measured to be negligible.)
> 
> Bug: 696681
> Change-Id: If37e38114d4718b868413ea8ced9527c88510c15
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1710557
> Commit-Queue: Harald Alvestrand <hta@chromium.org>
> Reviewed-by: Florent Castelli <orphis@chromium.org>
> Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
> Reviewed-by: Steve Anton <steveanton@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#679965}

TBR=hta@chromium.org,foolip@chromium.org,orphis@chromium.org,steveanton@chromium.org

Change-Id: If70558e9730cd910f28baed15eef44ebd40f5ee7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 696681
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715689Reviewed-by: default avatarMaxim Kolosovskiy <kolos@chromium.org>
Commit-Queue: Maxim Kolosovskiy <kolos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680398}
parent ced08139
......@@ -34,6 +34,18 @@ bool MockDataChannel::reliable() const { return reliable_; }
bool MockDataChannel::ordered() const { return config_.ordered; }
uint16_t MockDataChannel::maxRetransmitTime() const {
// TODO(https://bugs.chromium.org/854385): Restore when change landed.
// return config_.maxRetransmitTime;
return -1;
}
uint16_t MockDataChannel::maxRetransmits() const {
// TODO(https://bugs.chromium.org/854385): Restore when change landed.
// return config_.maxRetransmits;
return -1;
}
std::string MockDataChannel::protocol() const { return config_.protocol; }
bool MockDataChannel::negotiated() const { return config_.negotiated; }
......
......@@ -24,6 +24,8 @@ class MockDataChannel : public webrtc::DataChannelInterface {
std::string label() const override;
bool reliable() const override;
bool ordered() const override;
uint16_t maxRetransmitTime() const override;
uint16_t maxRetransmits() const override;
std::string protocol() const override;
bool negotiated() const override;
int id() const override;
......
......@@ -71,17 +71,12 @@ void IncrementCounters(const webrtc::DataChannelInterface& channel) {
if (channel.negotiated())
IncrementCounter(DataChannelCounters::kNegotiated);
// Only record max retransmits and max packet life time if set.
if (channel.maxRetransmitsOpt()) {
UMA_HISTOGRAM_CUSTOM_COUNTS("WebRTC.DataChannelMaxRetransmits",
*(channel.maxRetransmitsOpt()), 1,
std::numeric_limits<uint16_t>::max(), 50);
}
if (channel.maxPacketLifeTime()) {
UMA_HISTOGRAM_CUSTOM_COUNTS("WebRTC.DataChannelMaxPacketLifeTime",
*channel.maxPacketLifeTime(), 1,
std::numeric_limits<uint16_t>::max(), 50);
}
UMA_HISTOGRAM_CUSTOM_COUNTS("WebRTC.DataChannelMaxRetransmits",
channel.maxRetransmits(), 1,
std::numeric_limits<uint16_t>::max(), 50);
UMA_HISTOGRAM_CUSTOM_COUNTS("WebRTC.DataChannelMaxRetransmitTime",
channel.maxRetransmitTime(), 1,
std::numeric_limits<uint16_t>::max(), 50);
}
void RecordMessageSent(const webrtc::DataChannelInterface& channel,
......@@ -262,24 +257,14 @@ bool RTCDataChannel::ordered() const {
return channel()->ordered();
}
uint16_t RTCDataChannel::maxPacketLifeTime(bool& is_null) const {
uint16_t RTCDataChannel::maxRetransmitTime() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (channel()->maxPacketLifeTime()) {
is_null = false;
return *(channel()->maxPacketLifeTime());
}
is_null = true;
return -1;
return channel()->maxRetransmitTime();
}
uint16_t RTCDataChannel::maxRetransmits(bool& is_null) const {
uint16_t RTCDataChannel::maxRetransmits() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (channel()->maxRetransmitsOpt()) {
is_null = false;
return *(channel()->maxRetransmitsOpt());
}
is_null = true;
return -1;
return channel()->maxRetransmits();
}
String RTCDataChannel::protocol() const {
......
......@@ -66,8 +66,8 @@ class MODULES_EXPORT RTCDataChannel final
bool reliable() const;
bool ordered() const;
uint16_t maxPacketLifeTime(bool&) const;
uint16_t maxRetransmits(bool&) const;
uint16_t maxRetransmitTime() const;
uint16_t maxRetransmits() const;
String protocol() const;
bool negotiated() const;
uint16_t id(bool& is_null) const;
......
......@@ -40,8 +40,10 @@ enum RTCDataChannelState {
] interface RTCDataChannel : EventTarget {
readonly attribute USVString label;
readonly attribute boolean ordered;
readonly attribute unsigned short? maxPacketLifeTime;
readonly attribute unsigned short? maxRetransmits;
// TODO(foolip): |maxRetransmitTime| is called |maxPacketLifeTime| in the
// spec and both it and |maxRetransmits| are nullable.
[Measure] readonly attribute unsigned short maxRetransmitTime;
[Measure] readonly attribute unsigned short maxRetransmits;
readonly attribute USVString protocol;
readonly attribute boolean negotiated;
readonly attribute unsigned short? id;
......
......@@ -84,12 +84,8 @@ class MockDataChannel : public webrtc::DataChannelInterface {
std::string label() const override { return std::string(); }
bool reliable() const override { return false; }
bool ordered() const override { return false; }
absl::optional<int> maxPacketLifeTime() const override {
return absl::nullopt;
}
absl::optional<int> maxRetransmitsOpt() const override {
return absl::nullopt;
}
uint16_t maxRetransmitTime() const override { return 0; }
uint16_t maxRetransmits() const override { return 0; }
std::string protocol() const override { return std::string(); }
bool negotiated() const override { return false; }
int id() const override { return 0; }
......
This is a testharness.js-based test.
PASS createDataChannel with no argument should throw TypeError
PASS createDataChannel with closed connection should throw InvalidStateError
FAIL createDataChannel attribute default values assert_equals: expected (string) "low" but got (undefined) undefined
FAIL createDataChannel with provided parameters should initialize attributes to provided values assert_equals: expected (string) "high" but got (undefined) undefined
FAIL createDataChannel attribute default values assert_equals: expected (object) null but got (undefined) undefined
FAIL createDataChannel with provided parameters should initialize attributes to provided values assert_equals: expected (object) null but got (undefined) undefined
PASS createDataChannel with label "foo" should succeed
PASS createDataChannel with label null should succeed
PASS createDataChannel with label undefined should succeed
PASS createDataChannel with label lone surrogate should succeed
PASS createDataChannel with ordered false should succeed
PASS createDataChannel with ordered null/undefined should succeed
PASS createDataChannel with maxPacketLifeTime 0 should succeed
FAIL createDataChannel with maxPacketLifeTime 0 should succeed assert_equals: expected (number) 0 but got (undefined) undefined
PASS createDataChannel with maxRetransmits 0 should succeed
PASS createDataChannel with both maxPacketLifeTime and maxRetransmits undefined should succeed
PASS createDataChannel with both maxPacketLifeTime and maxRetransmits should throw TypeError
......
......@@ -4,8 +4,8 @@ PASS Should be able to send data in a datachannel event handler
FAIL Open event should not be raised when closing the channel in the datachannel event assert_unreached: Open event should not fire Reached unreachable code
PASS Open event should be raised when closing the channel in the datachannel event after enqueuing a task
FAIL Open event should not be raised when sending and immediately closing the channel in the datachannel event assert_unreached: Open event should not fire Reached unreachable code
FAIL In-band negotiated channel created on remote peer should match the same configuration as local peer assert_equals: expected (string) "high" but got (undefined) undefined
FAIL In-band negotiated channel created on remote peer should match the same (default) configuration as local peer assert_equals: expected (string) "low" but got (undefined) undefined
FAIL In-band negotiated channel created on remote peer should match the same configuration as local peer assert_equals: expected (object) null but got (undefined) undefined
FAIL In-band negotiated channel created on remote peer should match the same (default) configuration as local peer assert_equals: expected (object) null but got (undefined) undefined
PASS Negotiated channel should not fire datachannel event on remote peer
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL RTCDataChannel member reliable should not exist assert_false: expected false got true
PASS RTCDataChannel member maxRetransmitTime should not exist
FAIL RTCDataChannel member maxRetransmitTime should not exist assert_false: expected false got true
FAIL RTCPeerConnection member addStream should not exist assert_false: expected false got true
FAIL RTCPeerConnection member createDTMFSender should not exist assert_false: expected false got true
FAIL RTCPeerConnection member getLocalStreams should not exist assert_false: expected false got true
......
This is a testharness.js-based test.
Found 508 tests; 470 PASS, 38 FAIL, 0 TIMEOUT, 0 NOTRUN.
Found 508 tests; 468 PASS, 40 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS idl_test setup
PASS Test driver for asyncInitCertificate
PASS Test driver for asyncInitTransports
......@@ -398,7 +398,7 @@ PASS RTCDataChannel interface: existence and properties of interface prototype o
PASS RTCDataChannel interface: existence and properties of interface prototype object's @@unscopables property
PASS RTCDataChannel interface: attribute label
PASS RTCDataChannel interface: attribute ordered
PASS RTCDataChannel interface: attribute maxPacketLifeTime
FAIL RTCDataChannel interface: attribute maxPacketLifeTime assert_true: The prototype object must have a property "maxPacketLifeTime" expected true got false
PASS RTCDataChannel interface: attribute maxRetransmits
PASS RTCDataChannel interface: attribute protocol
PASS RTCDataChannel interface: attribute negotiated
......@@ -423,7 +423,7 @@ PASS RTCDataChannel must be primary interface of new RTCPeerConnection().createD
PASS Stringification of new RTCPeerConnection().createDataChannel('')
PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "label" with the proper type
PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "ordered" with the proper type
PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "maxPacketLifeTime" with the proper type
FAIL RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "maxPacketLifeTime" with the proper type assert_inherits: property "maxPacketLifeTime" not found in prototype chain
PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "maxRetransmits" with the proper type
PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "protocol" with the proper type
PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "negotiated" with the proper type
......
......@@ -4980,7 +4980,7 @@ interface RTCDataChannel : EventTarget
getter bufferedAmountLowThreshold
getter id
getter label
getter maxPacketLifeTime
getter maxRetransmitTime
getter maxRetransmits
getter negotiated
getter onbufferedamountlow
......
This is a testharness.js-based test.
Found 508 tests; 401 PASS, 107 FAIL, 0 TIMEOUT, 0 NOTRUN.
Found 508 tests; 399 PASS, 109 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS idl_test setup
PASS Test driver for asyncInitCertificate
FAIL Test driver for asyncInitTransports assert_unreached: Failed to run asyncInitTransports: Error: assert_true: Expect pc.sctp to be instance of RTCSctpTransport expected true got false Reached unreachable code
......@@ -398,7 +398,7 @@ PASS RTCDataChannel interface: existence and properties of interface prototype o
PASS RTCDataChannel interface: existence and properties of interface prototype object's @@unscopables property
PASS RTCDataChannel interface: attribute label
PASS RTCDataChannel interface: attribute ordered
PASS RTCDataChannel interface: attribute maxPacketLifeTime
FAIL RTCDataChannel interface: attribute maxPacketLifeTime assert_true: The prototype object must have a property "maxPacketLifeTime" expected true got false
PASS RTCDataChannel interface: attribute maxRetransmits
PASS RTCDataChannel interface: attribute protocol
PASS RTCDataChannel interface: attribute negotiated
......@@ -423,7 +423,7 @@ PASS RTCDataChannel must be primary interface of new RTCPeerConnection().createD
PASS Stringification of new RTCPeerConnection().createDataChannel('')
PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "label" with the proper type
PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "ordered" with the proper type
PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "maxPacketLifeTime" with the proper type
FAIL RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "maxPacketLifeTime" with the proper type assert_inherits: property "maxPacketLifeTime" not found in prototype chain
PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "maxRetransmits" with the proper type
PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "protocol" with the proper type
PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "negotiated" with the proper type
......
......@@ -5786,7 +5786,7 @@ interface RTCDataChannel : EventTarget
getter bufferedAmountLowThreshold
getter id
getter label
getter maxPacketLifeTime
getter maxRetransmitTime
getter maxRetransmits
getter negotiated
getter onbufferedamountlow
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment