Bug 1301055 - part2 : create a error sink to handle media element's error related event. r=bkelly,jwwang

Error sink would be response for the error handling, we could write different
error dispatching stragedies for different situation. eg. if we can play
unsupported type media with external app, we won't dispatch the "error" event on fennec.

MozReview-Commit-ID: Lm4x9ksspAY
This commit is contained in:
Alastor Wu
2016-11-24 10:24:04 +08:00
parent df15e2f852
commit 726bbd643a
2 changed files with 85 additions and 44 deletions

View File

@@ -421,10 +421,7 @@ public:
// WebIDL
MediaError* GetError() const
{
return mError;
}
MediaError* GetError() const;
// XPCOM GetSrc() is OK
void SetSrc(const nsAString& aSrc, ErrorResult& aRv)
@@ -761,6 +758,7 @@ protected:
virtual ~HTMLMediaElement();
class ChannelLoader;
class ErrorSink;
class MediaLoadListener;
class MediaStreamTracksAvailableCallback;
class MediaStreamTrackListener;
@@ -1357,9 +1355,6 @@ protected:
RefPtr<ChannelLoader> mChannelLoader;
// Error attribute
RefPtr<MediaError> mError;
// The current media load ID. This is incremented every time we start a
// new load. Async events note the ID when they're first sent, and only fire
// if the ID is unchanged when they come to fire.
@@ -1745,6 +1740,8 @@ private:
bool mAudible;
Visibility mVisibilityState;
UniquePtr<ErrorSink> mErrorSink;
};
} // namespace dom