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

Issue 329093002: Allow PeerConnection to be garbage collected after close(). (Closed)

Created:
6 years, 6 months ago by Henrik Grunell
Modified:
6 years, 6 months ago
CC:
blink-reviews, tommyw+watchlist_chromium.org
Visibility:
Public.

Description

Allow PeerConnection to be garbage collected after close(). * Add m_closed flag and allow gc after close(). * Assert that no calls from the client comes after close(). * Ensure no callbacks from async operation after close() is called, except getStats. * Call stop() in the destructor. * Add tests for garbage collected after close(), but not gc if close() is not called. * Add tests for getStats() called after close(). BUG=373690 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176349

Patch Set 1 #

Patch Set 2 : Use ref counting for pending activity for a async operations. #

Total comments: 4

Patch Set 3 : Code review, fix and clean up todo comments. #

Patch Set 4 : Some fixes, added test for getStats after close. #

Patch Set 5 : Minor fix. #

Patch Set 6 : Added gc test using observeGC. #

Patch Set 7 : Rebase #

Total comments: 28

Patch Set 8 : Code review. #

Patch Set 9 : Data channel now has a weak ptr to the peer connection that created it. Stops itself if creator goe… #

Total comments: 10

Patch Set 10 : Code review. #

Total comments: 3

Patch Set 11 : Rebase #

Patch Set 12 : Reverted to call stop() in the destructor. No ptr to PeerConnection in DataChannel. #

Patch Set 13 : Code review. #

Total comments: 14

Patch Set 14 : Code review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+167 lines, -62 lines) Patch
M LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +26 lines, -6 lines 0 comments Download
M LayoutTests/fast/mediastream/RTCPeerConnection-lifetime-expected.txt View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M LayoutTests/fast/mediastream/RTCPeerConnection-stats.html View 1 2 3 2 chunks +32 lines, -19 lines 0 comments Download
M LayoutTests/fast/mediastream/RTCPeerConnection-stats-expected.txt View 1 2 3 1 chunk +16 lines, -0 lines 0 comments Download
M Source/modules/mediastream/RTCPeerConnection.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +10 lines, -1 line 0 comments Download
M Source/modules/mediastream/RTCPeerConnection.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 chunks +34 lines, -10 lines 0 comments Download
M Source/modules/mediastream/RTCSessionDescriptionRequestImpl.h View 1 2 3 4 5 6 7 3 chunks +5 lines, -4 lines 0 comments Download
M Source/modules/mediastream/RTCSessionDescriptionRequestImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +10 lines, -5 lines 0 comments Download
M Source/modules/mediastream/RTCStatsRequestImpl.h View 1 2 3 4 5 6 7 3 chunks +6 lines, -2 lines 0 comments Download
M Source/modules/mediastream/RTCStatsRequestImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +10 lines, -6 lines 0 comments Download
M Source/modules/mediastream/RTCVoidRequestImpl.h View 1 2 3 4 5 6 7 2 chunks +6 lines, -4 lines 0 comments Download
M Source/modules/mediastream/RTCVoidRequestImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +10 lines, -5 lines 0 comments Download

Messages

