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

Issue 10822024: Don't clear the list of source buffers in ChunkDemuxer::Shutdown() (Closed)

Created:
8 years, 5 months ago by annacc
Modified:
8 years, 5 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Visibility:
Public.

Description

Don't clear the list of source buffers in ChunkDemuxer::Shutdown() Clearing the stream_parser_map_ (which represents the list of source buffers) creates an inconsistent state where source buffers should still be available to WebKit (JavaScript) but they have been removed internally. Source buffers should only be removed when RemoveId() is called or upon destruction. This change was originally committed as http://src.chromium.org/viewvc/chrome?view=rev&revision=148149 (Patch Set 1) and then reverted because it exposed a memory leak. Turns out the StreamParser was holding on to a reference to the ChunkDemuxer until after the initialization in order to ensure the init callback got called. So for tests that never append an initialization segment, the StreamParser reference prevented the ChunkDemuxer from being deconstructed, causing the memory leak. Before this patch, Shutdown() would remove all the StreamParsers so this wasn't a problem. A subsequent patch will not allow StreamParser to hang on to its ChunkDemuxer reference. This is ok because if ChunkDemuxer gets deconstructed, the callback is no longer relevant. For reference, the memory leak looks like this: http://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20Mac%20%28valgrind%29%281%29/builds/11523/steps/memory%20test%3A%20media/logs/stdio BUG=138578 , WK88949 TEST=http/tests/media/media-source/video-media-source-add-and-remove-ids.html, ChunkDemuxerTest.TestEndOfStreamWithNoAppends Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=148473

Patch Set 1 #

Patch Set 2 : fix for mem leak #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -7 lines) Patch
M media/filters/chunk_demuxer.cc View 1 2 chunks +1 line, -7 lines 0 comments Download
M media/filters/chunk_demuxer_unittest.cc View 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
annacc
8 years, 5 months ago (2012-07-25 21:00:19 UTC) #1
acolwell GONE FROM CHROMIUM
LGTM
8 years, 5 months ago (2012-07-25 21:08:47 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/annacc@chromium.org/10822024/2001
8 years, 5 months ago (2012-07-25 22:24:39 UTC) #3
commit-bot: I haz the power
8 years, 5 months ago (2012-07-26 02:13:13 UTC) #4
Change committed as 148473

Powered by Google App Engine
This is Rietveld 408576698