summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_ice_error_event.h
blob: e5baeff59c2bdc8e764bf5e155dad6a8f51afe4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright 2019 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_PEER_CONNECTION_ICE_ERROR_EVENT_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_PEER_CONNECTION_ICE_ERROR_EVENT_H_

#include "third_party/blink/renderer/modules/event_modules.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"

namespace blink {

class RTCPeerConnectionIceErrorEventInit;

class MODULES_EXPORT RTCPeerConnectionIceErrorEvent final : public Event {
  DEFINE_WRAPPERTYPEINFO();

 public:
  RTCPeerConnectionIceErrorEvent(const String& address,
                                 base::Optional<uint16_t> port,
                                 const String& host_candidate,
                                 const String& url,
                                 uint16_t error_code,
                                 const String& error_text);

  RTCPeerConnectionIceErrorEvent(const AtomicString& type,
                                 const RTCPeerConnectionIceErrorEventInit*);
  ~RTCPeerConnectionIceErrorEvent() override;

  static RTCPeerConnectionIceErrorEvent* Create(const String& address,
                                                base::Optional<uint16_t> port,
                                                const String& host_candidate,
                                                const String& url,
                                                int error_code,
                                                const String& error_text);

  static RTCPeerConnectionIceErrorEvent* Create(
      const AtomicString& type,
      const RTCPeerConnectionIceErrorEventInit*);

  String address() const;
  base::Optional<uint16_t> port() const;
  String hostCandidate() const;
  String url() const;
  uint16_t errorCode() const;
  String errorText() const;
  const AtomicString& InterfaceName() const override;

  void Trace(Visitor*) const override;

 private:
  String address_;
  base::Optional<uint16_t> port_;
  String host_candidate_;
  String url_;
  uint16_t error_code_;
  String error_text_;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_PEER_CONNECTION_ICE_ERROR_EVENT_H_