Closed
Bug 1144487
Opened 10 years ago
Closed 10 years ago
Create a class to abstract out the semantic differences between nsIThread and MediaTaskQueue
Categories
(Core :: Audio/Video, defect)
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: bholley, Assigned: bholley)
References
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
mattwoodrow
:
review+
|
Details | Diff | Splinter Review |
I wrote a patch to do this as part of bug 1144481. It ends up being a nice simplification of the existing MediaPromise code, and can land independently.
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8579080 -
Flags: review?(matt.woodrow)
Assignee | ||
Comment 2•10 years ago
|
||
Comment 3•10 years ago
|
||
How is it different the nsIEventTarget interface? Can it implement nsIEventTarget as SharedThreadPool does so that we can use it as an nsIEventTarget without knowing the thread pool guts under the hood?
Assignee | ||
Comment 4•10 years ago
|
||
Comment on attachment 8579080 [details] [diff] [review]
Implement AbstractThread. v1
(In reply to JW Wang [:jwwang] from comment #3)
> How is it different the nsIEventTarget interface? Can it implement
> nsIEventTarget as SharedThreadPool does so that we can use it as an
> nsIEventTarget without knowing the thread pool guts under the hood?
They're similar, but AbstractThread guarantees that two events will not run at the same time - either because it's a single thread or because it's a task queue. In particular, using an nsIThreadPool where we use an AbstractThread would break a lot of our invariants.
I think it does make sense to make this more explicit by specializing on nsIThread (instead of nsIEventTarget) and making the nsIEventTarget version QI to nsIThread, assert, and delegate. I'll do that now.
Also, FWIW, AbstractThread is nicer to work with than nsIEventTarget, because of the lack of XPIDL goop.
Attachment #8579080 -
Flags: review?(matt.woodrow)
Assignee | ||
Comment 5•10 years ago
|
||
Assignee | ||
Comment 6•10 years ago
|
||
Attachment #8579080 -
Attachment is obsolete: true
Attachment #8579118 -
Flags: review?(matt.woodrow)
Assignee | ||
Updated•10 years ago
|
Summary: Create a class to abstract out the semantic differences between nsIEventTarget and MediaTaskQueue → Create a class to abstract out the semantic differences between nsIThread and MediaTaskQueue
Updated•10 years ago
|
Attachment #8579118 -
Flags: review?(matt.woodrow) → review+
Comment 7•10 years ago
|
||
I see. The semantics of nsIEventTarget is too loose to guarantee events will run in order. On the other hand, nsIThread is too strict which is mapped to an OS thread directly.
Assignee | ||
Comment 8•10 years ago
|
||
(In reply to JW Wang [:jwwang] from comment #7)
> I see. The semantics of nsIEventTarget is too loose to guarantee events will
> run in order. On the other hand, nsIThread is too strict which is mapped to
> an OS thread directly.
Precisely :-)
https://hg.mozilla.org/integration/mozilla-inbound/rev/396bd3381cd4
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in
before you can comment on or make changes to this bug.
Description
•