Bug 1343437 - MediaDataDemuxer::InitPromise resolve-value is now a MediaResult - r?jya
In case of successful initialization, there could still be some warning about
a recoverable error. To carry more information about this potential warning,
the resolve-value type of the promise is changed from nsresult to MediaResult.
Existing code doesn't need to be changed:
- In Resolve() calls, the stored MediaResult can implicitly be constructed from
an nsresult -- always NS_OK at the moment anyway.
- In following Then(), the promise's MediaResult can implicitly be converted to
an nsresult.
Future patches will modify some of the Resolve's and Then's, to forward warning
details to some Decoder Doctor object...
MozReview-Commit-ID: J0bXDFxXQHQ
--- a/dom/media/MediaDataDemuxer.h
+++ b/dom/media/MediaDataDemuxer.h
@@ -27,17 +27,18 @@ class TrackMetadataHolder;
// MediaDataDemuxer isn't designed to be thread safe.
// When used by the MediaFormatDecoder, care is taken to ensure that the demuxer
// will never be called from more than one thread at once.
class MediaDataDemuxer
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaDataDemuxer)
- typedef MozPromise<nsresult, MediaResult, /* IsExclusive = */ true> InitPromise;
+ typedef
+ MozPromise<MediaResult, MediaResult, /* IsExclusive = */ true> InitPromise;
// Initializes the demuxer. Other methods cannot be called unless
// initialization has completed and succeeded.
// Typically a demuxer will wait to parse the metadata before resolving the
// promise. The promise must not be resolved until sufficient data is
// supplied. For example, an incomplete metadata would cause the promise to be
// rejected should no more data be coming, while the demuxer would wait
// otherwise.