OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "public/platform/WebMediaConstraints.h" | 42 #include "public/platform/WebMediaConstraints.h" |
43 #include "public/platform/WebRTCPeerConnectionHandler.h" | 43 #include "public/platform/WebRTCPeerConnectionHandler.h" |
44 #include "public/platform/WebRTCPeerConnectionHandlerClient.h" | 44 #include "public/platform/WebRTCPeerConnectionHandlerClient.h" |
45 | 45 |
46 namespace blink { | 46 namespace blink { |
47 class ExceptionState; | 47 class ExceptionState; |
48 class MediaStreamTrack; | 48 class MediaStreamTrack; |
49 class RTCConfiguration; | 49 class RTCConfiguration; |
50 class RTCDTMFSender; | 50 class RTCDTMFSender; |
51 class RTCDataChannel; | 51 class RTCDataChannel; |
52 class RTCErrorCallback; | |
53 class RTCIceCandidateInitOrRTCIceCandidate; | 52 class RTCIceCandidateInitOrRTCIceCandidate; |
54 class RTCOfferOptions; | 53 class RTCOfferOptions; |
| 54 class RTCPeerConnectionErrorCallback; |
55 class RTCSessionDescription; | 55 class RTCSessionDescription; |
56 class RTCSessionDescriptionCallback; | 56 class RTCSessionDescriptionCallback; |
57 class RTCSessionDescriptionInit; | 57 class RTCSessionDescriptionInit; |
58 class RTCStatsCallback; | 58 class RTCStatsCallback; |
59 class ScriptState; | 59 class ScriptState; |
60 class VoidCallback; | 60 class VoidCallback; |
61 | 61 |
62 class RTCPeerConnection final | 62 class RTCPeerConnection final |
63 : public RefCountedGarbageCollectedEventTargetWithInlineData<RTCPeerConnecti
on> | 63 : public RefCountedGarbageCollectedEventTargetWithInlineData<RTCPeerConnecti
on> |
64 , public WebRTCPeerConnectionHandlerClient | 64 , public WebRTCPeerConnectionHandlerClient |
65 , public ActiveDOMObject { | 65 , public ActiveDOMObject { |
66 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCPeerConnection); | 66 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCPeerConnection); |
67 DEFINE_WRAPPERTYPEINFO(); | 67 DEFINE_WRAPPERTYPEINFO(); |
68 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection); | 68 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection); |
69 public: | 69 public: |
70 // TODO(hbos): Create with expired RTCCertificate should fail, see crbug.com
/565278. | 70 // TODO(hbos): Create with expired RTCCertificate should fail, see crbug.com
/565278. |
71 static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const
Dictionary&, ExceptionState&); | 71 static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const
Dictionary&, ExceptionState&); |
72 ~RTCPeerConnection() override; | 72 ~RTCPeerConnection() override; |
73 | 73 |
74 void createOffer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCError
Callback*, const Dictionary&, ExceptionState&); | 74 void createOffer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCPeerC
onnectionErrorCallback*, const Dictionary&, ExceptionState&); |
75 | 75 void createAnswer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCPeer
ConnectionErrorCallback*, const Dictionary&, ExceptionState&); |
76 void createAnswer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCErro
rCallback*, const Dictionary&, ExceptionState&); | |
77 | 76 |
78 ScriptPromise setLocalDescription(ScriptState*, const RTCSessionDescriptionI
nit&); | 77 ScriptPromise setLocalDescription(ScriptState*, const RTCSessionDescriptionI
nit&); |
79 ScriptPromise setLocalDescription(ScriptState*, RTCSessionDescription*, Void
Callback*, RTCErrorCallback*); | 78 ScriptPromise setLocalDescription(ScriptState*, RTCSessionDescription*, Void
Callback*, RTCPeerConnectionErrorCallback*); |
80 RTCSessionDescription* localDescription(); | 79 RTCSessionDescription* localDescription(); |
81 | 80 |
82 ScriptPromise setRemoteDescription(ScriptState*, const RTCSessionDescription
Init&); | 81 ScriptPromise setRemoteDescription(ScriptState*, const RTCSessionDescription
Init&); |
83 ScriptPromise setRemoteDescription(ScriptState*, RTCSessionDescription*, Voi
dCallback*, RTCErrorCallback*); | 82 ScriptPromise setRemoteDescription(ScriptState*, RTCSessionDescription*, Voi
dCallback*, RTCPeerConnectionErrorCallback*); |
84 RTCSessionDescription* remoteDescription(); | 83 RTCSessionDescription* remoteDescription(); |
85 | 84 |
86 String signalingState() const; | 85 String signalingState() const; |
87 | 86 |
88 void updateIce(ExecutionContext*, const Dictionary& rtcConfiguration, const
Dictionary& mediaConstraints, ExceptionState&); | 87 void updateIce(ExecutionContext*, const Dictionary& rtcConfiguration, const
Dictionary& mediaConstraints, ExceptionState&); |
89 | 88 |
90 // Certificate management | 89 // Certificate management |
91 // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt | 90 // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt |
92 static ScriptPromise generateCertificate(ScriptState*, const AlgorithmIdenti
fier& keygenAlgorithm, ExceptionState&); | 91 static ScriptPromise generateCertificate(ScriptState*, const AlgorithmIdenti
fier& keygenAlgorithm, ExceptionState&); |
93 | 92 |
94 ScriptPromise addIceCandidate(ScriptState*, const RTCIceCandidateInitOrRTCIc
eCandidate&); | 93 ScriptPromise addIceCandidate(ScriptState*, const RTCIceCandidateInitOrRTCIc
eCandidate&); |
95 ScriptPromise addIceCandidate(ScriptState*, RTCIceCandidate*, VoidCallback*,
RTCErrorCallback*); | 94 ScriptPromise addIceCandidate(ScriptState*, RTCIceCandidate*, VoidCallback*,
RTCPeerConnectionErrorCallback*); |
96 | 95 |
97 String iceGatheringState() const; | 96 String iceGatheringState() const; |
98 | 97 |
99 String iceConnectionState() const; | 98 String iceConnectionState() const; |
100 | 99 |
101 MediaStreamVector getLocalStreams() const; | 100 MediaStreamVector getLocalStreams() const; |
102 | 101 |
103 MediaStreamVector getRemoteStreams() const; | 102 MediaStreamVector getRemoteStreams() const; |
104 | 103 |
105 MediaStream* getStreamById(const String& streamId); | 104 MediaStream* getStreamById(const String& streamId); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 Member<AsyncMethodRunner<RTCPeerConnection>> m_dispatchScheduledEventRunner; | 206 Member<AsyncMethodRunner<RTCPeerConnection>> m_dispatchScheduledEventRunner; |
208 HeapVector<Member<EventWrapper>> m_scheduledEvents; | 207 HeapVector<Member<EventWrapper>> m_scheduledEvents; |
209 | 208 |
210 bool m_stopped; | 209 bool m_stopped; |
211 bool m_closed; | 210 bool m_closed; |
212 }; | 211 }; |
213 | 212 |
214 } // namespace blink | 213 } // namespace blink |
215 | 214 |
216 #endif // RTCPeerConnection_h | 215 #endif // RTCPeerConnection_h |
OLD | NEW |