Commit Graph

52 Commits

Author SHA1 Message Date
Bobby Holley
161ad41b60 Bug 1154805 - Stop manually passing TaskDispatchers everywhere. r=jww 2015-04-16 09:28:56 -07:00
Bobby Holley
775574adac 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
3aa1882d75 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
f307577db2 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
1052dcb91b Bug 1151656 - Make MediaPromises operate with TaskDispatchers. r=mattwoodrow 2015-04-08 21:33:21 -07:00
Bobby Holley
7b1b28e48a 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
5cccea6f0f 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
6e48198a60 Bug 1144487 - Implement AbstractThread. r=mattwoodrow 2015-03-18 08:25:55 -07:00
Bobby Holley
2b06e85fba Bug 1135424 - Switch the MDSM to a task queue. r=mattwoodrow 2015-03-16 14:38:44 -07:00
Bobby Holley
8e2f379ee2 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
dc0c8ecc2d 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
5a6a477341 Bug 1135424 - Switch the MDSM to a task queue. r=mattwoodrow 2015-03-12 17:54:35 -07:00
Bobby Holley
fbe84e5f65 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
59b2b13501 Bug 1135170 - Rewrite the MediaDecoder-to-MediaDecoderStateMachine interface to be Promise-based. r=mattwoodrow 2015-03-06 19:17:07 -08:00
Bobby Holley
3481a5fcb8 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
98d68f4462 Bug 1135785 - Introduce a 1-argument overload of ProxyMediaCall. r=cpearce 2015-03-01 19:33:45 -08:00
Bobby Holley
394cbf170c 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
858686ffeb 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
eafff928eb Bug 1128576: Annotate MediaPromise.h method 'AssertOnDispatchThread' as MOZ_OVERRIDE. rs=bholley 2015-02-09 11:11:40 -08:00
Bobby Holley
a7c5c1cc26 Bug 1129523 - Implement MediaPromise proxies. r=cpearce,r=mattwoodrow 2015-02-04 17:12:51 -08:00
Bobby Holley
16acf82831 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
b29def8cb3 Bug 1129224: Ensure the target is always unref in the target thread. r:bholley 2015-02-04 16:38:27 +11:00
Bobby Holley
feeb9b8cdf Bug 1126465 - Implement the ability to disconnect outstanding promises. r=mattwoodrow 2015-01-29 22:11:11 -08:00
Bobby Holley
26025b8ba0 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
75237bcb50 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
6297d58550 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
ef6fc9a828 Bug 1126465 - Implement the ability to disconnect outstanding promises. r=mattwoodrow 2015-01-28 18:54:11 -08:00
Bobby Holley
74b8e284f0 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
aba3464b85 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
0123880649 Bug 1123983 - Implement exclusivity checking for MediaPromises. r=cpearce 2015-01-21 14:34:26 -08:00
Ehsan Akhgari
deaba252bc 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
df30dead27 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
93e24340d6 Bug 1111413 - Part 1: Use MediaPromises for seeking. r=bholley 2014-12-16 22:52:57 +13:00
Bobby Holley
2963d4eccb Bug 1109954 - Make resolve/reject values optional in callback signatures. r=cpearce 2014-12-12 14:22:23 -08:00
Bobby Holley
f9be8aa27b 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
6fb40adfa1 Bug 1109954 - Make resolve/reject values optional in callback signatures. r=cpearce 2014-12-10 22:38:33 -08:00
Ehsan Akhgari
f818603dd9 Bug 1109694 - Fix more bad implicit constructors in DOM; r=baku 2014-12-10 17:49:09 -05:00
Bobby Holley
088d063c01 Bug 1108701 - Replace AudioDecodeRendezvous with promise-y goodness. r=cpearce,karlt 2014-12-10 14:03:56 -08:00
Bobby Holley
ba98ab94b3 Bug 1108767 - Add the ability to chain same-type promises. r=cpearce 2014-12-08 17:19:05 -08:00
Bobby Holley
f179579bc7 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
755778772f Bug 1108767 - Add MediaPromise::{Resolve,Reject}IfExists. r=cpearce 2014-12-08 17:19:05 -08:00
Bobby Holley
bf39da4317 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
Bobby Holley
0f928b59bc Bug 1108767 - Separate ThenValueRunnable so that the constructors don't collide when the resolve value is the same as the reject value. r=cpearce 2014-12-08 17:19:05 -08:00
Bobby Holley
b9edd1ae36 Bug 1097823 - Implement Media Promises. r=cpearce 2014-12-08 14:45:37 -08:00
Ryan VanderMeulen
b04ae532a6 Backed out changesets ae63e2dda6e0, a9ca0113db3c, and d0a6757e24bd (bug 1097823) for bustage.
DONTBUILD CLOSED TREE
2014-12-08 15:00:02 -05:00
Bobby Holley
2899d41945 Bug 1097823 - Implement Media Promises. r=cpearce 2014-12-08 11:34:50 -08:00
Bobby Holley
a23a0bacd4 Backed out changeset b56e5e762329 (bug 1097823) 2014-12-07 17:09:09 -08:00
Bobby Holley
1239cadbd6 Backed out changeset b76636e9f49a (bug 1097823) 2014-12-07 17:09:08 -08:00
Bobby Holley
a476d023e6 Backed out changeset ab6ddc8ac28a (bug 1097823) 2014-12-07 17:09:06 -08:00
Bobby Holley
f1db05e38a Bug 1097823 - Replace AudioDecodeRendezvous with promise-y goodness. r=cpearce,karlt 2014-12-07 11:21:35 -08:00