Bug 1112761 part 1. Replace Pref="media.mediasource.enabled" annotations in IDL with calls to a function which will end up doing something a bit more interesting. r=kinetik

This commit is contained in:
Boris Zbarsky 2015-01-08 11:57:10 -05:00
parent 680106718b
commit f677fed96e
7 changed files with 13 additions and 5 deletions

View File

@ -306,6 +306,12 @@ MediaSource::IsTypeSupported(const GlobalObject&, const nsAString& aType)
return NS_SUCCEEDED(rv);
}
/* static */ bool
MediaSource::Enabled(JSContext* cx, JSObject* aGlobal)
{
return Preferences::GetBool("media.mediasource.enabled");
}
bool
MediaSource::Attach(MediaSourceDecoder* aDecoder)
{

View File

@ -60,6 +60,8 @@ public:
void EndOfStream(const Optional<MediaSourceEndOfStreamError>& aError, ErrorResult& aRv);
static bool IsTypeSupported(const GlobalObject&, const nsAString& aType);
static bool Enabled(JSContext* cx, JSObject* aGlobal);
/** End WebIDL Methods. */
NS_DECL_ISUPPORTS_INHERITED

View File

@ -48,6 +48,6 @@ partial interface HTMLVideoElement {
// https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#idl-def-HTMLVideoElement
partial interface HTMLVideoElement {
[Pref="media.mediasource.enabled", NewObject]
[Func="mozilla::dom::MediaSource::Enabled", NewObject]
VideoPlaybackQuality getVideoPlaybackQuality();
};

View File

@ -21,7 +21,7 @@ enum MediaSourceEndOfStreamError {
"decode"
};
[Constructor, Pref="media.mediasource.enabled"]
[Constructor, Func="mozilla::dom::MediaSource::Enabled"]
interface MediaSource : EventTarget {
readonly attribute SourceBufferList sourceBuffers;
readonly attribute SourceBufferList activeSourceBuffers;

View File

@ -15,7 +15,7 @@ enum SourceBufferAppendMode {
"sequence"
};
[Pref="media.mediasource.enabled"]
[Func="mozilla::dom::MediaSource::Enabled"]
interface SourceBuffer : EventTarget {
[SetterThrows]
attribute SourceBufferAppendMode mode;

View File

@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
[Pref="media.mediasource.enabled"]
[Func="mozilla::dom::MediaSource::Enabled"]
interface SourceBufferList : EventTarget {
readonly attribute unsigned long length;
getter SourceBuffer (unsigned long index);

View File

@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
[Pref="media.mediasource.enabled"]
[Func="mozilla::dom::MediaSource::Enabled"]
interface VideoPlaybackQuality {
readonly attribute DOMHighResTimeStamp creationTime;
readonly attribute unsigned long totalVideoFrames;