Commit Graph

60 Commits

Author SHA1 Message Date
Jean-Yves Avenard
6dac7a9a48 Bug 1162482: Make templated MediaPromise class inherit from ref-counted base. r=bholley
NS_INLINE_DECL_THREADSAFE_REFCOUNTING can't be used with templated classes.
2015-05-11 20:52:01 +10:00
Carsten "Tomcat" Book
4bb7f96375 Backed out changeset 41c408a2662e (bug 857895) for bustage on a CLOSED TREE 2015-05-11 10:28:56 +02:00
Matt Woodrow
a8b275cbb0 Bug 857895 - Run canvas rendering asynchronously on OSX. r=Bas,bholley
--HG--
extra : rebase_source : f94b65530bfb40298ed6ea1f22d607b0fc8b464f
2013-04-09 16:51:44 +12:00
Bobby Holley
14e17d8213 Bug 1161742 - Add support for lambdas in MediaPromise. r=jww 2015-05-05 21:02:58 -07:00
Bobby Holley
ebfaa1d8dc Bug 1161742 - Factor out the guts of RefableThen to make them usable for Function-y {,Refable}Then(...) calls. r=jww 2015-05-05 21:02:58 -07:00
Bobby Holley
dd4ebd5ffd Bug 1161742 - Hoist part of ResolveOrReject into ThenValueBase. r=jww 2015-05-05 21:02:57 -07:00
Bobby Holley
06f8f8a8a7 Bug 1161742 - Introduce ResolveOrRejectValue to make MediaPromise implementation less verbose. r=jww 2015-05-05 21:02:57 -07:00
Bobby Holley
59a144d6a2 Bug 1161742 - Hoist dispatch-related stuff from ThenValue to ThenValueBase. r=jww
This cleanup was made possibly by the introduction of AbstractThread. :-)
2015-05-05 21:02:56 -07:00
Bobby Holley
b99288ff18 Bug 1154805 - Stop manually passing TaskDispatchers everywhere. r=jww 2015-04-16 09:28:56 -07:00
Bobby Holley
b4d1c00c0c Bug 1154782 - Remove the concept of forced dispatch. r=jww
I added this several months ago to make MediaPromise dispatch reliable in the
presence of the god-awful Flush() feature of MediaTaskQueue. That feature has
now been restricted to a special subclass (which we should eventually eliminate),
so we can just assert that MediaPromises are never used on those task queues
and simplify the rest of the code.
2015-04-15 22:26:57 -07:00
Bobby Holley
d9894d631d Bug 1154782 - Hoist dispatch failure handling into dispatch itself. r=jww
This is nicer than scattering the failure handling to each callsite. Moreover,
this is a necessary step on the road to automatic tail dispatch.
2015-04-15 22:26:23 -07:00
Bobby Holley
177765d6a7 Bug 1153370 - Do MediaPromise TailDispatch checking outside the scope of the MediaPromise lock. r=jww
This reduces the potential for deadlocks.
2015-04-13 11:13:08 -07:00
Bobby Holley
018e5fc24d Bug 1151656 - Make MediaPromises operate with TaskDispatchers. r=mattwoodrow 2015-04-08 21:33:21 -07:00
Bobby Holley
9abe3c0ae3 Bug 1150687 - Have callers pass an AbstractThread directly to promise APIs and remove wrapper-style AbstractThreads for MediaTaskQueue. r=jww 2015-04-06 11:09:27 -07:00
Ehsan Akhgari
883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Bobby Holley
c64dbd1ed9 Bug 1144487 - Implement AbstractThread. r=mattwoodrow 2015-03-18 08:25:55 -07:00
Bobby Holley
53ad5b2a9c Bug 1135424 - Switch the MDSM to a task queue. r=mattwoodrow 2015-03-16 14:38:44 -07:00
Bobby Holley
1d46643778 Bug 1135424 - Allow MediaPromise dispatch to fail if the ThenValue has been disconnected. r=mattwoodrow
The original idea behind the current model was that we wanted ironclad guarantees
that consumers would always get a callback on their promise. But we now have use
cases where the consumer wants to forget about a promise (using the new
Disconnect()) feature, and in some cases wants to shut down the task queue that
the response is going to be dispatched on. In the case of this bug, we want to
avoid waiting for the longest outstanding timer promise to be resolved before
shutting down the MDSM.

So this patch fixes up the pieces needed to make this work:
* Loosening our invariants to allow dispatch targets to be released on any thread,
  since MediaTaskQueue and nsIEventTarget both have thread-safe refcounting.
