Commit 48a0ca6d authored by Philip Jägenstedt's avatar Philip Jägenstedt Committed by Commit Bot

Remove RTCPeerConnection#getStreamById

Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/m4DNZbLMkRo/9fzhqNwqBQAJ

Because this is also supported in Edge 15 and exists in WebKit's IDL,
add an historical.html test covering this and other non-standard
features that existed or still exist in Blink, but are no longer in the
spec, annotated here:
https://chromium.googlesource.com/chromium/src/+/e70c6e15ba896a2e88d0dc05f1a20fb3d4befabf

Bug: 698163
TBR: timvolodine@chromium.org
Change-Id: If8eac7005a652c000d34f12c48bd04194e1e215e
Reviewed-on: https://chromium-review.googlesource.com/597668
Commit-Queue: Philip Jägenstedt <foolip@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491997}
parent 3fcca5f0
...@@ -5567,7 +5567,6 @@ interface webkitRTCPeerConnection : EventTarget ...@@ -5567,7 +5567,6 @@ interface webkitRTCPeerConnection : EventTarget
method getLocalStreams method getLocalStreams
method getRemoteStreams method getRemoteStreams
method getStats method getStats
method getStreamById
method removeStream method removeStream
method setLocalDescription method setLocalDescription
method setRemoteDescription method setRemoteDescription
......
This is a testharness.js-based test.
FAIL RTCDataChannel member reliable 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
FAIL RTCPeerConnection member getRemoteStreams should not exist assert_false: expected false got true
PASS RTCPeerConnection member getStreamById should not exist
FAIL RTCPeerConnection member onaddstream should not exist assert_false: expected false got true
FAIL RTCPeerConnection member onremovestream should not exist assert_false: expected false got true
FAIL RTCPeerConnection member removeStream should not exist assert_false: expected false got true
PASS RTCPeerConnection member updateIce should not exist
Harness: the test ran to completion.
<!doctype html>
<title>Historical WebRTC features</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
assert_false("reliable" in RTCDataChannel.prototype);
}, "RTCDataChannel member reliable should not exist");
[
"addStream",
"createDTMFSender",
"getLocalStreams",
"getRemoteStreams",
"getStreamById",
"onaddstream",
"onremovestream",
"removeStream",
"updateIce",
].forEach(function(name) {
test(function() {
assert_false(name in RTCPeerConnection.prototype);
}, "RTCPeerConnection member " + name + " should not exist");
});
</script>
CONSOLE WARNING: line 22: RTCPeerConnection.getStreamById() is deprecated and will be removed in M62, around October 2017. See https://www.chromestatus.com/features/5751819573657600 for more details.
This is a testharness.js-based test.
PASS Tests RTCPeerConnection [add|remove]Stream.
Harness: the test ran to completion.
...@@ -19,8 +19,7 @@ navigator.webkitGetUserMedia(options, (stream1) => { ...@@ -19,8 +19,7 @@ navigator.webkitGetUserMedia(options, (stream1) => {
pc = new RTCPeerConnection(); pc = new RTCPeerConnection();
pc.onnegotiationneeded = (event) => { pc.onnegotiationneeded = (event) => {
assert_equals(pc.getStreamById(stream1.id), stream1); assert_array_equals(pc.getLocalStreams(), [stream1]);
assert_equals(pc.getStreamById(stream2.id), null);
pc.onnegotiationneeded = () => { pc.onnegotiationneeded = () => {
assert_unreached('onErroneousNegotiationNeeded was called.'); assert_unreached('onErroneousNegotiationNeeded was called.');
......
...@@ -4411,7 +4411,6 @@ interface RTCPeerConnection : EventTarget ...@@ -4411,7 +4411,6 @@ interface RTCPeerConnection : EventTarget
method getReceivers method getReceivers
method getRemoteStreams method getRemoteStreams
method getStats method getStats
method getStreamById
method removeStream method removeStream
method setConfiguration method setConfiguration
method setLocalDescription method setLocalDescription
...@@ -7832,7 +7831,6 @@ interface webkitRTCPeerConnection : EventTarget ...@@ -7832,7 +7831,6 @@ interface webkitRTCPeerConnection : EventTarget
method getReceivers method getReceivers
method getRemoteStreams method getRemoteStreams
method getStats method getStats
method getStreamById
method removeStream method removeStream
method setConfiguration method setConfiguration
method setLocalDescription method setLocalDescription
......
...@@ -4340,7 +4340,6 @@ interface RTCPeerConnection : EventTarget ...@@ -4340,7 +4340,6 @@ interface RTCPeerConnection : EventTarget
method getReceivers method getReceivers
method getRemoteStreams method getRemoteStreams
method getStats method getStats
method getStreamById
method removeStream method removeStream
method setConfiguration method setConfiguration
method setLocalDescription method setLocalDescription
...@@ -7761,7 +7760,6 @@ interface webkitRTCPeerConnection : EventTarget ...@@ -7761,7 +7760,6 @@ interface webkitRTCPeerConnection : EventTarget
method getReceivers method getReceivers
method getRemoteStreams method getRemoteStreams
method getStats method getStats
method getStreamById
method removeStream method removeStream
method setConfiguration method setConfiguration
method setLocalDescription method setLocalDescription
......
...@@ -5199,7 +5199,6 @@ interface RTCPeerConnection : EventTarget ...@@ -5199,7 +5199,6 @@ interface RTCPeerConnection : EventTarget
method getRemoteStreams method getRemoteStreams
method getSenders method getSenders
method getStats method getStats
method getStreamById
method removeStream method removeStream
method removeTrack method removeTrack
method setConfiguration method setConfiguration
...@@ -8849,7 +8848,6 @@ interface webkitRTCPeerConnection : EventTarget ...@@ -8849,7 +8848,6 @@ interface webkitRTCPeerConnection : EventTarget
method getRemoteStreams method getRemoteStreams
method getSenders method getSenders
method getStats method getStats
method getStreamById
method removeStream method removeStream
method removeTrack method removeTrack
method setConfiguration method setConfiguration
......
...@@ -5206,7 +5206,6 @@ interface RTCPeerConnection : EventTarget ...@@ -5206,7 +5206,6 @@ interface RTCPeerConnection : EventTarget
method getRemoteStreams method getRemoteStreams
method getSenders method getSenders
method getStats method getStats
method getStreamById
method removeStream method removeStream
method removeTrack method removeTrack
method setConfiguration method setConfiguration
...@@ -8857,7 +8856,6 @@ interface webkitRTCPeerConnection : EventTarget ...@@ -8857,7 +8856,6 @@ interface webkitRTCPeerConnection : EventTarget
method getRemoteStreams method getRemoteStreams
method getSenders method getSenders
method getStats method getStats
method getStreamById
method removeStream method removeStream
method removeTrack method removeTrack
method setConfiguration method setConfiguration
......
...@@ -489,10 +489,6 @@ String Deprecation::DeprecationMessage(WebFeature feature) { ...@@ -489,10 +489,6 @@ String Deprecation::DeprecationMessage(WebFeature feature) {
"https://www.chromestatus.com/feature/5735596811091968 for more " "https://www.chromestatus.com/feature/5735596811091968 for more "
"details."; "details.";
case WebFeature::kV8RTCPeerConnection_GetStreamById_Method:
return willBeRemoved("RTCPeerConnection.getStreamById()", M62,
"5751819573657600");
case WebFeature::kV8SVGPathElement_GetPathSegAtLength_Method: case WebFeature::kV8SVGPathElement_GetPathSegAtLength_Method:
return willBeRemoved("SVGPathElement.getPathSegAtLength", M62, return willBeRemoved("SVGPathElement.getPathSegAtLength", M62,
"5638783282184192"); "5638783282184192");
......
...@@ -1143,22 +1143,6 @@ MediaStreamVector RTCPeerConnection::getRemoteStreams() const { ...@@ -1143,22 +1143,6 @@ MediaStreamVector RTCPeerConnection::getRemoteStreams() const {
return remote_streams_; return remote_streams_;
} }
MediaStream* RTCPeerConnection::getStreamById(const String& stream_id) {
for (MediaStreamVector::iterator iter = local_streams_.begin();
iter != local_streams_.end(); ++iter) {
if ((*iter)->id() == stream_id)
return iter->Get();
}
for (MediaStreamVector::iterator iter = remote_streams_.begin();
iter != remote_streams_.end(); ++iter) {
if ((*iter)->id() == stream_id)
return iter->Get();
}
return 0;
}
ScriptPromise RTCPeerConnection::getStats(ScriptState* script_state, ScriptPromise RTCPeerConnection::getStats(ScriptState* script_state,
RTCStatsCallback* success_callback, RTCStatsCallback* success_callback,
MediaStreamTrack* selector) { MediaStreamTrack* selector) {
......
...@@ -140,8 +140,6 @@ class MODULES_EXPORT RTCPeerConnection final ...@@ -140,8 +140,6 @@ class MODULES_EXPORT RTCPeerConnection final
MediaStreamVector getRemoteStreams() const; MediaStreamVector getRemoteStreams() const;
MediaStream* getStreamById(const String& stream_id);
void addStream(ScriptState*, void addStream(ScriptState*,
MediaStream*, MediaStream*,
const Dictionary& media_constraints, const Dictionary& media_constraints,
......
...@@ -133,7 +133,6 @@ enum RTCIceConnectionState { ...@@ -133,7 +133,6 @@ enum RTCIceConnectionState {
// Non-standard or removed from the spec: // Non-standard or removed from the spec:
[Measure] sequence<MediaStream> getLocalStreams(); [Measure] sequence<MediaStream> getLocalStreams();
[Measure] sequence<MediaStream> getRemoteStreams(); [Measure] sequence<MediaStream> getRemoteStreams();
[DeprecateAs=V8RTCPeerConnection_GetStreamById_Method] MediaStream getStreamById(DOMString streamId);
[Measure, CallWith=ScriptState, RaisesException] void addStream(MediaStream? stream, optional Dictionary mediaConstraints); [Measure, CallWith=ScriptState, RaisesException] void addStream(MediaStream? stream, optional Dictionary mediaConstraints);
[Measure, RaisesException] void removeStream(MediaStream? stream); [Measure, RaisesException] void removeStream(MediaStream? stream);
[Measure, RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track); [Measure, RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track);
......
...@@ -1193,7 +1193,6 @@ enum WebFeature { ...@@ -1193,7 +1193,6 @@ enum WebFeature {
kV8RTCPeerConnection_CreateDTMFSender_Method = 1642, kV8RTCPeerConnection_CreateDTMFSender_Method = 1642,
kV8RTCPeerConnection_GetLocalStreams_Method = 1643, kV8RTCPeerConnection_GetLocalStreams_Method = 1643,
kV8RTCPeerConnection_GetRemoteStreams_Method = 1644, kV8RTCPeerConnection_GetRemoteStreams_Method = 1644,
kV8RTCPeerConnection_GetStreamById_Method = 1645,
kV8RTCPeerConnection_RemoveStream_Method = 1646, kV8RTCPeerConnection_RemoveStream_Method = 1646,
kRTCPeerConnectionCreateDataChannelMaxRetransmitTime = 1648, kRTCPeerConnectionCreateDataChannelMaxRetransmitTime = 1648,
kRTCPeerConnectionCreateDataChannelMaxRetransmits = 1649, kRTCPeerConnectionCreateDataChannelMaxRetransmits = 1649,
......
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