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

Issue 552653005: Oilpan: Move MediaStreamSource, MediaStreamComponent and MediaStreamDescriptor to oilpan's heap (Closed)

Created:
6 years, 3 months ago by haraken
Modified:
6 years, 2 months ago
CC:
blink-reviews, jamesr, philipj_slow, dglazkov+blink, eric.carlson_apple.com, abarth-chromium, feature-media-reviews_chromium.org, tommyw+watchlist_chromium.org, Raymond Toy
Project:
blink
Visibility:
Public.

Description

Oilpan: Move MediaStreamSource, MediaStreamComponent and MediaStreamDescriptor to oilpan's heap - MediaStreamSource, MediaStreamComponent and MediaStreamDescriptor must be moved to oilpan's heap in one go because their lifetime are tightly coupled. - Removed m_descriptor->setClient(0) from MediaStream's destructor. This is OK because MediaStreamDescriptor has a strong Member back to the Client (i.e., MediaStream). - Removed m_component->source()->removeObserver(this) from MediaStreamTrack's destructor. This is OK because this CL made the observers weak (i.e., MediaStreamSource::m_observers is a hash set of weak members to MediaStreamTrack objects). - Removed WebMediaStreamTrack::ExtraData::m_owner because it's unused. - Introduced MediaStreamComponentDisposer to delay the destruction of MediaStreamComponent::m_extraData. The ExtraData is exposed to the web and some Chromium objects inherit from the ExtraData. If we clear the m_extraData in the MediaStreamComponent's destructor, those Chromium-side objects are also destructed in the MediaStreamComponent's destructor. This is problematic because the destructors of the Chromium-side classes can touch other on-heap objects in the Blink side. To avoid the issue, we need to delay the destruction of the ExtraData to thread-specific weak processing. The disposer pattern actually makes the deletion of the extra data happen earlier and not later. The disposer makes sure that the extra data is destructed in weak processing which is run before sweeping and therefore all the objects are still alive and can be touched. - The same problem arises for MediaStreamDescriptor and MediaStreamSource. This CL adds MediaStreamDescriptorDisposer and MediaStreamSourceDisposer. - This CL depends on https://codereview.chromium.org/543603003/ and https://codereview.chromium.org/549153002. BUG=340522 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181702 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=182399 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=182826

Patch Set 1 #

Total comments: 1

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+208 lines, -131 lines) Patch
M Source/modules/mediastream/MediaStream.h View 3 chunks +4 lines, -4 lines 0 comments Download
M Source/modules/mediastream/MediaStream.cpp View 1 2 3 3 chunks +4 lines, -3 lines 0 comments Download
M Source/modules/mediastream/MediaStreamRegistry.h View 2 chunks +2 lines, -1 line 0 comments Download
M Source/modules/mediastream/MediaStreamTrack.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M Source/modules/mediastream/MediaStreamTrack.cpp View 1 2 3 3 chunks +5 lines, -4 lines 0 comments Download
M Source/modules/mediastream/RTCStatsRequestImpl.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/mediastream/RTCStatsRequestImpl.cpp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/modules/mediastream/UserMediaRequest.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/mediastream/UserMediaRequest.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/webaudio/MediaStreamAudioDestinationNode.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp View 1 chunk +1 line, -0 lines 0 comments Download
M Source/platform/exported/WebMediaStream.cpp View 2 chunks +1 line, -11 lines 0 comments Download
M Source/platform/exported/WebMediaStreamSource.cpp View 2 chunks +1 line, -6 lines 0 comments Download
M Source/platform/exported/WebMediaStreamTrack.cpp View 3 chunks +0 lines, -26 lines 0 comments Download
M Source/platform/mediastream/MediaStreamComponent.h View 4 chunks +10 lines, -7 lines 0 comments Download
M Source/platform/mediastream/MediaStreamComponent.cpp View 1 2 chunks +43 lines, -5 lines 0 comments Download
M Source/platform/mediastream/MediaStreamDescriptor.h View 4 chunks +15 lines, -13 lines 0 comments Download
M Source/platform/mediastream/MediaStreamDescriptor.cpp View 1 5 chunks +50 lines, -10 lines 0 comments Download
M Source/platform/mediastream/MediaStreamSource.h View 4 chunks +11 lines, -7 lines 0 comments Download
M Source/platform/mediastream/MediaStreamSource.cpp View 1 3 chunks +45 lines, -11 lines 0 comments Download
M public/platform/WebMediaStream.h View 1 chunk +1 line, -3 lines 0 comments Download
M public/platform/WebMediaStreamSource.h View 3 chunks +7 lines, -2 lines 0 comments Download
M public/platform/WebMediaStreamTrack.h View 2 chunks +1 line, -12 lines 0 comments Download

Messages

Total messages: 23 (7 generated)
haraken
I think this CL is now ready for full review. I verified that Chromium-side tests ...
6 years, 3 months ago (2014-09-09 04:29:50 UTC) #2
Mads Ager (chromium)
LGTM Update the description: The disposer pattern actually makes the deletion of the extra data ...
6 years, 3 months ago (2014-09-09 14:14:27 UTC) #4
haraken
On 2014/09/09 14:14:27, Mads Ager (chromium) wrote: > LGTM > > Update the description: The ...
6 years, 3 months ago (2014-09-10 03:27:46 UTC) #5
tkent
lgtm. Please wrap the CL description in 72 columns. You should have seen an indicator ...
6 years, 3 months ago (2014-09-10 04:25:19 UTC) #6
haraken
> Please wrap the CL description in 72 columns. You should have seen an indicator ...
6 years, 3 months ago (2014-09-10 04:27:16 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haraken@chromium.org/552653005/20001
6 years, 3 months ago (2014-09-10 04:28:15 UTC) #9
commit-bot: I haz the power
Committed patchset #2 (id:20001) as 181702
6 years, 3 months ago (2014-09-10 05:49:05 UTC) #10
haraken
Now that the chromium side fix has been landed (https://codereview.chromium.org/566793002/), I think it's safe to ...
6 years, 3 months ago (2014-09-22 05:42:09 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/552653005/40001
6 years, 3 months ago (2014-09-22 05:42:45 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: win_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/win_blink_rel/builds/28138)
6 years, 3 months ago (2014-09-22 07:17:22 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/552653005/40001
6 years, 3 months ago (2014-09-22 08:20:09 UTC) #17
commit-bot: I haz the power
Committed patchset #3 (id:40001) as 182399
6 years, 3 months ago (2014-09-22 08:56:20 UTC) #18
haraken
The Chromium-side fix was landed (https://codereview.chromium.org/596923003/), so I think it's safe to land this CL.
6 years, 2 months ago (2014-09-29 08:46:49 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/552653005/60001
6 years, 2 months ago (2014-09-29 08:48:05 UTC) #21
commit-bot: I haz the power
Committed patchset #4 (id:60001) as 182826
6 years, 2 months ago (2014-09-29 09:52:22 UTC) #22
haraken
6 years, 2 months ago (2014-09-30 01:09:28 UTC) #23
Message was sent while issue was closed.
On 2014/09/29 09:52:22, I haz the power (commit-bot) wrote:
> Committed patchset #4 (id:60001) as 182826

Looks like I finally succeeded in landing this CL without causing any memory
leakage in chromium-side unittests :)

Powered by Google App Engine
This is Rietveld 408576698