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

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

Issue 329093002: Allow PeerConnection to be garbage collected after close(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use ref counting for pending activity for a async operations. Created 6 years, 6 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 | Annotate | Revision Log
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 void removeStream(PassRefPtrWillBeRawPtr<MediaStream>, ExceptionState&); 97 void removeStream(PassRefPtrWillBeRawPtr<MediaStream>, ExceptionState&);
98 98
99 void getStats(PassOwnPtr<RTCStatsCallback> successCallback, PassRefPtr<Media StreamTrack> selector); 99 void getStats(PassOwnPtr<RTCStatsCallback> successCallback, PassRefPtr<Media StreamTrack> selector);
100 100
101 PassRefPtrWillBeRawPtr<RTCDataChannel> createDataChannel(String label, const Dictionary& dataChannelDict, ExceptionState&); 101 PassRefPtrWillBeRawPtr<RTCDataChannel> createDataChannel(String label, const Dictionary& dataChannelDict, ExceptionState&);
102 102
103 PassRefPtrWillBeRawPtr<RTCDTMFSender> createDTMFSender(PassRefPtrWillBeRawPt r<MediaStreamTrack>, ExceptionState&); 103 PassRefPtrWillBeRawPtr<RTCDTMFSender> createDTMFSender(PassRefPtrWillBeRawPt r<MediaStreamTrack>, ExceptionState&);
104 104
105 void close(ExceptionState&); 105 void close(ExceptionState&);
106 106
107 bool requestCompletedCheckIfCallbackShouldFire();
108
107 DEFINE_ATTRIBUTE_EVENT_LISTENER(negotiationneeded); 109 DEFINE_ATTRIBUTE_EVENT_LISTENER(negotiationneeded);
108 DEFINE_ATTRIBUTE_EVENT_LISTENER(icecandidate); 110 DEFINE_ATTRIBUTE_EVENT_LISTENER(icecandidate);
109 DEFINE_ATTRIBUTE_EVENT_LISTENER(signalingstatechange); 111 DEFINE_ATTRIBUTE_EVENT_LISTENER(signalingstatechange);
110 DEFINE_ATTRIBUTE_EVENT_LISTENER(addstream); 112 DEFINE_ATTRIBUTE_EVENT_LISTENER(addstream);
111 DEFINE_ATTRIBUTE_EVENT_LISTENER(removestream); 113 DEFINE_ATTRIBUTE_EVENT_LISTENER(removestream);
112 DEFINE_ATTRIBUTE_EVENT_LISTENER(iceconnectionstatechange); 114 DEFINE_ATTRIBUTE_EVENT_LISTENER(iceconnectionstatechange);
113 DEFINE_ATTRIBUTE_EVENT_LISTENER(datachannel); 115 DEFINE_ATTRIBUTE_EVENT_LISTENER(datachannel);
114 116
115 // blink::WebRTCPeerConnectionHandlerClient 117 // blink::WebRTCPeerConnectionHandlerClient
116 virtual void negotiationNeeded() OVERRIDE; 118 virtual void negotiationNeeded() OVERRIDE;
117 virtual void didGenerateICECandidate(const blink::WebRTCICECandidate&) OVERR IDE; 119 virtual void didGenerateICECandidate(const blink::WebRTCICECandidate&) OVERR IDE;
118 virtual void didChangeSignalingState(SignalingState) OVERRIDE; 120 virtual void didChangeSignalingState(SignalingState) OVERRIDE;
119 virtual void didChangeICEGatheringState(ICEGatheringState) OVERRIDE; 121 virtual void didChangeICEGatheringState(ICEGatheringState) OVERRIDE;
120 virtual void didChangeICEConnectionState(ICEConnectionState) OVERRIDE; 122 virtual void didChangeICEConnectionState(ICEConnectionState) OVERRIDE;
121 virtual void didAddRemoteStream(const blink::WebMediaStream&) OVERRIDE; 123 virtual void didAddRemoteStream(const blink::WebMediaStream&) OVERRIDE;
122 virtual void didRemoveRemoteStream(const blink::WebMediaStream&) OVERRIDE; 124 virtual void didRemoveRemoteStream(const blink::WebMediaStream&) OVERRIDE;
123 virtual void didAddRemoteDataChannel(blink::WebRTCDataChannelHandler*) OVERR IDE; 125 virtual void didAddRemoteDataChannel(blink::WebRTCDataChannelHandler*) OVERR IDE;
124 virtual void releasePeerConnectionHandler() OVERRIDE; 126 virtual void releasePeerConnectionHandler() OVERRIDE;
125 127
126 // EventTarget 128 // EventTarget
127 virtual const AtomicString& interfaceName() const OVERRIDE; 129 virtual const AtomicString& interfaceName() const OVERRIDE;
128 virtual ExecutionContext* executionContext() const OVERRIDE; 130 virtual ExecutionContext* executionContext() const OVERRIDE;
129 131
130 // ActiveDOMObject 132 // ActiveDOMObject
131 virtual void suspend() OVERRIDE; 133 virtual void suspend() OVERRIDE;
132 virtual void resume() OVERRIDE; 134 virtual void resume() OVERRIDE;
133 virtual void stop() OVERRIDE; 135 virtual void stop() OVERRIDE;
134 virtual bool hasPendingActivity() const OVERRIDE { return !m_stopped; }
135 136
136 virtual void trace(Visitor*) OVERRIDE; 137 virtual void trace(Visitor*) OVERRIDE;
137 138
138 private: 139 private:
139 RTCPeerConnection(ExecutionContext*, PassRefPtr<RTCConfiguration>, blink::We bMediaConstraints, ExceptionState&); 140 RTCPeerConnection(ExecutionContext*, PassRefPtr<RTCConfiguration>, blink::We bMediaConstraints, ExceptionState&);
140 141
141 static PassRefPtr<RTCConfiguration> parseConfiguration(const Dictionary& con figuration, ExceptionState&); 142 static PassRefPtr<RTCConfiguration> parseConfiguration(const Dictionary& con figuration, ExceptionState&);
142 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); 143 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>);
143 void dispatchScheduledEvent(); 144 void dispatchScheduledEvent();
144 bool hasLocalStreamWithTrackId(const String& trackId); 145 bool hasLocalStreamWithTrackId(const String& trackId);
(...skipping 10 matching lines...) Expand all
155 MediaStreamVector m_remoteStreams; 156 MediaStreamVector m_remoteStreams;
156 157
157 WillBeHeapVector<RefPtrWillBeMember<RTCDataChannel> > m_dataChannels; 158 WillBeHeapVector<RefPtrWillBeMember<RTCDataChannel> > m_dataChannels;
158 159
159 OwnPtr<blink::WebRTCPeerConnectionHandler> m_peerHandler; 160 OwnPtr<blink::WebRTCPeerConnectionHandler> m_peerHandler;
160 161
161 AsyncMethodRunner<RTCPeerConnection> m_dispatchScheduledEventRunner; 162 AsyncMethodRunner<RTCPeerConnection> m_dispatchScheduledEventRunner;
162 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; 163 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents;
163 164
164 bool m_stopped; 165 bool m_stopped;
166 bool m_closed;
165 }; 167 };
166 168
167 } // namespace WebCore 169 } // namespace WebCore
168 170
169 #endif // RTCPeerConnection_h 171 #endif // RTCPeerConnection_h
OLDNEW
« no previous file with comments | « no previous file | Source/modules/mediastream/RTCPeerConnection.cpp » ('j') | Source/modules/mediastream/RTCPeerConnection.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698