Total messages: 55 (0 generated)
Henrik Grunell
This is a first stab at allowing PeerConnections to be garbage collected. Adding Julien since ...
6 years, 6 months ago (2014-06-11 12:48:20 UTC) #1
Julien - ping for review
Adding some better reviewers for a garbage collection + ActiveDOMObject change.
6 years, 6 months ago (2014-06-12 17:56:29 UTC) #2
tommi (sloooow) - chröme
I'm going to be away for the next days, so just rubberstamping. lgtm.
6 years, 6 months ago (2014-06-12 18:32:00 UTC) #3
haraken
I don't fully understand what lifetime problem you're going to solve. Would you elaborate on ...
6 years, 6 months ago (2014-06-13 01:23:00 UTC) #4
haraken
On 2014/06/12 18:32:00, tommi (OOO June 13-23) wrote: > I'm going to be away for ...
6 years, 6 months ago (2014-06-13 01:25:05 UTC) #5
tommi (sloooow) - chröme
On 2014/06/13 01:25:05, haraken wrote: > On 2014/06/12 18:32:00, tommi (OOO June 13-23) wrote: > ...
6 years, 6 months ago (2014-06-13 04:32:42 UTC) #6
Henrik Grunell
Adding Mads as well.
6 years, 6 months ago (2014-06-13 06:47:22 UTC) #7
Henrik Grunell
Also fixed and cleaned up todo comments. https://codereview.chromium.org/329093002/diff/20001/Source/modules/mediastream/RTCPeerConnection.cpp File Source/modules/mediastream/RTCPeerConnection.cpp (right): https://codereview.chromium.org/329093002/diff/20001/Source/modules/mediastream/RTCPeerConnection.cpp#newcode203 Source/modules/mediastream/RTCPeerConnection.cpp:203: setPendingActivity(this); On ...
6 years, 6 months ago (2014-06-13 07:50:46 UTC) #8
Henrik Grunell
On 2014/06/13 01:23:00, haraken wrote: > I don't fully understand what lifetime problem you're going ...
6 years, 6 months ago (2014-06-13 07:56:16 UTC) #9
Henrik Grunell
I've added a test for calling getStats after close. And fixed some issues found when ...
6 years, 6 months ago (2014-06-13 14:40:25 UTC) #10
haraken
On 2014/06/13 14:40:25, Henrik Grunell wrote: > I've added a test for calling getStats after ...
6 years, 6 months ago (2014-06-13 15:00:28 UTC) #11
haraken
On 2014/06/13 04:32:42, tommi (OOO June 13-23) wrote: > On 2014/06/13 01:25:05, haraken wrote: > ...
6 years, 6 months ago (2014-06-13 15:05:13 UTC) #12
tommi (sloooow) - chröme
No worries. Better safe than sorry :-) I'll follow along and wait for things to ...
6 years, 6 months ago (2014-06-13 21:11:21 UTC) #13
Henrik Grunell
Added gc test using observeGC. PTAL.
6 years, 6 months ago (2014-06-15 07:47:39 UTC) #14
haraken
+keishi for the RTCPeerConnection destruction issue. https://codereview.chromium.org/329093002/diff/120001/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html File LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html (right): https://codereview.chromium.org/329093002/diff/120001/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html#newcode44 LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html:44: // Test that ...
6 years, 6 months ago (2014-06-15 13:43:58 UTC) #15
Henrik Grunell
https://codereview.chromium.org/329093002/diff/120001/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html File LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html (right): https://codereview.chromium.org/329093002/diff/120001/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html#newcode44 LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html:44: // Test that the PeerConnection object is not gc'd ...
6 years, 6 months ago (2014-06-16 07:49:00 UTC) #16
keishi
https://codereview.chromium.org/329093002/diff/120001/Source/modules/mediastream/RTCPeerConnection.cpp File Source/modules/mediastream/RTCPeerConnection.cpp (right): https://codereview.chromium.org/329093002/diff/120001/Source/modules/mediastream/RTCPeerConnection.cpp#newcode222 Source/modules/mediastream/RTCPeerConnection.cpp:222: stop(); On 2014/06/16 07:48:59, Henrik Grunell wrote: > On ...
6 years, 6 months ago (2014-06-16 08:04:02 UTC) #17
keishi
https://codereview.chromium.org/329093002/diff/120001/Source/modules/mediastream/RTCPeerConnection.cpp File Source/modules/mediastream/RTCPeerConnection.cpp (right): https://codereview.chromium.org/329093002/diff/120001/Source/modules/mediastream/RTCPeerConnection.cpp#newcode593 Source/modules/mediastream/RTCPeerConnection.cpp:593: ASSERT(!m_closed); When I run your patch locally I hit ...
6 years, 6 months ago (2014-06-16 08:06:35 UTC) #18
Henrik Grunell
https://codereview.chromium.org/329093002/diff/120001/Source/modules/mediastream/RTCPeerConnection.cpp File Source/modules/mediastream/RTCPeerConnection.cpp (right): https://codereview.chromium.org/329093002/diff/120001/Source/modules/mediastream/RTCPeerConnection.cpp#newcode222 Source/modules/mediastream/RTCPeerConnection.cpp:222: stop(); On 2014/06/16 08:04:01, keishi wrote: > On 2014/06/16 ...
6 years, 6 months ago (2014-06-16 08:34:38 UTC) #19
blink-reviews
Den 16 jun 2014 10:34 skrev <grunell@chromium.org>: > > > https://codereview.chromium.org/329093002/diff/120001/Source/modules/mediastream/RTCPeerConnection.cpp > File Source/modules/mediastream/RTCPeerConnection.cpp (right): ...
6 years, 6 months ago (2014-06-16 21:21:34 UTC) #20
keishi
On 2014/06/16 21:21:34, blink-reviews_chromium.org wrote: > Den 16 jun 2014 10:34 skrev <mailto:grunell@chromium.org>: > > ...
6 years, 6 months ago (2014-06-16 21:56:04 UTC) #21
keishi
On 2014/06/16 21:56:04, keishi wrote: > On 2014/06/16 21:21:34, http://blink-reviews_chromium.org wrote: > > Den 16 ...
6 years, 6 months ago (2014-06-16 21:56:43 UTC) #22
Henrik Grunell
Data channel now has a weak ptr to the peer connection that created it. Stops ...
6 years, 6 months ago (2014-06-17 07:51:06 UTC) #23
keishi
https://codereview.chromium.org/329093002/diff/150001/Source/modules/mediastream/RTCPeerConnection.cpp File Source/modules/mediastream/RTCPeerConnection.cpp (right): https://codereview.chromium.org/329093002/diff/150001/Source/modules/mediastream/RTCPeerConnection.cpp#newcode223 Source/modules/mediastream/RTCPeerConnection.cpp:223: stop(); We should remove this now.
6 years, 6 months ago (2014-06-17 07:53:10 UTC) #24
keishi
https://codereview.chromium.org/329093002/diff/150001/Source/modules/mediastream/RTCDataChannel.h File Source/modules/mediastream/RTCDataChannel.h (right): https://codereview.chromium.org/329093002/diff/150001/Source/modules/mediastream/RTCDataChannel.h#newcode124 Source/modules/mediastream/RTCDataChannel.h:124: WeakPtrWillBeWeakMember<RTCPeerConnection> m_creator; We need to trace members. You need ...
6 years, 6 months ago (2014-06-17 07:58:22 UTC) #25
Henrik Grunell
https://codereview.chromium.org/329093002/diff/150001/Source/modules/mediastream/RTCDataChannel.h File Source/modules/mediastream/RTCDataChannel.h (right): https://codereview.chromium.org/329093002/diff/150001/Source/modules/mediastream/RTCDataChannel.h#newcode124 Source/modules/mediastream/RTCDataChannel.h:124: WeakPtrWillBeWeakMember<RTCPeerConnection> m_creator; On 2014/06/17 07:58:21, keishi wrote: > We ...
6 years, 6 months ago (2014-06-17 08:08:27 UTC) #26
keishi
https://codereview.chromium.org/329093002/diff/170001/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html File LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html (right): https://codereview.chromium.org/329093002/diff/170001/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html#newcode40 LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html:40: gc(); I think its better to use asyncGC(). It ...
6 years, 6 months ago (2014-06-17 08:16:42 UTC) #27
Mads Ager (chromium)
I'm not sure this will work. Is the following possible: PeerConnection and DataChannels are all ...
6 years, 6 months ago (2014-06-17 08:26:01 UTC) #28
Henrik Grunell
On 2014/06/17 08:26:01, Mads Ager (chromium) wrote: > I'm not sure this will work. Is ...
6 years, 6 months ago (2014-06-17 08:40:06 UTC) #29
Mads Ager (chromium)
On 2014/06/17 08:40:06, Henrik Grunell wrote: > On 2014/06/17 08:26:01, Mads Ager (chromium) wrote: > ...
6 years, 6 months ago (2014-06-17 08:47:01 UTC) #30
keishi
On 2014/06/17 08:47:01, Mads Ager (chromium) wrote: > On 2014/06/17 08:40:06, Henrik Grunell wrote: > ...
6 years, 6 months ago (2014-06-17 08:50:53 UTC) #31
Henrik Grunell
* Reverted to call stop() in the destructor. No ptr to PeerConnection in DataChannel. * ...
6 years, 6 months ago (2014-06-17 09:08:19 UTC) #32
keishi
lgtm haraken@, could you do the OWNER review https://codereview.chromium.org/329093002/diff/230001/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html File LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html (right): https://codereview.chromium.org/329093002/diff/230001/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html#newcode55 LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html:55: asyncGC(function() ...
6 years, 6 months ago (2014-06-17 11:12:05 UTC) #33
haraken
LGTM. https://codereview.chromium.org/329093002/diff/230001/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html File LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html (right): https://codereview.chromium.org/329093002/diff/230001/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html#newcode55 LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html:55: asyncGC(function() {}); On 2014/06/17 11:12:04, keishi wrote: > ...
6 years, 6 months ago (2014-06-17 11:43:45 UTC) #34
Henrik Grunell
The CQ bit was checked by grunell@chromium.org
6 years, 6 months ago (2014-06-17 12:06:07 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/grunell@chromium.org/329093002/250001
6 years, 6 months ago (2014-06-17 12:06:58 UTC) #36
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-17 12:07:01 UTC) #37
commit-bot: I haz the power
A disapproval has been posted by following reviewers: tommi@chromium.org. Please make sure to get positive ...
6 years, 6 months ago (2014-06-17 12:07:02 UTC) #38
Henrik Grunell
The CQ bit was checked by grunell@chromium.org
6 years, 6 months ago (2014-06-17 12:08:39 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/grunell@chromium.org/329093002/250001
6 years, 6 months ago (2014-06-17 12:09:09 UTC) #40
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-17 12:09:12 UTC) #41
commit-bot: I haz the power
A disapproval has been posted by following reviewers: tommi@chromium.org. Please make sure to get positive ...
6 years, 6 months ago (2014-06-17 12:09:13 UTC) #42
Henrik Grunell
https://codereview.chromium.org/329093002/diff/230001/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html File LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html (right): https://codereview.chromium.org/329093002/diff/230001/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html#newcode55 LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html:55: asyncGC(function() {}); On 2014/06/17 11:43:45, haraken wrote: > On ...
6 years, 6 months ago (2014-06-17 12:12:21 UTC) #43
Henrik Grunell
The CQ bit was checked by grunell@chromium.org
6 years, 6 months ago (2014-06-17 12:12:32 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/grunell@chromium.org/329093002/250001
6 years, 6 months ago (2014-06-17 12:13:07 UTC) #45
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-17 12:13:10 UTC) #46
commit-bot: I haz the power
A disapproval has been posted by following reviewers: tommi@chromium.org. Please make sure to get positive ...
6 years, 6 months ago (2014-06-17 12:13:11 UTC) #47
tommi (sloooow) - chröme
lgtm
6 years, 6 months ago (2014-06-17 12:41:47 UTC) #48
Henrik Grunell
The CQ bit was checked by grunell@chromium.org
6 years, 6 months ago (2014-06-17 12:59:16 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/grunell@chromium.org/329093002/250001
6 years, 6 months ago (2014-06-17 13:00:25 UTC) #50
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-17 14:23:45 UTC) #51
commit-bot: I haz the power
Try jobs failed on following builders: win_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu_triggered_tests/builds/18068)
6 years, 6 months ago (2014-06-17 14:23:46 UTC) #52
Henrik Grunell
The CQ bit was checked by grunell@chromium.org
6 years, 6 months ago (2014-06-17 18:45:55 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/grunell@chromium.org/329093002/250001
6 years, 6 months ago (2014-06-17 18:46:46 UTC) #54
commit-bot: I haz the power
6 years, 6 months ago (2014-06-17 19:43:06 UTC) #55
Message was sent while issue was closed.
Change committed as 176349

Powered by Google App Engine
This is Rietveld 408576698