diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_ice_error_event.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_ice_error_event.cc | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/chromium/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_ice_error_event.cc b/chromium/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_ice_error_event.cc index 3f2b7f60712..5e51a132b1c 100644 --- a/chromium/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_ice_error_event.cc +++ b/chromium/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_ice_error_event.cc @@ -2,20 +2,23 @@ // 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/core/event_type_names.h" #include "third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_ice_error_event.h" -#include "third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_ice_error_event_init.h" +#include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_peer_connection_ice_error_event_init.h" +#include "third_party/blink/renderer/core/event_type_names.h" namespace blink { RTCPeerConnectionIceErrorEvent* RTCPeerConnectionIceErrorEvent::Create( + const String& address, + base::Optional<uint16_t> port, const String& host_candidate, const String& url, int error_code, const String& txt) { DCHECK(error_code > 0 && error_code <= USHRT_MAX); return MakeGarbageCollected<RTCPeerConnectionIceErrorEvent>( - host_candidate, url, static_cast<uint16_t>(error_code), txt); + address, port, host_candidate, url, static_cast<uint16_t>(error_code), + txt); } RTCPeerConnectionIceErrorEvent* RTCPeerConnectionIceErrorEvent::Create( @@ -26,6 +29,8 @@ RTCPeerConnectionIceErrorEvent* RTCPeerConnectionIceErrorEvent::Create( } RTCPeerConnectionIceErrorEvent::RTCPeerConnectionIceErrorEvent( + const String& address, + base::Optional<uint16_t> port, const String& host_candidate, const String& url, uint16_t error_code, @@ -33,6 +38,8 @@ RTCPeerConnectionIceErrorEvent::RTCPeerConnectionIceErrorEvent( : Event(event_type_names::kIcecandidateerror, Bubbles::kNo, Cancelable::kNo), + address_(address), + port_(port), host_candidate_(host_candidate), url_(url), error_code_(error_code), @@ -42,6 +49,8 @@ RTCPeerConnectionIceErrorEvent::RTCPeerConnectionIceErrorEvent( const AtomicString& type, const RTCPeerConnectionIceErrorEventInit* initializer) : Event(type, initializer), + address_(initializer->address()), + port_(initializer->port()), host_candidate_(initializer->hostCandidate()), url_(initializer->url()), error_code_(initializer->errorCode()), @@ -49,6 +58,19 @@ RTCPeerConnectionIceErrorEvent::RTCPeerConnectionIceErrorEvent( RTCPeerConnectionIceErrorEvent::~RTCPeerConnectionIceErrorEvent() = default; +String RTCPeerConnectionIceErrorEvent::address() const { + return address_; +} + +base::Optional<uint16_t> RTCPeerConnectionIceErrorEvent::port() const { + return port_; +} + +uint16_t RTCPeerConnectionIceErrorEvent::port(bool& is_null) const { + is_null = !port_.has_value(); + return is_null ? uint16_t() : port_.value(); +} + String RTCPeerConnectionIceErrorEvent::hostCandidate() const { return host_candidate_; } @@ -69,7 +91,7 @@ const AtomicString& RTCPeerConnectionIceErrorEvent::InterfaceName() const { return event_interface_names::kRTCPeerConnectionIceErrorEvent; } -void RTCPeerConnectionIceErrorEvent::Trace(blink::Visitor* visitor) { +void RTCPeerConnectionIceErrorEvent::Trace(Visitor* visitor) { Event::Trace(visitor); } |