* Releasing mThisVal in Disconnect, so that we no longer depend on successful
  dispatch to release it on the correct (dispatch) thread.
* Fiddling with various assertions.

We also make some assertions fatal in nightly/aurora builds while we're at it.
2015-03-16 14:38:42 -07:00
Phil Ringnalda
345a4eca93 Back out 3 changesets (bug 1135424) on suspicion of causing frequent hangs in test_playback.html on mochitest-e10s
CLOSED TREE

Backed out changeset 584d91ffdf88 (bug 1135424)
Backed out changeset d86806ea63f4 (bug 1135424)
Backed out changeset e52401d30a67 (bug 1135424)
2015-03-12 23:05:11 -07:00
Bobby Holley
0563f41ef7 Bug 1135424 - Switch the MDSM to a task queue. r=mattwoodrow 2015-03-12 17:54:35 -07:00
Bobby Holley
ab44849fc5 Bug 1135424 - Allow MediaPromise dispatch to fail if the ThenValue has been disconnected. r=mattwoodrow
The original idea behind the current model was that we wanted ironclad guarantees
that consumers would always get a callback on their promise. But we now have use
cases where the consumer wants to forget about a promise (using the new
Disconnect()) feature, and in some cases wants to shut down the task queue that
the response is going to be dispatched on. In the case of this bug, we want to
avoid waiting for the longest outstanding timer promise to be resolved before
shutting down the MDSM.

So this patch fixes up the pieces needed to make this work:
* Loosening our invariants to allow dispatch targets to be released on any thread,
  since MediaTaskQueue and nsIEventTarget both have thread-safe refcounting.
* Releasing mThisVal in Disconnect, so that we no longer depend on successful
  dispatch to release it on the correct (dispatch) thread.
* Fiddling with various assertions.

We also make some assertions fatal in nightly/aurora builds while we're at it.
2015-03-12 17:52:50 -07:00
Bobby Holley
578cad549e Bug 1135170 - Rewrite the MediaDecoder-to-MediaDecoderStateMachine interface to be Promise-based. r=mattwoodrow 2015-03-06 19:17:07 -08:00
Bobby Holley
ba77f2e511 Bug 1135785 - Return samples on state machine thread. r=cpearce
This is necessary because we're going to want to start disconnecting sample
and seek requests directly from the state machine thread, and the machinery
asserts that disconnection happens on the same thread as resolution.

