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

Issue 6226001: Change code to use ScopedRunnableMethodFactory & a static callback (Closed)

Created:
9 years, 11 months ago by acolwell GONE FROM CHROMIUM
Modified:
9 years, 6 months ago
CC:
chromium-reviews, vrk (LEFT CHROMIUM), sjl, Alpha Left Google, ddorwin+watch_chromium.org, acolwell GONE FROM CHROMIUM, annacc, awong, scherkus (not reviewing)
Visibility:
Public.

Description

Change CompositeFilter to use ScopedRunnableMethodFactory & make OnCallback() static to prevent the CompositeFilter from becoming owned by other filter threads. BUG=68784 TEST=None Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=71067

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -14 lines) Patch
M media/base/composite_filter.h View 2 chunks +4 lines, -2 lines 0 comments Download
M media/base/composite_filter.cc View 3 chunks +18 lines, -12 lines 4 comments Download

Messages

Total messages: 4 (0 generated)
acolwell GONE FROM CHROMIUM
Fix for flakiness in webkit tests caused by CompositeFilter. The demux & video renderer threads ...
9 years, 11 months ago (2011-01-10 22:31:31 UTC) #1
scherkus (not reviewing)
tentative LGTM w/ some sanity checking questions! http://codereview.chromium.org/6226001/diff/1/media/base/composite_filter.cc File media/base/composite_filter.cc (right): http://codereview.chromium.org/6226001/diff/1/media/base/composite_filter.cc#newcode484 media/base/composite_filter.cc:484: void CompositeFilter::OnCallback(MessageLoop* ...
9 years, 11 months ago (2011-01-11 00:36:57 UTC) #2
acolwell GONE FROM CHROMIUM
Response to tentative LGTM comments. http://codereview.chromium.org/6226001/diff/1/media/base/composite_filter.cc File media/base/composite_filter.cc (right): http://codereview.chromium.org/6226001/diff/1/media/base/composite_filter.cc#newcode484 media/base/composite_filter.cc:484: void CompositeFilter::OnCallback(MessageLoop* message_loop, On ...
9 years, 11 months ago (2011-01-11 05:23:58 UTC) #3
scherkus (not reviewing)
9 years, 11 months ago (2011-01-11 18:37:31 UTC) #4
LGTM x1000

http://codereview.chromium.org/6226001/diff/1/media/base/composite_filter.cc
File media/base/composite_filter.cc (right):

http://codereview.chromium.org/6226001/diff/1/media/base/composite_filter.cc#...
media/base/composite_filter.cc:484: void
CompositeFilter::OnCallback(MessageLoop* message_loop,
On 2011/01/11 05:23:59, acolwell wrote:
> On 2011/01/11 00:36:57, scherkus wrote:
> > few sanity checks...
> > 
> > Is the issue that someone is simply holding onto a reference as opposed to
> > executing the task after CompositeFilter should have died?
> > 
> 
> The issue is that this code was accidentally opening the possibility of
> transferring ownership to a different thread. This can cause all sorts of
> problems because filters & threads owned by the composite can end up outliving
> the pipeline & pipeline thread in extreme situations.

Gotcha!

> > Can we make any guarantees of the lifetime of CompositeFilter?  I know
> > CompositeFilter inherits from Filter, which includes RefCountedThreadSafe
but
> > say if it didn't (somehow!) we could declare CompositeFilter with
> > DISABLE_RUNNABLE_METHOD_REFCOUNT() and then this problem would go away (but
> that
> > only really works if we're positive that any potential callees have been
> > destroyed and/or won't call CompositeFilter)
> 
> For all intents and purposes the PipelineImpl owns the composite. Ideally I
> would like to get rid of the RefCountedThreadSafe in Filter and make ownership
a
> lot more straightforward and predictable. I just didn't want to make that
change
> yet. I figured that addressing the current flakiness was preferable to doing
> something that could trigger other issues to appear. 

Agree 100% -- we haven't found an explicit need for ref counting and guess what!
 it can cause bugs like this!

Powered by Google App Engine
This is Rietveld 408576698