Commit 1081d0ac authored by Harald Alvestrand's avatar Harald Alvestrand Committed by Commit Bot

Implement IDL surface for RTCDtlsTransport

This provides the IDL surface only, there is no connection to the
underlying objects.

Bug: 907849
Change-Id: Ie11bac767c6a26628c1bc757d2529f1192a07e40
Reviewed-on: https://chromium-review.googlesource.com/c/1348064
Commit-Queue: Harald Alvestrand <hta@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610730}
parent 69af5a6c
......@@ -303,17 +303,17 @@ FAIL RTCRtpTransceiver interface: new RTCPeerConnection().addTransceiver('audio'
FAIL RTCRtpTransceiver interface: new RTCPeerConnection().addTransceiver('audio') must inherit property "stop()" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "InvalidStateError: Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'. 'unified-plan' will become the default behavior in the future, but it is currently experimental. To try it out, construct the RTCPeerConnection with sdpSemantics:'unified-plan' present in the RTCConfiguration argument."
FAIL RTCRtpTransceiver interface: new RTCPeerConnection().addTransceiver('audio') must inherit property "setCodecPreferences([object Object])" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "InvalidStateError: Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'. 'unified-plan' will become the default behavior in the future, but it is currently experimental. To try it out, construct the RTCPeerConnection with sdpSemantics:'unified-plan' present in the RTCConfiguration argument."
FAIL RTCRtpTransceiver interface: calling setCodecPreferences([object Object]) on new RTCPeerConnection().addTransceiver('audio') with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "InvalidStateError: Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'. 'unified-plan' will become the default behavior in the future, but it is currently experimental. To try it out, construct the RTCPeerConnection with sdpSemantics:'unified-plan' present in the RTCConfiguration argument."
FAIL RTCDtlsTransport interface: existence and properties of interface object assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface object length assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface object name assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: existence and properties of interface prototype object assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: attribute iceTransport assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: attribute state assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: operation getRemoteCertificates() assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: attribute onstatechange assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: attribute onerror assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
PASS RTCDtlsTransport interface: existence and properties of interface object
PASS RTCDtlsTransport interface object length
PASS RTCDtlsTransport interface object name
PASS RTCDtlsTransport interface: existence and properties of interface prototype object
PASS RTCDtlsTransport interface: existence and properties of interface prototype object's "constructor" property
PASS RTCDtlsTransport interface: existence and properties of interface prototype object's @@unscopables property
PASS RTCDtlsTransport interface: attribute iceTransport
PASS RTCDtlsTransport interface: attribute state
PASS RTCDtlsTransport interface: operation getRemoteCertificates()
PASS RTCDtlsTransport interface: attribute onstatechange
PASS RTCDtlsTransport interface: attribute onerror
FAIL RTCDtlsTransport must be primary interface of idlTestObjects.dtlsTransport assert_equals: wrong typeof object expected "object" but got "undefined"
FAIL Stringification of idlTestObjects.dtlsTransport assert_equals: wrong typeof object expected "object" but got "undefined"
FAIL RTCDtlsTransport interface: idlTestObjects.dtlsTransport must inherit property "iceTransport" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
......
......@@ -303,17 +303,17 @@ PASS RTCRtpTransceiver interface: new RTCPeerConnection().addTransceiver('audio'
FAIL RTCRtpTransceiver interface: new RTCPeerConnection().addTransceiver('audio') must inherit property "stop()" with the proper type assert_inherits: property "stop" not found in prototype chain
FAIL RTCRtpTransceiver interface: new RTCPeerConnection().addTransceiver('audio') must inherit property "setCodecPreferences([object Object])" with the proper type assert_inherits: property "setCodecPreferences" not found in prototype chain
FAIL RTCRtpTransceiver interface: calling setCodecPreferences([object Object]) on new RTCPeerConnection().addTransceiver('audio') with too few arguments must throw TypeError assert_inherits: property "setCodecPreferences" not found in prototype chain
FAIL RTCDtlsTransport interface: existence and properties of interface object assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface object length assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface object name assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: existence and properties of interface prototype object assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: attribute iceTransport assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: attribute state assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: operation getRemoteCertificates() assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: attribute onstatechange assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
FAIL RTCDtlsTransport interface: attribute onerror assert_own_property: self does not have own property "RTCDtlsTransport" expected property "RTCDtlsTransport" missing
PASS RTCDtlsTransport interface: existence and properties of interface object
PASS RTCDtlsTransport interface object length
PASS RTCDtlsTransport interface object name
PASS RTCDtlsTransport interface: existence and properties of interface prototype object
PASS RTCDtlsTransport interface: existence and properties of interface prototype object's "constructor" property
PASS RTCDtlsTransport interface: existence and properties of interface prototype object's @@unscopables property
PASS RTCDtlsTransport interface: attribute iceTransport
PASS RTCDtlsTransport interface: attribute state
PASS RTCDtlsTransport interface: operation getRemoteCertificates()
PASS RTCDtlsTransport interface: attribute onstatechange
PASS RTCDtlsTransport interface: attribute onerror
FAIL RTCDtlsTransport must be primary interface of idlTestObjects.dtlsTransport assert_equals: wrong typeof object expected "object" but got "undefined"
FAIL Stringification of idlTestObjects.dtlsTransport assert_equals: wrong typeof object expected "object" but got "undefined"
FAIL RTCDtlsTransport interface: idlTestObjects.dtlsTransport must inherit property "iceTransport" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
......
......@@ -5509,6 +5509,16 @@ interface RTCDataChannelEvent : Event
attribute @@toStringTag
getter channel
method constructor
interface RTCDtlsTransport : EventTarget
attribute @@toStringTag
getter iceTransport
getter onerror
getter onstatechange
getter state
method constructor
method getRemoteCertificates
setter onerror
setter onstatechange
interface RTCIceCandidate
attribute @@toStringTag
getter candidate
......
......@@ -29,6 +29,7 @@
"MediaStreamTrack",
"RTCDTMFSender",
"RTCDataChannel",
"RTCDtlsTransport",
"RTCPeerConnection",
"NetworkInformation",
"Notification",
......
......@@ -223,6 +223,7 @@ modules_idl_files =
"peerconnection/rtc_certificate.idl",
"peerconnection/rtc_data_channel.idl",
"peerconnection/rtc_data_channel_event.idl",
"peerconnection/rtc_dtls_transport.idl",
"peerconnection/rtc_dtmf_sender.idl",
"peerconnection/rtc_dtmf_tone_change_event.idl",
"peerconnection/rtc_ice_candidate.idl",
......
......@@ -44,6 +44,8 @@ blink_modules_sources("peerconnection") {
"rtc_data_channel.h",
"rtc_data_channel_event.cc",
"rtc_data_channel_event.h",
"rtc_dtls_transport.cc",
"rtc_dtls_transport.h",
"rtc_dtmf_sender.cc",
"rtc_dtmf_sender.h",
"rtc_dtmf_tone_change_event.cc",
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/modules/peerconnection/rtc_dtls_transport.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h"
#include "third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_adapter_cross_thread_factory.h"
#include "third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_adapter_impl.h"
#include "third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_proxy.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_error_util.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_ice_candidate.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_ice_gather_options.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_ice_transport.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_ice_event.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_ice_event_init.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_quic_transport.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread.h"
#include "third_party/webrtc/api/jsepicecandidate.h"
#include "third_party/webrtc/api/peerconnectioninterface.h"
#include "third_party/webrtc/p2p/base/portallocator.h"
#include "third_party/webrtc/p2p/base/transportdescription.h"
#include "third_party/webrtc/pc/iceserverparsing.h"
#include "third_party/webrtc/pc/webrtcsdp.h"
namespace blink {
RTCDtlsTransport* RTCDtlsTransport::Create(ExecutionContext* context) {
return new RTCDtlsTransport(context);
}
RTCDtlsTransport::RTCDtlsTransport(ExecutionContext* context)
: ContextClient(context) {}
RTCDtlsTransport::~RTCDtlsTransport() {}
String RTCDtlsTransport::state() const {
NOTIMPLEMENTED();
return "";
}
const HeapVector<Member<DOMArrayBuffer>>&
RTCDtlsTransport::getRemoteCertificates() const {
return remote_certificates_;
}
RTCIceTransport* RTCDtlsTransport::iceTransport() const {
// TODO(crbug.com/907849): Implement returning an IceTransport
NOTIMPLEMENTED();
return nullptr;
}
const AtomicString& RTCDtlsTransport::InterfaceName() const {
return event_target_names::kRTCDtlsTransport;
}
ExecutionContext* RTCDtlsTransport::GetExecutionContext() const {
return ContextClient::GetExecutionContext();
}
void RTCDtlsTransport::Trace(Visitor* visitor) {
visitor->Trace(remote_certificates_);
EventTargetWithInlineData::Trace(visitor);
ContextClient::Trace(visitor);
}
} // namespace blink
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_DTLS_TRANSPORT_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_DTLS_TRANSPORT_H_
#include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h"
#include "third_party/blink/renderer/core/dom/context_lifecycle_observer.h"
#include "third_party/blink/renderer/modules/event_target_modules.h"
namespace blink {
class DOMArrayBuffer;
class RTCIceTransport;
enum class RTCDtlsTransportState {
kNew,
kChecking,
kConnected,
kCompleted,
kDisconnected,
kFailed,
kClosed
};
// Blink bindings for the RTCDtlsTransport JavaScript object.
//
class MODULES_EXPORT RTCDtlsTransport final : public EventTargetWithInlineData,
public ContextClient {
DEFINE_WRAPPERTYPEINFO();
USING_GARBAGE_COLLECTED_MIXIN(RTCDtlsTransport);
public:
static RTCDtlsTransport* Create(ExecutionContext* context);
~RTCDtlsTransport() override;
// rtc_dtls_transport.idl
RTCIceTransport* iceTransport() const;
String state() const;
const HeapVector<Member<DOMArrayBuffer>>& getRemoteCertificates() const;
DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange, kStatechange);
DEFINE_ATTRIBUTE_EVENT_LISTENER(error, kError);
// EventTarget overrides.
const AtomicString& InterfaceName() const override;
ExecutionContext* GetExecutionContext() const override;
// For garbage collection.
void Trace(blink::Visitor* visitor) override;
private:
explicit RTCDtlsTransport(ExecutionContext* context);
HeapVector<Member<DOMArrayBuffer>> remote_certificates_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_DTLS_TRANSPORT_H_
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// http://w3c.github.io/webrtc-pc/#rtcdtlstransport-interface
enum RTCDtlsTransportState {
"new",
"connecting",
"connected",
"closed",
"failed"
};
[
Exposed=Window,
RuntimeEnabled=RTCDtlsTransport
] interface RTCDtlsTransport : EventTarget {
readonly attribute RTCIceTransport iceTransport;
readonly attribute RTCDtlsTransportState state;
sequence<ArrayBuffer> getRemoteCertificates();
attribute EventHandler onstatechange;
attribute EventHandler onerror;
};
......@@ -1059,6 +1059,11 @@
origin_trial_feature_name: "RtcAudioJitterBufferMaxPackets",
status: "experimental",
},
// Enables the use of the RTCDtlsTransport object.
{
name: "RTCDtlsTransport",
status: "test",
},
// Enables the use of the RTCIceTransport with extensions.
{
name: "RTCIceTransportExtension",
......
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