Bug 95217 - Make MediaSource event dispatch asynchronous.
Summary: Make MediaSource event dispatch asynchronous.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Aaron Colwell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-28 11:02 PDT by Aaron Colwell
Modified: 2012-08-28 18:07 PDT (History)
3 users (show)

See Also:


Attachments
Patch (21.29 KB, patch)
2012-08-28 11:14 PDT, Aaron Colwell
no flags Details | Formatted Diff | Diff
Patch (18.00 KB, patch)
2012-08-28 13:06 PDT, Aaron Colwell
no flags Details | Formatted Diff | Diff
Patch (17.99 KB, patch)
2012-08-28 14:02 PDT, Aaron Colwell
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Colwell 2012-08-28 11:02:56 PDT
Make MediaSource event dispatch asynchronous.
Comment 1 Aaron Colwell 2012-08-28 11:14:21 PDT
Created attachment 161017 [details]
Patch
Comment 2 Eric Carlson 2012-08-28 12:05:22 PDT
Comment on attachment 161017 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=161017&action=review

r- because the crash is unrelated to this change and should be fixed in another patch.

> Source/WebCore/ChangeLog:9
> +        - Update MediaSource & SourceBufferList to use a GenericEventQueue to dispatch events 
> +          instead of using synchronous dispatch.

I questioned synchronous event dispatch in an earlier review. Did the spec change or was it a bug all along?

> Source/WebCore/ChangeLog:10
> +        - Fix a use-after-free bug in SourceBufferList::remove().

This fix should really be done in another patch. Why not use bug 94950?

> Source/WebCore/Modules/mediasource/MediaSource.cpp:57
> +    m_sourceBuffers = SourceBufferList::create(scriptExecutionContext(),
> +                                               m_asyncEventQueue.get());
> +    m_activeSourceBuffers = SourceBufferList::create(scriptExecutionContext(),
> +                                                     m_asyncEventQueue.get());

Nit: I don't think the line breaks make this more readable.

> Source/WebCore/Modules/mediasource/MediaSource.h:103
>      virtual void derefEventTarget() OVERRIDE { deref(); }
>  
> +
> +    void scheduleEvent(const AtomicString& eventName);

Nit: you have an extra blank line here.

> LayoutTests/http/tests/media/media-source/video-media-source-async-events.html:14
> +                inEventHandler = true;

Nit: it would probably be better for inEventHandler to be a counter rather than a bool.

> LayoutTests/http/tests/media/media-source/video-media-source-event-attributes.html:-22
> -               endTest();

Why did this test previously have to calls to endTest()?
Comment 3 Aaron Colwell 2012-08-28 13:05:09 PDT
Comment on attachment 161017 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=161017&action=review

>> Source/WebCore/ChangeLog:9
>> +          instead of using synchronous dispatch.
> 
> I questioned synchronous event dispatch in an earlier review. Did the spec change or was it a bug all along?

It was a bug all along. I think there was just some miscommunication when annacc responded to your comments.

>> Source/WebCore/ChangeLog:10
>> +        - Fix a use-after-free bug in SourceBufferList::remove().
> 
> This fix should really be done in another patch. Why not use bug 94950?

Ok. I'll split it back out into two patches. I'll have to find a new way to smoke out that bug. :/

>> Source/WebCore/Modules/mediasource/MediaSource.cpp:57
>> +                                                     m_asyncEventQueue.get());
> 
> Nit: I don't think the line breaks make this more readable.

Done

>> Source/WebCore/Modules/mediasource/MediaSource.h:103
>> +    void scheduleEvent(const AtomicString& eventName);
> 
> Nit: you have an extra blank line here.

Done

>> LayoutTests/http/tests/media/media-source/video-media-source-async-events.html:14
>> +                inEventHandler = true;
> 
> Nit: it would probably be better for inEventHandler to be a counter rather than a bool.

Done

>> LayoutTests/http/tests/media/media-source/video-media-source-event-attributes.html:-22
>> -               endTest();
> 
> Why did this test previously have to calls to endTest()?

I honestly don't know. The old code would have called onSourceClose within the 'video.src = "";' statement so I'm not sure why this one was here.
Comment 4 Aaron Colwell 2012-08-28 13:06:27 PDT
Created attachment 161045 [details]
Patch
Comment 5 Eric Carlson 2012-08-28 13:49:49 PDT
Comment on attachment 161045 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=161045&action=review

> Source/WebCore/ChangeLog:14
> +        (WebCore::MediaSource::MediaSource): Create GenericEventQueue & pass a reference to SourceBufferList.

Nit: you actually pass a pointer to the GenericEventQueue, not a reference.
Comment 6 Aaron Colwell 2012-08-28 14:02:14 PDT
Comment on attachment 161045 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=161045&action=review

>> Source/WebCore/ChangeLog:14
>> +        (WebCore::MediaSource::MediaSource): Create GenericEventQueue & pass a reference to SourceBufferList.
> 
> Nit: you actually pass a pointer to the GenericEventQueue, not a reference.

Done
Comment 7 Aaron Colwell 2012-08-28 14:02:44 PDT
Created attachment 161055 [details]
Patch
Comment 8 WebKit Review Bot 2012-08-28 17:42:36 PDT
Comment on attachment 161055 [details]
Patch

Rejecting attachment 161055 [details] from commit-queue.

acolwell@chromium.org does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.

- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.

- If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your committer rights.
Comment 9 WebKit Review Bot 2012-08-28 18:07:33 PDT
Comment on attachment 161055 [details]
Patch

Clearing flags on attachment: 161055

Committed r126946: <http://trac.webkit.org/changeset/126946>
Comment 10 WebKit Review Bot 2012-08-28 18:07:36 PDT
All reviewed patches have been landed.  Closing bug.