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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 class MediaStreamTrack; | 49 class MediaStreamTrack; |
50 class RTCConfiguration; | 50 class RTCConfiguration; |
51 class RTCDTMFSender; | 51 class RTCDTMFSender; |
52 class RTCDataChannel; | 52 class RTCDataChannel; |
53 class RTCErrorCallback; | 53 class RTCErrorCallback; |
54 class RTCSessionDescription; | 54 class RTCSessionDescription; |
55 class RTCSessionDescriptionCallback; | 55 class RTCSessionDescriptionCallback; |
56 class RTCStatsCallback; | 56 class RTCStatsCallback; |
57 class VoidCallback; | 57 class VoidCallback; |
58 | 58 |
59 class RTCPeerConnection : public RefCounted<RTCPeerConnection>, public ScriptWra
ppable, public RTCPeerConnectionHandlerClient, public EventTarget, public Active
DOMObject { | 59 class RTCPeerConnection : public RefCounted<RTCPeerConnection>, public ScriptWra
ppable, public RTCPeerConnectionHandlerClient, public EventTargetWithInlineData,
public ActiveDOMObject { |
60 public: | 60 public: |
61 static PassRefPtr<RTCPeerConnection> create(ScriptExecutionContext*, const D
ictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionState&
); | 61 static PassRefPtr<RTCPeerConnection> create(ScriptExecutionContext*, const D
ictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionState&
); |
62 ~RTCPeerConnection(); | 62 ~RTCPeerConnection(); |
63 | 63 |
64 void createOffer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCEr
rorCallback>, const Dictionary& mediaConstraints, ExceptionState&); | 64 void createOffer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCEr
rorCallback>, const Dictionary& mediaConstraints, ExceptionState&); |
65 | 65 |
66 void createAnswer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCE
rrorCallback>, const Dictionary& mediaConstraints, ExceptionState&); | 66 void createAnswer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCE
rrorCallback>, const Dictionary& mediaConstraints, ExceptionState&); |
67 | 67 |
68 void setLocalDescription(PassRefPtr<RTCSessionDescription>, PassRefPtr<VoidC
allback>, PassRefPtr<RTCErrorCallback>, ExceptionState&); | 68 void setLocalDescription(PassRefPtr<RTCSessionDescription>, PassRefPtr<VoidC
allback>, PassRefPtr<RTCErrorCallback>, ExceptionState&); |
69 PassRefPtr<RTCSessionDescription> localDescription(ExceptionState&); | 69 PassRefPtr<RTCSessionDescription> localDescription(ExceptionState&); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 private: | 134 private: |
135 RTCPeerConnection(ScriptExecutionContext*, PassRefPtr<RTCConfiguration>, Pas
sRefPtr<MediaConstraints>, ExceptionState&); | 135 RTCPeerConnection(ScriptExecutionContext*, PassRefPtr<RTCConfiguration>, Pas
sRefPtr<MediaConstraints>, ExceptionState&); |
136 | 136 |
137 static PassRefPtr<RTCConfiguration> parseConfiguration(const Dictionary& con
figuration, ExceptionState&); | 137 static PassRefPtr<RTCConfiguration> parseConfiguration(const Dictionary& con
figuration, ExceptionState&); |
138 void scheduleDispatchEvent(PassRefPtr<Event>); | 138 void scheduleDispatchEvent(PassRefPtr<Event>); |
139 void scheduledEventTimerFired(Timer<RTCPeerConnection>*); | 139 void scheduledEventTimerFired(Timer<RTCPeerConnection>*); |
140 bool hasLocalStreamWithTrackId(const String& trackId); | 140 bool hasLocalStreamWithTrackId(const String& trackId); |
141 | 141 |
142 // EventTarget implementation. | 142 // EventTarget implementation. |
143 virtual EventTargetData* eventTargetData(); | 143 virtual void refEventTarget() OVERRIDE { ref(); } |
144 virtual EventTargetData* ensureEventTargetData(); | 144 virtual void derefEventTarget() OVERRIDE { deref(); } |
145 virtual void refEventTarget() { ref(); } | |
146 virtual void derefEventTarget() { deref(); } | |
147 EventTargetData m_eventTargetData; | |
148 | 145 |
149 void changeSignalingState(SignalingState); | 146 void changeSignalingState(SignalingState); |
150 void changeIceGatheringState(IceGatheringState); | 147 void changeIceGatheringState(IceGatheringState); |
151 void changeIceConnectionState(IceConnectionState); | 148 void changeIceConnectionState(IceConnectionState); |
152 | 149 |
153 SignalingState m_signalingState; | 150 SignalingState m_signalingState; |
154 IceGatheringState m_iceGatheringState; | 151 IceGatheringState m_iceGatheringState; |
155 IceConnectionState m_iceConnectionState; | 152 IceConnectionState m_iceConnectionState; |
156 | 153 |
157 MediaStreamVector m_localStreams; | 154 MediaStreamVector m_localStreams; |
158 MediaStreamVector m_remoteStreams; | 155 MediaStreamVector m_remoteStreams; |
159 | 156 |
160 Vector<RefPtr<RTCDataChannel> > m_dataChannels; | 157 Vector<RefPtr<RTCDataChannel> > m_dataChannels; |
161 | 158 |
162 OwnPtr<RTCPeerConnectionHandler> m_peerHandler; | 159 OwnPtr<RTCPeerConnectionHandler> m_peerHandler; |
163 | 160 |
164 Timer<RTCPeerConnection> m_scheduledEventTimer; | 161 Timer<RTCPeerConnection> m_scheduledEventTimer; |
165 Vector<RefPtr<Event> > m_scheduledEvents; | 162 Vector<RefPtr<Event> > m_scheduledEvents; |
166 | 163 |
167 bool m_stopped; | 164 bool m_stopped; |
168 }; | 165 }; |
169 | 166 |
170 } // namespace WebCore | 167 } // namespace WebCore |
171 | 168 |
172 #endif // RTCPeerConnection_h | 169 #endif // RTCPeerConnection_h |
OLD | NEW |