| 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 FINAL : public RefCounted<RTCPeerConnection>, public Scr
iptWrappable, public blink::WebRTCPeerConnectionHandlerClient, public EventTarge
tWithInlineData, public ActiveDOMObject { | 59 class RTCPeerConnection FINAL : public RefCountedWillBeRefCountedGarbageCollecte
d<RTCPeerConnection>, public ScriptWrappable, public blink::WebRTCPeerConnection
HandlerClient, public EventTargetWithInlineData, public ActiveDOMObject { |
| 60 REFCOUNTED_EVENT_TARGET(RTCPeerConnection); | 60 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<R
TCPeerConnection>); |
| 61 public: | 61 public: |
| 62 static PassRefPtr<RTCPeerConnection> create(ExecutionContext*, const Diction
ary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionState&); | 62 static PassRefPtrWillBeRawPtr<RTCPeerConnection> create(ExecutionContext*, c
onst Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, Exception
State&); |
| 63 virtual ~RTCPeerConnection(); | 63 virtual ~RTCPeerConnection(); |
| 64 | 64 |
| 65 void createOffer(PassOwnPtr<RTCSessionDescriptionCallback>, PassOwnPtr<RTCEr
rorCallback>, const Dictionary& mediaConstraints, ExceptionState&); | 65 void createOffer(PassOwnPtr<RTCSessionDescriptionCallback>, PassOwnPtr<RTCEr
rorCallback>, const Dictionary& mediaConstraints, ExceptionState&); |
| 66 | 66 |
| 67 void createAnswer(PassOwnPtr<RTCSessionDescriptionCallback>, PassOwnPtr<RTCE
rrorCallback>, const Dictionary& mediaConstraints, ExceptionState&); | 67 void createAnswer(PassOwnPtr<RTCSessionDescriptionCallback>, PassOwnPtr<RTCE
rrorCallback>, const Dictionary& mediaConstraints, ExceptionState&); |
| 68 | 68 |
| 69 void setLocalDescription(PassRefPtr<RTCSessionDescription>, PassOwnPtr<VoidC
allback>, PassOwnPtr<RTCErrorCallback>, ExceptionState&); | 69 void setLocalDescription(PassRefPtrWillBeRawPtr<RTCSessionDescription>, Pass
OwnPtr<VoidCallback>, PassOwnPtr<RTCErrorCallback>, ExceptionState&); |
| 70 PassRefPtr<RTCSessionDescription> localDescription(ExceptionState&); | 70 PassRefPtrWillBeRawPtr<RTCSessionDescription> localDescription(ExceptionStat
e&); |
| 71 | 71 |
| 72 void setRemoteDescription(PassRefPtr<RTCSessionDescription>, PassOwnPtr<Void
Callback>, PassOwnPtr<RTCErrorCallback>, ExceptionState&); | 72 void setRemoteDescription(PassRefPtrWillBeRawPtr<RTCSessionDescription>, Pas
sOwnPtr<VoidCallback>, PassOwnPtr<RTCErrorCallback>, ExceptionState&); |
| 73 PassRefPtr<RTCSessionDescription> remoteDescription(ExceptionState&); | 73 PassRefPtrWillBeRawPtr<RTCSessionDescription> remoteDescription(ExceptionSta
te&); |
| 74 | 74 |
| 75 String signalingState() const; | 75 String signalingState() const; |
| 76 | 76 |
| 77 void updateIce(const Dictionary& rtcConfiguration, const Dictionary& mediaCo
nstraints, ExceptionState&); | 77 void updateIce(const Dictionary& rtcConfiguration, const Dictionary& mediaCo
nstraints, ExceptionState&); |
| 78 | 78 |
| 79 // DEPRECATED | 79 // DEPRECATED |
| 80 void addIceCandidate(RTCIceCandidate*, ExceptionState&); | 80 void addIceCandidate(RTCIceCandidate*, ExceptionState&); |
| 81 | 81 |
| 82 void addIceCandidate(RTCIceCandidate*, PassOwnPtr<VoidCallback>, PassOwnPtr<
RTCErrorCallback>, ExceptionState&); | 82 void addIceCandidate(RTCIceCandidate*, PassOwnPtr<VoidCallback>, PassOwnPtr<
RTCErrorCallback>, ExceptionState&); |
| 83 | 83 |
| 84 String iceGatheringState() const; | 84 String iceGatheringState() const; |
| 85 | 85 |
| 86 String iceConnectionState() const; | 86 String iceConnectionState() const; |
| 87 | 87 |
| 88 MediaStreamVector getLocalStreams() const; | 88 MediaStreamVector getLocalStreams() const; |
| 89 | 89 |
| 90 MediaStreamVector getRemoteStreams() const; | 90 MediaStreamVector getRemoteStreams() const; |
| 91 | 91 |
| 92 MediaStream* getStreamById(const String& streamId); | 92 MediaStream* getStreamById(const String& streamId); |
| 93 | 93 |
| 94 void addStream(PassRefPtr<MediaStream>, const Dictionary& mediaConstraints,
ExceptionState&); | 94 void addStream(PassRefPtrWillBeRawPtr<MediaStream>, const Dictionary& mediaC
onstraints, ExceptionState&); |
| 95 | 95 |
| 96 void removeStream(PassRefPtr<MediaStream>, ExceptionState&); | 96 void removeStream(PassRefPtrWillBeRawPtr<MediaStream>, ExceptionState&); |
| 97 | 97 |
| 98 void getStats(PassOwnPtr<RTCStatsCallback> successCallback, PassRefPtr<Media
StreamTrack> selector); | 98 void getStats(PassOwnPtr<RTCStatsCallback> successCallback, PassRefPtr<Media
StreamTrack> selector); |
| 99 | 99 |
| 100 PassRefPtr<RTCDataChannel> createDataChannel(String label, const Dictionary&
dataChannelDict, ExceptionState&); | 100 PassRefPtrWillBeRawPtr<RTCDataChannel> createDataChannel(String label, const
Dictionary& dataChannelDict, ExceptionState&); |
| 101 | 101 |
| 102 PassRefPtr<RTCDTMFSender> createDTMFSender(PassRefPtr<MediaStreamTrack>, Exc
eptionState&); | 102 PassRefPtrWillBeRawPtr<RTCDTMFSender> createDTMFSender(PassRefPtrWillBeRawPt
r<MediaStreamTrack>, ExceptionState&); |
| 103 | 103 |
| 104 void close(ExceptionState&); | 104 void close(ExceptionState&); |
| 105 | 105 |
| 106 DEFINE_ATTRIBUTE_EVENT_LISTENER(negotiationneeded); | 106 DEFINE_ATTRIBUTE_EVENT_LISTENER(negotiationneeded); |
| 107 DEFINE_ATTRIBUTE_EVENT_LISTENER(icecandidate); | 107 DEFINE_ATTRIBUTE_EVENT_LISTENER(icecandidate); |
| 108 DEFINE_ATTRIBUTE_EVENT_LISTENER(signalingstatechange); | 108 DEFINE_ATTRIBUTE_EVENT_LISTENER(signalingstatechange); |
| 109 DEFINE_ATTRIBUTE_EVENT_LISTENER(addstream); | 109 DEFINE_ATTRIBUTE_EVENT_LISTENER(addstream); |
| 110 DEFINE_ATTRIBUTE_EVENT_LISTENER(removestream); | 110 DEFINE_ATTRIBUTE_EVENT_LISTENER(removestream); |
| 111 DEFINE_ATTRIBUTE_EVENT_LISTENER(iceconnectionstatechange); | 111 DEFINE_ATTRIBUTE_EVENT_LISTENER(iceconnectionstatechange); |
| 112 DEFINE_ATTRIBUTE_EVENT_LISTENER(datachannel); | 112 DEFINE_ATTRIBUTE_EVENT_LISTENER(datachannel); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 125 // EventTarget | 125 // EventTarget |
| 126 virtual const AtomicString& interfaceName() const OVERRIDE; | 126 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 127 virtual ExecutionContext* executionContext() const OVERRIDE; | 127 virtual ExecutionContext* executionContext() const OVERRIDE; |
| 128 | 128 |
| 129 // ActiveDOMObject | 129 // ActiveDOMObject |
| 130 virtual void suspend() OVERRIDE; | 130 virtual void suspend() OVERRIDE; |
| 131 virtual void resume() OVERRIDE; | 131 virtual void resume() OVERRIDE; |
| 132 virtual void stop() OVERRIDE; | 132 virtual void stop() OVERRIDE; |
| 133 virtual bool hasPendingActivity() const OVERRIDE { return !m_stopped; } | 133 virtual bool hasPendingActivity() const OVERRIDE { return !m_stopped; } |
| 134 | 134 |
| 135 void trace(Visitor*); |
| 136 |
| 135 private: | 137 private: |
| 136 RTCPeerConnection(ExecutionContext*, PassRefPtr<RTCConfiguration>, blink::We
bMediaConstraints, ExceptionState&); | 138 RTCPeerConnection(ExecutionContext*, PassRefPtr<RTCConfiguration>, blink::We
bMediaConstraints, ExceptionState&); |
| 137 | 139 |
| 138 static PassRefPtr<RTCConfiguration> parseConfiguration(const Dictionary& con
figuration, ExceptionState&); | 140 static PassRefPtr<RTCConfiguration> parseConfiguration(const Dictionary& con
figuration, ExceptionState&); |
| 139 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 141 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); |
| 140 void dispatchScheduledEvent(); | 142 void dispatchScheduledEvent(); |
| 141 bool hasLocalStreamWithTrackId(const String& trackId); | 143 bool hasLocalStreamWithTrackId(const String& trackId); |
| 142 | 144 |
| 143 void changeSignalingState(blink::WebRTCPeerConnectionHandlerClient::Signalin
gState); | 145 void changeSignalingState(blink::WebRTCPeerConnectionHandlerClient::Signalin
gState); |
| 144 void changeIceGatheringState(blink::WebRTCPeerConnectionHandlerClient::ICEGa
theringState); | 146 void changeIceGatheringState(blink::WebRTCPeerConnectionHandlerClient::ICEGa
theringState); |
| 145 void changeIceConnectionState(blink::WebRTCPeerConnectionHandlerClient::ICEC
onnectionState); | 147 void changeIceConnectionState(blink::WebRTCPeerConnectionHandlerClient::ICEC
onnectionState); |
| 146 | 148 |
| 147 SignalingState m_signalingState; | 149 SignalingState m_signalingState; |
| 148 ICEGatheringState m_iceGatheringState; | 150 ICEGatheringState m_iceGatheringState; |
| 149 ICEConnectionState m_iceConnectionState; | 151 ICEConnectionState m_iceConnectionState; |
| 150 | 152 |
| 151 MediaStreamVector m_localStreams; | 153 MediaStreamVector m_localStreams; |
| 152 MediaStreamVector m_remoteStreams; | 154 MediaStreamVector m_remoteStreams; |
| 153 | 155 |
| 154 Vector<RefPtr<RTCDataChannel> > m_dataChannels; | 156 WillBeHeapVector<RefPtrWillBeMember<RTCDataChannel> > m_dataChannels; |
| 155 | 157 |
| 156 OwnPtr<blink::WebRTCPeerConnectionHandler> m_peerHandler; | 158 OwnPtr<blink::WebRTCPeerConnectionHandler> m_peerHandler; |
| 157 | 159 |
| 158 AsyncMethodRunner<RTCPeerConnection> m_dispatchScheduledEventRunner; | 160 AsyncMethodRunner<RTCPeerConnection> m_dispatchScheduledEventRunner; |
| 159 WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; | 161 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; |
| 160 | 162 |
| 161 bool m_stopped; | 163 bool m_stopped; |
| 162 }; | 164 }; |
| 163 | 165 |
| 164 } // namespace WebCore | 166 } // namespace WebCore |
| 165 | 167 |
| 166 #endif // RTCPeerConnection_h | 168 #endif // RTCPeerConnection_h |
| OLD | NEW |