| 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 21 matching lines...) Expand all Loading... |
| 32 #define RTCPeerConnection_h | 32 #define RTCPeerConnection_h |
| 33 | 33 |
| 34 #include "bindings/v8/Dictionary.h" | 34 #include "bindings/v8/Dictionary.h" |
| 35 #include "bindings/v8/ScriptWrappable.h" | 35 #include "bindings/v8/ScriptWrappable.h" |
| 36 #include "core/dom/ActiveDOMObject.h" | 36 #include "core/dom/ActiveDOMObject.h" |
| 37 #include "core/events/EventTarget.h" | 37 #include "core/events/EventTarget.h" |
| 38 #include "core/platform/mediastream/RTCPeerConnectionHandler.h" | 38 #include "core/platform/mediastream/RTCPeerConnectionHandler.h" |
| 39 #include "core/platform/mediastream/RTCPeerConnectionHandlerClient.h" | 39 #include "core/platform/mediastream/RTCPeerConnectionHandlerClient.h" |
| 40 #include "modules/mediastream/MediaStream.h" | 40 #include "modules/mediastream/MediaStream.h" |
| 41 #include "modules/mediastream/RTCIceCandidate.h" | 41 #include "modules/mediastream/RTCIceCandidate.h" |
| 42 #include "platform/Timer.h" | 42 #include "platform/AsyncMethodRunner.h" |
| 43 #include "wtf/RefCounted.h" | 43 #include "wtf/RefCounted.h" |
| 44 | 44 |
| 45 namespace WebCore { | 45 namespace WebCore { |
| 46 | 46 |
| 47 class ExceptionState; | 47 class ExceptionState; |
| 48 class MediaConstraints; | 48 class MediaConstraints; |
| 49 class MediaStreamTrack; | 49 class MediaStreamTrack; |
| 50 class RTCConfiguration; | 50 class RTCConfiguration; |
| 51 class RTCDTMFSender; | 51 class RTCDTMFSender; |
| 52 class RTCDataChannel; | 52 class RTCDataChannel; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 virtual void didChangeIceConnectionState(IceConnectionState) OVERRIDE; | 119 virtual void didChangeIceConnectionState(IceConnectionState) OVERRIDE; |
| 120 virtual void didAddRemoteStream(PassRefPtr<MediaStreamDescriptor>) OVERRIDE; | 120 virtual void didAddRemoteStream(PassRefPtr<MediaStreamDescriptor>) OVERRIDE; |
| 121 virtual void didRemoveRemoteStream(MediaStreamDescriptor*) OVERRIDE; | 121 virtual void didRemoveRemoteStream(MediaStreamDescriptor*) OVERRIDE; |
| 122 virtual void didAddRemoteDataChannel(PassOwnPtr<RTCDataChannelHandler>) OVER
RIDE; | 122 virtual void didAddRemoteDataChannel(PassOwnPtr<RTCDataChannelHandler>) OVER
RIDE; |
| 123 | 123 |
| 124 // EventTarget | 124 // EventTarget |
| 125 virtual const AtomicString& interfaceName() const OVERRIDE; | 125 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 126 virtual ExecutionContext* executionContext() const OVERRIDE; | 126 virtual ExecutionContext* executionContext() const OVERRIDE; |
| 127 | 127 |
| 128 // ActiveDOMObject | 128 // ActiveDOMObject |
| 129 virtual void suspend() OVERRIDE; |
| 130 virtual void resume() OVERRIDE; |
| 129 virtual void stop() OVERRIDE; | 131 virtual void stop() OVERRIDE; |
| 130 virtual bool hasPendingActivity() const OVERRIDE { return !m_stopped; } | 132 virtual bool hasPendingActivity() const OVERRIDE { return !m_stopped; } |
| 131 | 133 |
| 132 private: | 134 private: |
| 133 RTCPeerConnection(ExecutionContext*, PassRefPtr<RTCConfiguration>, PassRefPt
r<MediaConstraints>, ExceptionState&); | 135 RTCPeerConnection(ExecutionContext*, PassRefPtr<RTCConfiguration>, PassRefPt
r<MediaConstraints>, ExceptionState&); |
| 134 | 136 |
| 135 static PassRefPtr<RTCConfiguration> parseConfiguration(const Dictionary& con
figuration, ExceptionState&); | 137 static PassRefPtr<RTCConfiguration> parseConfiguration(const Dictionary& con
figuration, ExceptionState&); |
| 136 void scheduleDispatchEvent(PassRefPtr<Event>); | 138 void scheduleDispatchEvent(PassRefPtr<Event>); |
| 137 void scheduledEventTimerFired(Timer<RTCPeerConnection>*); | 139 void dispatchScheduledEvent(); |
| 138 bool hasLocalStreamWithTrackId(const String& trackId); | 140 bool hasLocalStreamWithTrackId(const String& trackId); |
| 139 | 141 |
| 140 void changeSignalingState(SignalingState); | 142 void changeSignalingState(SignalingState); |
| 141 void changeIceGatheringState(IceGatheringState); | 143 void changeIceGatheringState(IceGatheringState); |
| 142 void changeIceConnectionState(IceConnectionState); | 144 void changeIceConnectionState(IceConnectionState); |
| 143 | 145 |
| 144 SignalingState m_signalingState; | 146 SignalingState m_signalingState; |
| 145 IceGatheringState m_iceGatheringState; | 147 IceGatheringState m_iceGatheringState; |
| 146 IceConnectionState m_iceConnectionState; | 148 IceConnectionState m_iceConnectionState; |
| 147 | 149 |
| 148 MediaStreamVector m_localStreams; | 150 MediaStreamVector m_localStreams; |
| 149 MediaStreamVector m_remoteStreams; | 151 MediaStreamVector m_remoteStreams; |
| 150 | 152 |
| 151 Vector<RefPtr<RTCDataChannel> > m_dataChannels; | 153 Vector<RefPtr<RTCDataChannel> > m_dataChannels; |
| 152 | 154 |
| 153 OwnPtr<RTCPeerConnectionHandler> m_peerHandler; | 155 OwnPtr<RTCPeerConnectionHandler> m_peerHandler; |
| 154 | 156 |
| 155 Timer<RTCPeerConnection> m_scheduledEventTimer; | 157 AsyncMethodRunner<RTCPeerConnection> m_dispatchScheduledEventRunner; |
| 156 Vector<RefPtr<Event> > m_scheduledEvents; | 158 Vector<RefPtr<Event> > m_scheduledEvents; |
| 157 | 159 |
| 158 bool m_stopped; | 160 bool m_stopped; |
| 159 }; | 161 }; |
| 160 | 162 |
| 161 } // namespace WebCore | 163 } // namespace WebCore |
| 162 | 164 |
| 163 #endif // RTCPeerConnection_h | 165 #endif // RTCPeerConnection_h |
| OLD | NEW |