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

Issue 167523004: Invalidate all weak pointers during Decrypting{Audio|Video}Decoder::Stop(). (Closed)

Created:
6 years, 10 months ago by xhwang
Modified:
6 years, 10 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Visibility:
Public.

Description

Invalidate all weak pointers during Decrypting{Audio|Video}Decoder::Stop(). This is a clean up CL following r251277. During media pipeline shutdown, WebMediaPlayerImpl::Destroy() is blocking the main render thread to wait for the media filters to be stopped correctly. As a result, Decrypting{Audio|Video}Decoder::Stop() cannot wait for the Decryptor to finish all pending operations because some Decryptors rely on the main render thread to work. Instead, Decrypting{Audio|Video}Decoder::Stop() clears its internal data, fires all pending callbacks, sets it's state to kStopped and fires the stop callback immediately. However, after this process, there may still be callbacks outstanding on the Decrypting{Audio|Video}Decoder object. Previously we check the condition "state_ == kStopped" in all callback functions to turn those callbacks into a no-op. In this CL, we invalidate all weak pointers during the Stop() process so that no pending callbacks will ever be fired back, which is cleaner and safer. BUG=343748 TEST=Existing tests still pass. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=251837

Patch Set 1 #

Patch Set 2 : #

Total comments: 4

Patch Set 3 : rebase only #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -26 lines) Patch
M media/filters/decrypting_audio_decoder.cc View 5 chunks +5 lines, -12 lines 0 comments Download
M media/filters/decrypting_video_decoder.cc View 5 chunks +8 lines, -14 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
xhwang
PTAL
6 years, 10 months ago (2014-02-14 21:56:28 UTC) #1
ddorwin
lgtm
6 years, 10 months ago (2014-02-14 22:03:24 UTC) #2
xhwang
acolwell: kindly ping?
6 years, 10 months ago (2014-02-18 17:51:46 UTC) #3
acolwell GONE FROM CHROMIUM
lgtm % nits https://codereview.chromium.org/167523004/diff/60001/media/filters/decrypting_audio_decoder.cc File media/filters/decrypting_audio_decoder.cc (left): https://codereview.chromium.org/167523004/diff/60001/media/filters/decrypting_audio_decoder.cc#oldcode193 media/filters/decrypting_audio_decoder.cc:193: if (state_ == kStopped) nit: DCHECK_NE(state_, ...
6 years, 10 months ago (2014-02-18 18:07:23 UTC) #4
xhwang
rebase only
6 years, 10 months ago (2014-02-18 18:43:03 UTC) #5
xhwang
https://codereview.chromium.org/167523004/diff/60001/media/filters/decrypting_audio_decoder.cc File media/filters/decrypting_audio_decoder.cc (left): https://codereview.chromium.org/167523004/diff/60001/media/filters/decrypting_audio_decoder.cc#oldcode193 media/filters/decrypting_audio_decoder.cc:193: if (state_ == kStopped) On 2014/02/18 18:07:24, acolwell wrote: ...
6 years, 10 months ago (2014-02-18 18:46:10 UTC) #6
xhwang
The CQ bit was checked by xhwang@chromium.org
6 years, 10 months ago (2014-02-18 18:46:14 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/xhwang@chromium.org/167523004/130001
6 years, 10 months ago (2014-02-18 18:46:29 UTC) #8
commit-bot: I haz the power
6 years, 10 months ago (2014-02-18 21:00:58 UTC) #9
Message was sent while issue was closed.
Change committed as 251837

Powered by Google App Engine
This is Rietveld 408576698