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

Issue 423073012: Pipeline: Use WeakPtr for DemuxerHost Calls and Tasks. (Closed)

Created:
6 years, 4 months ago by xhwang
Modified:
6 years, 4 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, Ken Russell (switch to Gerrit), bajones
Project:
chromium
Visibility:
Public.

Description

Pipeline: Use WeakPtr for DemuxerHost Calls and Tasks. There is a chance that the Demuxer calls host_->OnDemuxerError() right before Stop() is called. The Pipeline always posts a ErrorChangedTask() for OnDemuxerError() with base::Retained(this). After the Demuxer fires the stop callback, the Pipeline could be destroyed immediately. So If the media thread hasn't been destroyed we could end up with running ErrorChangedTask() on null pipeline which causes a crash. This CL uses a weak pointer for DemuxerHost calls so that no task will run after the pipeline is destroyed. BUG=397656, 399417, 365141 TEST=Updated unit tests to cover this case. R=scherkus@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=287687

Patch Set 1 #

Patch Set 2 : Use weak_this_for_demuxer_ in Pipeline. #

Patch Set 3 : Updated unit tests. #

Total comments: 2

Patch Set 4 : drop weak_this_for_demuxer_ #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -42 lines) Patch
M media/base/pipeline.cc View 1 2 3 9 chunks +14 lines, -20 lines 1 comment Download
M media/base/pipeline_unittest.cc View 1 2 15 chunks +31 lines, -22 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
xhwang
This CL is related to the bug but I suspect it's not fixing it. The ...
6 years, 4 months ago (2014-08-04 19:03:31 UTC) #1
scherkus (not reviewing)
is there a reason why we can't use WeakPtr instead of Unretained inside the Demuxer-callback ...
6 years, 4 months ago (2014-08-04 19:55:44 UTC) #2
xhwang
On 2014/08/04 19:55:44, scherkus wrote: > is there a reason why we can't use WeakPtr ...
6 years, 4 months ago (2014-08-04 21:37:24 UTC) #3
xhwang
scherkus: Just found that this CL should also fix another bug: http://crbug.com/399417. So the priority ...
6 years, 4 months ago (2014-08-05 17:59:28 UTC) #4
scherkus (not reviewing)
https://codereview.chromium.org/423073012/diff/40001/media/base/pipeline.h File media/base/pipeline.h (right): https://codereview.chromium.org/423073012/diff/40001/media/base/pipeline.h#newcode434 media/base/pipeline.h:434: // weak_factory_.GetWeakPtr() to get weak pointers. Instead, use a ...
6 years, 4 months ago (2014-08-05 18:11:30 UTC) #5
xhwang
PTAL, I building asan and will test it more. https://codereview.chromium.org/423073012/diff/40001/media/base/pipeline.h File media/base/pipeline.h (right): https://codereview.chromium.org/423073012/diff/40001/media/base/pipeline.h#newcode434 media/base/pipeline.h:434: ...
6 years, 4 months ago (2014-08-05 20:44:47 UTC) #6
Ken Russell (switch to Gerrit)
Thanks for putting this together and sorry about the win_gpu_triggered_tests flake. I'm not sure what ...
6 years, 4 months ago (2014-08-05 22:32:09 UTC) #7
scherkus (not reviewing)
lgtm
6 years, 4 months ago (2014-08-05 23:56:58 UTC) #8
scherkus (not reviewing)
The CQ bit was checked by scherkus@chromium.org
6 years, 4 months ago (2014-08-05 23:57:06 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/xhwang@chromium.org/423073012/60001
6 years, 4 months ago (2014-08-05 23:58:34 UTC) #10
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_gpu_triggered_tests on tryserver.chromium.gpu ...
6 years, 4 months ago (2014-08-06 01:13:07 UTC) #11
Ken Russell (switch to Gerrit)
There are some infrastructure issues affecting several bots right now. Please keep retrying this CL. ...
6 years, 4 months ago (2014-08-06 01:24:32 UTC) #12
xhwang
6 years, 4 months ago (2014-08-06 05:49:04 UTC) #13
Message was sent while issue was closed.
Committed patchset #4 manually as 287687 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698