Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: Source/modules/mediastream/RTCPeerConnection.h

Issue 1010393002: Fix issue of localDescription and remoteDescription getter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix test case crash. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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"
39 #include "platform/AsyncMethodRunner.h" 40 #include "platform/AsyncMethodRunner.h"
40 #include "public/platform/WebMediaConstraints.h" 41 #include "public/platform/WebMediaConstraints.h"
41 #include "public/platform/WebRTCPeerConnectionHandler.h" 42 #include "public/platform/WebRTCPeerConnectionHandler.h"
42 #include "public/platform/WebRTCPeerConnectionHandlerClient.h" 43 #include "public/platform/WebRTCPeerConnectionHandlerClient.h"
43 44
44 namespace blink { 45 namespace blink {
45 46
46 class ExceptionState; 47 class ExceptionState;
47 class MediaStreamTrack; 48 class MediaStreamTrack;
48 class RTCConfiguration; 49 class RTCConfiguration;
(...skipping 15 matching lines...) Expand all
64 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection); 65 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection);
65 public: 66 public:
66 static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const Dictionary&, ExceptionState&); 67 static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const Dictionary&, ExceptionState&);
67 virtual ~RTCPeerConnection(); 68 virtual ~RTCPeerConnection();
68 69
69 void createOffer(RTCSessionDescriptionCallback*, RTCErrorCallback*, const Di ctionary&, ExceptionState&); 70 void createOffer(RTCSessionDescriptionCallback*, RTCErrorCallback*, const Di ctionary&, ExceptionState&);
70 71
71 void createAnswer(RTCSessionDescriptionCallback*, RTCErrorCallback*, const D ictionary&, ExceptionState&); 72 void createAnswer(RTCSessionDescriptionCallback*, RTCErrorCallback*, const D ictionary&, ExceptionState&);
72 73
73 void setLocalDescription(RTCSessionDescription*, VoidCallback*, RTCErrorCall back*, ExceptionState&); 74 void setLocalDescription(RTCSessionDescription*, VoidCallback*, RTCErrorCall back*, ExceptionState&);
74 RTCSessionDescription* localDescription(ExceptionState&); 75 RTCSessionDescription* localDescription();
75 76
76 void setRemoteDescription(RTCSessionDescription*, VoidCallback*, RTCErrorCal lback*, ExceptionState&); 77 void setRemoteDescription(RTCSessionDescription*, VoidCallback*, RTCErrorCal lback*, ExceptionState&);
77 RTCSessionDescription* remoteDescription(ExceptionState&); 78 RTCSessionDescription* remoteDescription();
78 79
79 String signalingState() const; 80 String signalingState() const;
80 81
81 void updateIce(const Dictionary& rtcConfiguration, const Dictionary& mediaCo nstraints, ExceptionState&); 82 void updateIce(const Dictionary& rtcConfiguration, const Dictionary& mediaCo nstraints, ExceptionState&);
82 83
83 // DEPRECATED 84 // DEPRECATED
84 void addIceCandidate(RTCIceCandidate*, ExceptionState&); 85 void addIceCandidate(RTCIceCandidate*, ExceptionState&);
85 86
86 void addIceCandidate(RTCIceCandidate*, VoidCallback*, RTCErrorCallback*, Exc eptionState&); 87 void addIceCandidate(RTCIceCandidate*, VoidCallback*, RTCErrorCallback*, Exc eptionState&);
87 88
(...skipping 15 matching lines...) Expand all
103 104
104 RTCDataChannel* createDataChannel(String label, const Dictionary& dataChanne lDict, ExceptionState&); 105 RTCDataChannel* createDataChannel(String label, const Dictionary& dataChanne lDict, ExceptionState&);
105 106
106 RTCDTMFSender* createDTMFSender(MediaStreamTrack*, ExceptionState&); 107 RTCDTMFSender* createDTMFSender(MediaStreamTrack*, ExceptionState&);
107 108
108 void close(ExceptionState&); 109 void close(ExceptionState&);
109 110
110 // We allow getStats after close, but not other calls or callbacks. 111 // We allow getStats after close, but not other calls or callbacks.
111 bool shouldFireDefaultCallbacks() { return !m_closed && !m_stopped; } 112 bool shouldFireDefaultCallbacks() { return !m_closed && !m_stopped; }
112 bool shouldFireGetStatsCallback() { return !m_stopped; } 113 bool shouldFireGetStatsCallback() { return !m_stopped; }
114 void requestSucceeded(RTCVoidRequestImpl::RequestType);
113 115
114 DEFINE_ATTRIBUTE_EVENT_LISTENER(negotiationneeded); 116 DEFINE_ATTRIBUTE_EVENT_LISTENER(negotiationneeded);
115 DEFINE_ATTRIBUTE_EVENT_LISTENER(icecandidate); 117 DEFINE_ATTRIBUTE_EVENT_LISTENER(icecandidate);
116 DEFINE_ATTRIBUTE_EVENT_LISTENER(signalingstatechange); 118 DEFINE_ATTRIBUTE_EVENT_LISTENER(signalingstatechange);
117 DEFINE_ATTRIBUTE_EVENT_LISTENER(addstream); 119 DEFINE_ATTRIBUTE_EVENT_LISTENER(addstream);
118 DEFINE_ATTRIBUTE_EVENT_LISTENER(removestream); 120 DEFINE_ATTRIBUTE_EVENT_LISTENER(removestream);
119 DEFINE_ATTRIBUTE_EVENT_LISTENER(iceconnectionstatechange); 121 DEFINE_ATTRIBUTE_EVENT_LISTENER(iceconnectionstatechange);
120 DEFINE_ATTRIBUTE_EVENT_LISTENER(datachannel); 122 DEFINE_ATTRIBUTE_EVENT_LISTENER(datachannel);
121 123
122 // WebRTCPeerConnectionHandlerClient 124 // WebRTCPeerConnectionHandlerClient
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); 159 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>);
158 void dispatchScheduledEvent(); 160 void dispatchScheduledEvent();
159 bool hasLocalStreamWithTrackId(const String& trackId); 161 bool hasLocalStreamWithTrackId(const String& trackId);
160 162
161 void changeSignalingState(WebRTCPeerConnectionHandlerClient::SignalingState) ; 163 void changeSignalingState(WebRTCPeerConnectionHandlerClient::SignalingState) ;
162 void changeIceGatheringState(WebRTCPeerConnectionHandlerClient::ICEGathering State); 164 void changeIceGatheringState(WebRTCPeerConnectionHandlerClient::ICEGathering State);
163 void changeIceConnectionState(WebRTCPeerConnectionHandlerClient::ICEConnecti onState); 165 void changeIceConnectionState(WebRTCPeerConnectionHandlerClient::ICEConnecti onState);
164 166
165 void closeInternal(); 167 void closeInternal();
166 168
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
167 SignalingState m_signalingState; 177 SignalingState m_signalingState;
168 ICEGatheringState m_iceGatheringState; 178 ICEGatheringState m_iceGatheringState;
169 ICEConnectionState m_iceConnectionState; 179 ICEConnectionState m_iceConnectionState;
170 180
171 MediaStreamVector m_localStreams; 181 MediaStreamVector m_localStreams;
172 MediaStreamVector m_remoteStreams; 182 MediaStreamVector m_remoteStreams;
173 183
174 HeapVector<Member<RTCDataChannel>> m_dataChannels; 184 HeapVector<Member<RTCDataChannel>> m_dataChannels;
175 185
176 OwnPtr<WebRTCPeerConnectionHandler> m_peerHandler; 186 OwnPtr<WebRTCPeerConnectionHandler> m_peerHandler;
177 187
178 AsyncMethodRunner<RTCPeerConnection> m_dispatchScheduledEventRunner; 188 AsyncMethodRunner<RTCPeerConnection> m_dispatchScheduledEventRunner;
179 WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; 189 WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents;
180 190
181 bool m_stopped; 191 bool m_stopped;
182 bool m_closed; 192 bool m_closed;
183 }; 193 };
184 194
185 } // namespace blink 195 } // namespace blink
186 196
187 #endif // RTCPeerConnection_h 197 #endif // RTCPeerConnection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698