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

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

Issue 329093002: Allow PeerConnection to be garbage collected after close(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Data channel now has a weak ptr to the peer connection that created it. Stops itself if creator goe… 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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef RTCSessionDescriptionRequestImpl_h 31 #ifndef RTCSessionDescriptionRequestImpl_h
32 #define RTCSessionDescriptionRequestImpl_h 32 #define RTCSessionDescriptionRequestImpl_h
33 33
34 #include "core/dom/ActiveDOMObject.h" 34 #include "core/dom/ActiveDOMObject.h"
35 #include "platform/heap/Handle.h"
35 #include "platform/mediastream/RTCSessionDescriptionRequest.h" 36 #include "platform/mediastream/RTCSessionDescriptionRequest.h"
36 #include "wtf/PassOwnPtr.h" 37 #include "wtf/PassOwnPtr.h"
37 #include "wtf/PassRefPtr.h" 38 #include "wtf/PassRefPtr.h"
38 39
39 namespace blink { 40 namespace blink {
40 class WebRTCSessionDescription; 41 class WebRTCSessionDescription;
41 } 42 }
42 43
43 namespace WebCore { 44 namespace WebCore {
44 45
45 class RTCErrorCallback; 46 class RTCErrorCallback;
46 class RTCPeerConnection; 47 class RTCPeerConnection;
47 class RTCSessionDescriptionCallback; 48 class RTCSessionDescriptionCallback;
48 49
49 class RTCSessionDescriptionRequestImpl FINAL : public RTCSessionDescriptionReque st, public ActiveDOMObject { 50 class RTCSessionDescriptionRequestImpl FINAL : public RTCSessionDescriptionReque st, public ActiveDOMObject {
50 public: 51 public:
51 static PassRefPtr<RTCSessionDescriptionRequestImpl> create(ExecutionContext* , PassOwnPtr<RTCSessionDescriptionCallback>, PassOwnPtr<RTCErrorCallback>); 52 static PassRefPtr<RTCSessionDescriptionRequestImpl> create(ExecutionContext* , PassRefPtrWillBeRawPtr<RTCPeerConnection>, PassOwnPtr<RTCSessionDescriptionCal lback>, PassOwnPtr<RTCErrorCallback>);
52 virtual ~RTCSessionDescriptionRequestImpl(); 53 virtual ~RTCSessionDescriptionRequestImpl();
53 54
54 virtual void requestSucceeded(const blink::WebRTCSessionDescription&) OVERRI DE; 55 virtual void requestSucceeded(const blink::WebRTCSessionDescription&) OVERRI DE;
55 virtual void requestFailed(const String& error) OVERRIDE; 56 virtual void requestFailed(const String& error) OVERRIDE;
56 57
57 // ActiveDOMObject 58 // ActiveDOMObject
58 virtual void stop() OVERRIDE; 59 virtual void stop() OVERRIDE;
59 60
60 private: 61 private:
61 RTCSessionDescriptionRequestImpl(ExecutionContext*, PassOwnPtr<RTCSessionDes criptionCallback>, PassOwnPtr<RTCErrorCallback>); 62 RTCSessionDescriptionRequestImpl(ExecutionContext*, PassRefPtrWillBeRawPtr<R TCPeerConnection>, PassOwnPtr<RTCSessionDescriptionCallback>, PassOwnPtr<RTCErro rCallback>);
62 63
63 void clear(); 64 void clear();
64 65
65 OwnPtr<RTCSessionDescriptionCallback> m_successCallback; 66 OwnPtr<RTCSessionDescriptionCallback> m_successCallback;
66 OwnPtr<RTCErrorCallback> m_errorCallback; 67 OwnPtr<RTCErrorCallback> m_errorCallback;
68
69 RefPtrWillBePersistent<RTCPeerConnection> m_requester;
67 }; 70 };
68 71
69 } // namespace WebCore 72 } // namespace WebCore
70 73
71 #endif // RTCSessionDescriptionRequestImpl_h 74 #endif // RTCSessionDescriptionRequestImpl_h
72
73
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698