| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 { | 150 { |
| 151 return !m_closed && !m_stopped; | 151 return !m_closed && !m_stopped; |
| 152 } | 152 } |
| 153 | 153 |
| 154 // Oilpan: need to eagerly finalize m_peerHandler | 154 // Oilpan: need to eagerly finalize m_peerHandler |
| 155 EAGERLY_FINALIZE(); | 155 EAGERLY_FINALIZE(); |
| 156 DECLARE_VIRTUAL_TRACE(); | 156 DECLARE_VIRTUAL_TRACE(); |
| 157 | 157 |
| 158 private: | 158 private: |
| 159 typedef Function<bool()> BoolFunction; | 159 typedef Function<bool()> BoolFunction; |
| 160 class EventWrapper { | 160 class EventWrapper : public GarbageCollectedFinalized<EventWrapper> { |
| 161 public: | 161 public: |
| 162 EventWrapper(PassRefPtrWillBeRawPtr<Event>, PassOwnPtrWillBeRawPtr<BoolF
unction>); | 162 EventWrapper(PassRefPtrWillBeRawPtr<Event>, PassOwnPtr<BoolFunction>); |
| 163 // Returns true if |m_setupFunction| returns true or it is null. | 163 // Returns true if |m_setupFunction| returns true or it is null. |
| 164 // |m_event| will only be fired if setup() returns true; | 164 // |m_event| will only be fired if setup() returns true; |
| 165 bool setup(); | 165 bool setup(); |
| 166 | 166 |
| 167 DECLARE_TRACE(); |
| 168 |
| 167 RefPtrWillBeMember<Event> m_event; | 169 RefPtrWillBeMember<Event> m_event; |
| 168 | 170 |
| 169 private: | 171 private: |
| 170 PassOwnPtrWillBeRawPtr<BoolFunction> m_setupFunction; | 172 OwnPtr<BoolFunction> m_setupFunction; |
| 171 }; | 173 }; |
| 172 | 174 |
| 173 RTCPeerConnection(ExecutionContext*, RTCConfiguration*, WebMediaConstraints,
ExceptionState&); | 175 RTCPeerConnection(ExecutionContext*, RTCConfiguration*, WebMediaConstraints,
ExceptionState&); |
| 174 | 176 |
| 175 static RTCConfiguration* parseConfiguration(const Dictionary&, ExceptionStat
e&); | 177 static RTCConfiguration* parseConfiguration(const Dictionary&, ExceptionStat
e&); |
| 176 static RTCOfferOptions* parseOfferOptions(const Dictionary&, ExceptionState&
); | 178 static RTCOfferOptions* parseOfferOptions(const Dictionary&, ExceptionState&
); |
| 177 | 179 |
| 178 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 180 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); |
| 179 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>, PassOwnPtrWillBeRa
wPtr<BoolFunction>); | 181 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>, PassOwnPtr<BoolFun
ction>); |
| 180 void dispatchScheduledEvent(); | 182 void dispatchScheduledEvent(); |
| 181 bool hasLocalStreamWithTrackId(const String& trackId); | 183 bool hasLocalStreamWithTrackId(const String& trackId); |
| 182 | 184 |
| 183 void changeSignalingState(WebRTCPeerConnectionHandlerClient::SignalingState)
; | 185 void changeSignalingState(WebRTCPeerConnectionHandlerClient::SignalingState)
; |
| 184 void changeIceGatheringState(WebRTCPeerConnectionHandlerClient::ICEGathering
State); | 186 void changeIceGatheringState(WebRTCPeerConnectionHandlerClient::ICEGathering
State); |
| 185 // Changes the state immediately; does not fire an event. | 187 // Changes the state immediately; does not fire an event. |
| 186 // Returns true if the state was changed. | 188 // Returns true if the state was changed. |
| 187 bool setIceConnectionState(WebRTCPeerConnectionHandlerClient::ICEConnectionS
tate); | 189 bool setIceConnectionState(WebRTCPeerConnectionHandlerClient::ICEConnectionS
tate); |
| 188 // Changes the state asynchronously and fires an event immediately after cha
nging the state. | 190 // Changes the state asynchronously and fires an event immediately after cha
nging the state. |
| 189 void changeIceConnectionState(WebRTCPeerConnectionHandlerClient::ICEConnecti
onState); | 191 void changeIceConnectionState(WebRTCPeerConnectionHandlerClient::ICEConnecti
onState); |
| 190 | 192 |
| 191 void closeInternal(); | 193 void closeInternal(); |
| 192 | 194 |
| 193 SignalingState m_signalingState; | 195 SignalingState m_signalingState; |
| 194 ICEGatheringState m_iceGatheringState; | 196 ICEGatheringState m_iceGatheringState; |
| 195 ICEConnectionState m_iceConnectionState; | 197 ICEConnectionState m_iceConnectionState; |
| 196 | 198 |
| 197 MediaStreamVector m_localStreams; | 199 MediaStreamVector m_localStreams; |
| 198 MediaStreamVector m_remoteStreams; | 200 MediaStreamVector m_remoteStreams; |
| 199 | 201 |
| 200 HeapVector<Member<RTCDataChannel>> m_dataChannels; | 202 HeapVector<Member<RTCDataChannel>> m_dataChannels; |
| 201 | 203 |
| 202 OwnPtr<WebRTCPeerConnectionHandler> m_peerHandler; | 204 OwnPtr<WebRTCPeerConnectionHandler> m_peerHandler; |
| 203 | 205 |
| 204 AsyncMethodRunner<RTCPeerConnection> m_dispatchScheduledEventRunner; | 206 AsyncMethodRunner<RTCPeerConnection> m_dispatchScheduledEventRunner; |
| 205 WillBeHeapVector<EventWrapper> m_scheduledEvents; | 207 HeapVector<Member<EventWrapper>> m_scheduledEvents; |
| 206 | 208 |
| 207 bool m_stopped; | 209 bool m_stopped; |
| 208 bool m_closed; | 210 bool m_closed; |
| 209 }; | 211 }; |
| 210 | 212 |
| 211 } // namespace blink | 213 } // namespace blink |
| 212 | 214 |
| 213 #endif // RTCPeerConnection_h | 215 #endif // RTCPeerConnection_h |
| OLD | NEW |