| 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef RTCPeerConnection_h | 31 #ifndef RTCPeerConnection_h |
| 32 #define RTCPeerConnection_h | 32 #define RTCPeerConnection_h |
| 33 | 33 |
| 34 #include "bindings/core/v8/Dictionary.h" | 34 #include "bindings/core/v8/Dictionary.h" |
| 35 #include "core/dom/ActiveDOMObject.h" | 35 #include "core/dom/ActiveDOMObject.h" |
| 36 #include "modules/EventTargetModules.h" | 36 #include "modules/EventTargetModules.h" |
| 37 #include "modules/mediastream/MediaStream.h" | 37 #include "modules/mediastream/MediaStream.h" |
| 38 #include "modules/mediastream/RTCIceCandidate.h" | 38 #include "modules/mediastream/RTCIceCandidate.h" |
| 39 #include "modules/mediastream/RTCVoidRequestImpl.h" | |
| 40 #include "platform/AsyncMethodRunner.h" | 39 #include "platform/AsyncMethodRunner.h" |
| 41 #include "public/platform/WebMediaConstraints.h" | 40 #include "public/platform/WebMediaConstraints.h" |
| 42 #include "public/platform/WebRTCPeerConnectionHandler.h" | 41 #include "public/platform/WebRTCPeerConnectionHandler.h" |
| 43 #include "public/platform/WebRTCPeerConnectionHandlerClient.h" | 42 #include "public/platform/WebRTCPeerConnectionHandlerClient.h" |
| 44 | 43 |
| 45 namespace blink { | 44 namespace blink { |
| 46 | 45 |
| 47 class ExceptionState; | 46 class ExceptionState; |
| 48 class MediaStreamTrack; | 47 class MediaStreamTrack; |
| 49 class RTCConfiguration; | 48 class RTCConfiguration; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 65 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection); | 64 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection); |
| 66 public: | 65 public: |
| 67 static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const
Dictionary&, ExceptionState&); | 66 static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const
Dictionary&, ExceptionState&); |
| 68 virtual ~RTCPeerConnection(); | 67 virtual ~RTCPeerConnection(); |
| 69 | 68 |
| 70 void createOffer(RTCSessionDescriptionCallback*, RTCErrorCallback*, const Di
ctionary&, ExceptionState&); | 69 void createOffer(RTCSessionDescriptionCallback*, RTCErrorCallback*, const Di
ctionary&, ExceptionState&); |
| 71 | 70 |
| 72 void createAnswer(RTCSessionDescriptionCallback*, RTCErrorCallback*, const D
ictionary&, ExceptionState&); | 71 void createAnswer(RTCSessionDescriptionCallback*, RTCErrorCallback*, const D
ictionary&, ExceptionState&); |
| 73 | 72 |
| 74 void setLocalDescription(RTCSessionDescription*, VoidCallback*, RTCErrorCall
back*, ExceptionState&); | 73 void setLocalDescription(RTCSessionDescription*, VoidCallback*, RTCErrorCall
back*, ExceptionState&); |
| 75 RTCSessionDescription* localDescription(); | 74 RTCSessionDescription* localDescription(ExceptionState&); |
| 76 | 75 |
| 77 void setRemoteDescription(RTCSessionDescription*, VoidCallback*, RTCErrorCal
lback*, ExceptionState&); | 76 void setRemoteDescription(RTCSessionDescription*, VoidCallback*, RTCErrorCal
lback*, ExceptionState&); |
| 78 RTCSessionDescription* remoteDescription(); | 77 RTCSessionDescription* remoteDescription(ExceptionState&); |
| 79 | 78 |
| 80 String signalingState() const; | 79 String signalingState() const; |
| 81 | 80 |
| 82 void updateIce(const Dictionary& rtcConfiguration, const Dictionary& mediaCo
nstraints, ExceptionState&); | 81 void updateIce(const Dictionary& rtcConfiguration, const Dictionary& mediaCo
nstraints, ExceptionState&); |
| 83 | 82 |
| 84 // DEPRECATED | 83 // DEPRECATED |
| 85 void addIceCandidate(RTCIceCandidate*, ExceptionState&); | 84 void addIceCandidate(RTCIceCandidate*, ExceptionState&); |
| 86 | 85 |
| 87 void addIceCandidate(RTCIceCandidate*, VoidCallback*, RTCErrorCallback*, Exc
eptionState&); | 86 void addIceCandidate(RTCIceCandidate*, VoidCallback*, RTCErrorCallback*, Exc
eptionState&); |
| 88 | 87 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 104 | 103 |
| 105 RTCDataChannel* createDataChannel(String label, const Dictionary& dataChanne
lDict, ExceptionState&); | 104 RTCDataChannel* createDataChannel(String label, const Dictionary& dataChanne
lDict, ExceptionState&); |
| 106 | 105 |
| 107 RTCDTMFSender* createDTMFSender(MediaStreamTrack*, ExceptionState&); | 106 RTCDTMFSender* createDTMFSender(MediaStreamTrack*, ExceptionState&); |
| 108 | 107 |
| 109 void close(ExceptionState&); | 108 void close(ExceptionState&); |
| 110 | 109 |
| 111 // We allow getStats after close, but not other calls or callbacks. | 110 // We allow getStats after close, but not other calls or callbacks. |
| 112 bool shouldFireDefaultCallbacks() { return !m_closed && !m_stopped; } | 111 bool shouldFireDefaultCallbacks() { return !m_closed && !m_stopped; } |
| 113 bool shouldFireGetStatsCallback() { return !m_stopped; } | 112 bool shouldFireGetStatsCallback() { return !m_stopped; } |
| 114 void requestSucceeded(RTCVoidRequestImpl::RequestType); | |
| 115 | 113 |
| 116 DEFINE_ATTRIBUTE_EVENT_LISTENER(negotiationneeded); | 114 DEFINE_ATTRIBUTE_EVENT_LISTENER(negotiationneeded); |
| 117 DEFINE_ATTRIBUTE_EVENT_LISTENER(icecandidate); | 115 DEFINE_ATTRIBUTE_EVENT_LISTENER(icecandidate); |
| 118 DEFINE_ATTRIBUTE_EVENT_LISTENER(signalingstatechange); | 116 DEFINE_ATTRIBUTE_EVENT_LISTENER(signalingstatechange); |
| 119 DEFINE_ATTRIBUTE_EVENT_LISTENER(addstream); | 117 DEFINE_ATTRIBUTE_EVENT_LISTENER(addstream); |
| 120 DEFINE_ATTRIBUTE_EVENT_LISTENER(removestream); | 118 DEFINE_ATTRIBUTE_EVENT_LISTENER(removestream); |
| 121 DEFINE_ATTRIBUTE_EVENT_LISTENER(iceconnectionstatechange); | 119 DEFINE_ATTRIBUTE_EVENT_LISTENER(iceconnectionstatechange); |
| 122 DEFINE_ATTRIBUTE_EVENT_LISTENER(datachannel); | 120 DEFINE_ATTRIBUTE_EVENT_LISTENER(datachannel); |
| 123 | 121 |
| 124 // WebRTCPeerConnectionHandlerClient | 122 // WebRTCPeerConnectionHandlerClient |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 157 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); |
| 160 void dispatchScheduledEvent(); | 158 void dispatchScheduledEvent(); |
| 161 bool hasLocalStreamWithTrackId(const String& trackId); | 159 bool hasLocalStreamWithTrackId(const String& trackId); |
| 162 | 160 |
| 163 void changeSignalingState(WebRTCPeerConnectionHandlerClient::SignalingState)
; | 161 void changeSignalingState(WebRTCPeerConnectionHandlerClient::SignalingState)
; |
| 164 void changeIceGatheringState(WebRTCPeerConnectionHandlerClient::ICEGathering
State); | 162 void changeIceGatheringState(WebRTCPeerConnectionHandlerClient::ICEGathering
State); |
| 165 void changeIceConnectionState(WebRTCPeerConnectionHandlerClient::ICEConnecti
onState); | 163 void changeIceConnectionState(WebRTCPeerConnectionHandlerClient::ICEConnecti
onState); |
| 166 | 164 |
| 167 void closeInternal(); | 165 void closeInternal(); |
| 168 | 166 |
| 169 void commitPendingLocalSessionDescription(); | |
| 170 void commitPendingRemoteSessionDescription(); | |
| 171 | |
| 172 Member<RTCSessionDescription> m_localDescription; | |
| 173 Member<RTCSessionDescription> m_remoteDescription; | |
| 174 Member<RTCSessionDescription> m_pendingLocalDescription; | |
| 175 Member<RTCSessionDescription> m_pendingRemoteDescription; | |
| 176 | |
| 177 SignalingState m_signalingState; | 167 SignalingState m_signalingState; |
| 178 ICEGatheringState m_iceGatheringState; | 168 ICEGatheringState m_iceGatheringState; |
| 179 ICEConnectionState m_iceConnectionState; | 169 ICEConnectionState m_iceConnectionState; |
| 180 | 170 |
| 181 MediaStreamVector m_localStreams; | 171 MediaStreamVector m_localStreams; |
| 182 MediaStreamVector m_remoteStreams; | 172 MediaStreamVector m_remoteStreams; |
| 183 | 173 |
| 184 HeapVector<Member<RTCDataChannel>> m_dataChannels; | 174 HeapVector<Member<RTCDataChannel>> m_dataChannels; |
| 185 | 175 |
| 186 OwnPtr<WebRTCPeerConnectionHandler> m_peerHandler; | 176 OwnPtr<WebRTCPeerConnectionHandler> m_peerHandler; |
| 187 | 177 |
| 188 AsyncMethodRunner<RTCPeerConnection> m_dispatchScheduledEventRunner; | 178 AsyncMethodRunner<RTCPeerConnection> m_dispatchScheduledEventRunner; |
| 189 WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; | 179 WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; |
| 190 | 180 |
| 191 bool m_stopped; | 181 bool m_stopped; |
| 192 bool m_closed; | 182 bool m_closed; |
| 193 }; | 183 }; |
| 194 | 184 |
| 195 } // namespace blink | 185 } // namespace blink |
| 196 | 186 |
| 197 #endif // RTCPeerConnection_h | 187 #endif // RTCPeerConnection_h |
| OLD | NEW |