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

Issue 827013005: Avoid double task trampoline for Pipeline state transitions. (Closed)

Created:
5 years, 11 months ago by DaleCurtis
Modified:
5 years, 11 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid double task trampoline for Pipeline state transitions. Previously the initialization of ChunkDemuxer and Seeking would result in a back to back trampoline of callback tasks, this can lead to odd interleaving of error states when multiple threads are involved. In recent history we've stated it's always the callees job to ensure callbacks are run on the right thread, this change further clarifies the contract for Renderers and Demuxers that the callback given to Initialize() must only be run after Initialize() has returned. BUG=none TEST=none Committed: https://crrev.com/21b128297b19076f5ef83596b9fddbe7c68c4a68 Cr-Commit-Position: refs/heads/master@{#312313}

Patch Set 1 #

Patch Set 2 : Fix MojoRendererImpl. #

Total comments: 15

Patch Set 3 : Cleanup. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -28 lines) Patch
M media/base/demuxer.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M media/base/pipeline.h View 1 chunk +0 lines, -1 line 0 comments Download
M media/base/pipeline.cc View 3 chunks +3 lines, -12 lines 0 comments Download
M media/base/pipeline_unittest.cc View 1 2 9 chunks +25 lines, -10 lines 0 comments Download
M media/base/renderer.h View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M media/filters/chunk_demuxer.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M media/filters/renderer_impl.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M media/mojo/services/mojo_renderer_impl.cc View 1 2 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 14 (2 generated)
DaleCurtis
WDYT? This appears to be the root cause of the interleaved errors seen when attempting ...
5 years, 11 months ago (2015-01-16 22:14:52 UTC) #2
xhwang
It's a classic dilemma between enforcing the "not call the callback synchronously" rule and avoiding ...
5 years, 11 months ago (2015-01-16 23:09:07 UTC) #3
DaleCurtis
https://codereview.chromium.org/827013005/diff/20001/media/filters/renderer_impl.cc File media/filters/renderer_impl.cc (right): https://codereview.chromium.org/827013005/diff/20001/media/filters/renderer_impl.cc#newcode83 media/filters/renderer_impl.cc:83: init_cb_ = BindToCurrentLoop(init_cb); On 2015/01/16 23:09:07, xhwang wrote: > ...
5 years, 11 months ago (2015-01-16 23:15:16 UTC) #4
xhwang
https://codereview.chromium.org/827013005/diff/20001/media/filters/renderer_impl.cc File media/filters/renderer_impl.cc (right): https://codereview.chromium.org/827013005/diff/20001/media/filters/renderer_impl.cc#newcode83 media/filters/renderer_impl.cc:83: init_cb_ = BindToCurrentLoop(init_cb); On 2015/01/16 23:15:15, DaleCurtis wrote: > ...
5 years, 11 months ago (2015-01-16 23:24:04 UTC) #5
DaleCurtis
https://codereview.chromium.org/827013005/diff/20001/media/filters/renderer_impl.cc File media/filters/renderer_impl.cc (right): https://codereview.chromium.org/827013005/diff/20001/media/filters/renderer_impl.cc#newcode83 media/filters/renderer_impl.cc:83: init_cb_ = BindToCurrentLoop(init_cb); On 2015/01/16 23:24:04, xhwang wrote: > ...
5 years, 11 months ago (2015-01-16 23:33:49 UTC) #6
DaleCurtis
Also, there might be some way to enforce this using a sequence checker for debug ...
5 years, 11 months ago (2015-01-16 23:34:18 UTC) #7
xhwang
On 2015/01/16 23:33:49, DaleCurtis wrote: > https://codereview.chromium.org/827013005/diff/20001/media/filters/renderer_impl.cc > File media/filters/renderer_impl.cc (right): > > https://codereview.chromium.org/827013005/diff/20001/media/filters/renderer_impl.cc#newcode83 > ...
5 years, 11 months ago (2015-01-16 23:55:32 UTC) #8
DaleCurtis
PTAL. I went with the text "|cb| must always be run after this method returns." ...
5 years, 11 months ago (2015-01-20 21:37:44 UTC) #9
xhwang
I like the new text. LGTM https://codereview.chromium.org/827013005/diff/20001/media/base/pipeline_unittest.cc File media/base/pipeline_unittest.cc (right): https://codereview.chromium.org/827013005/diff/20001/media/base/pipeline_unittest.cc#newcode62 media/base/pipeline_unittest.cc:62: ::std::tr1::get<k>(args)); On 2015/01/20 ...
5 years, 11 months ago (2015-01-20 23:00:39 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/827013005/40001
5 years, 11 months ago (2015-01-21 01:35:34 UTC) #12
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 11 months ago (2015-01-21 11:09:55 UTC) #13
commit-bot: I haz the power
5 years, 11 months ago (2015-01-21 11:11:21 UTC) #14
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/21b128297b19076f5ef83596b9fddbe7c68c4a68
Cr-Commit-Position: refs/heads/master@{#312313}

Powered by Google App Engine
This is Rietveld 408576698