More generally, this is the right thing to do architecturally, and will help
wean us off the monitor.
2015-03-01 19:33:49 -08:00
Bobby Holley
206603a7ab Bug 1135785 - Introduce a 1-argument overload of ProxyMediaCall. r=cpearce 2015-03-01 19:33:45 -08:00
Bobby Holley
3cd78a98e0 Bug 1132023 - Fix unused variable warning on builds without MOZ_DIAGNOSTIC_ASSERT. v1 r=rillian 2015-02-11 11:58:37 -08:00
Bobby Holley
4b06c284a3 Bug 1129877 - Separate the creator and consumer APIs for MediaPromise. v2 r=mattwoodrow
This causes the buggy code that caused the crash to fail to compile.
2015-02-10 13:45:04 -08:00
Daniel Holbert
77de0543b1 Bug 1128576: Annotate MediaPromise.h method 'AssertOnDispatchThread' as MOZ_OVERRIDE. rs=bholley 2015-02-09 11:11:40 -08:00
Bobby Holley
1bedd8d3d7 Bug 1129523 - Implement MediaPromise proxies. r=cpearce,r=mattwoodrow 2015-02-04 17:12:51 -08:00
Bobby Holley
8f668dcd13 Bug 1129247 - Use MOZ_DIAGNOSTIC_ASSERT instead of MOZ_RELEASE_ASSERT in media code. r=mattwoodrow 2015-02-04 13:13:59 -08:00
Jean-Yves Avenard
672121e19f Bug 1129224: Ensure the target is always unref in the target thread. r:bholley 2015-02-04 16:38:27 +11:00
Bobby Holley
652ca5c482 Bug 1126465 - Implement the ability to disconnect outstanding promises. r=mattwoodrow 2015-01-29 22:11:11 -08:00
Bobby Holley
7c0de4212e Bug 1126465 - Introduce machinery to hold onto MediaPromise::Consumer references, and use it for MediaSourceReader subdecoders. r=mattwoodrow 2015-01-29 22:11:11 -08:00
Bobby Holley
c8055e8c00 Bug 1126465 - Make ThenValueBase inherit from a publicly-usable type, and refcount it. r=mattwoodrow 2015-01-29 22:11:11 -08:00
Wes Kocher
510f7d8823 Backed out 10 changesets (bug 1126465) for b2g osx build bustage on a CLOSED TREE
Backed out changeset a0a572ab4614 (bug 1126465)
Backed out changeset c96bac2df9a4 (bug 1126465)
Backed out changeset ebe589cc0d92 (bug 1126465)
Backed out changeset 96e70a10440c (bug 1126465)
Backed out changeset 47301816c705 (bug 1126465)
Backed out changeset dd957ede2d36 (bug 1126465)
Backed out changeset d8045d89bfda (bug 1126465)
Backed out changeset 22aff1448376 (bug 1126465)
Backed out changeset 212c4e3377f8 (bug 1126465)
Backed out changeset 408b00141b82 (bug 1126465)
2015-01-28 19:54:34 -08:00
Bobby Holley
a99152a386 Bug 1126465 - Implement the ability to disconnect outstanding promises. r=mattwoodrow 2015-01-28 18:54:11 -08:00
Bobby Holley
a65345d2e7 Bug 1126465 - Introduce machinery to hold onto MediaPromise::Consumer references, and use it for MediaSourceReader subdecoders. r=mattwoodrow 2015-01-28 18:54:11 -08:00
Bobby Holley
fad5c38f01 Bug 1126465 - Make ThenValueBase inherit from a publicly-usable type, and refcount it. r=mattwoodrow 2015-01-28 18:54:10 -08:00
Bobby Holley
a18cc7d480 Bug 1123983 - Implement exclusivity checking for MediaPromises. r=cpearce 2015-01-21 14:34:26 -08:00
Ehsan Akhgari
31a966ecd6 Bug 1117261 - Mark virtual overridden functions as MOZ_OVERRIDE in DOM media code; r=rillian 2015-01-08 23:11:30 -05:00
Bobby Holley
ffd128ab61 Bug 1109437 - Remove MOZ_COUNT_{C,D}TOR on refcounted promise classes. r=cpearce
These were accidental and redundant, because refcounted classes get this behavior
automatically. And this is very lucky, because it turns out that our MOZ_COUNT_*
infrastructure can't handle varying-sized instances identified with the same
string, which is exactly what we can get with these templated types.

The only remaining use of these macros is on the non-templated ThenValueBase,
which is happily not variable-sized. \o/
2014-12-22 00:20:30 -08:00
Matt Woodrow
2c7e571767 Bug 1111413 - Part 1: Use MediaPromises for seeking. r=bholley 2014-12-16 22:52:57 +13:00
Bobby Holley
da72b3891c Bug 1109954 - Make resolve/reject values optional in callback signatures. r=cpearce 2014-12-12 14:22:23 -08:00
Bobby Holley
ed81da5593 Backed out changeset 89c9d42ef78e (bug 1109954) for colliding with bug 1108701 on a CLOSED TREE. 2014-12-10 22:56:09 -08:00
Bobby Holley
6ec9fa2dd8 Bug 1109954 - Make resolve/reject values optional in callback signatures. r=cpearce 2014-12-10 22:38:33 -08:00
Ehsan Akhgari
550e972d13 Bug 1109694 - Fix more bad implicit constructors in DOM; r=baku 2014-12-10 17:49:09 -05:00
Bobby Holley
65fb74f0e7 Bug 1108701 - Replace AudioDecodeRendezvous with promise-y goodness. r=cpearce,karlt 2014-12-10 14:03:56 -08:00
Bobby Holley
9ef2bbc703 Bug 1108767 - Add the ability to chain same-type promises. r=cpearce 2014-12-08 17:19:05 -08:00
Bobby Holley
a143dac86d Bug 1108767 - Allow promises to be resolved without a MediaPromiseHolder. r=cpearce
It turns out that there are use-cases where this restriction is clunky.
2014-12-08 17:19:05 -08:00
Bobby Holley
dc54f0958e Bug 1108767 - Add MediaPromise::{Resolve,Reject}IfExists. r=cpearce 2014-12-08 17:19:05 -08:00
Bobby Holley
0f8a47ff4f Bug 1108767 - Stop including MediaTaskQueue.h from MediaPromise.h. r=cpearce
We need this so that MediaTaskQueue can use promises.
2014-12-08 17:19:05 -08:00