Bug 1564466 - Remove MediaSource::{Enabled,ExperimentalEnabled}, and use [Pref] on the IDL instead. r=bzbarsky

Differential Revision: https://phabricator.services.mozilla.com/D38098

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2019-07-18 13:06:25 +00:00
parent f34964f6bc
commit 1e51ee6ad5
7 changed files with 8 additions and 23 deletions

View File

@ -427,18 +427,6 @@ bool MediaSource::IsTypeSupported(const GlobalObject& aOwner,
return NS_SUCCEEDED(rv);
}
/* static */
bool MediaSource::Enabled(JSContext* cx, JSObject* aGlobal) {
// FIXME(emilio): Looks like this should just use [Pref="..."] on the IDL.
return StaticPrefs::media_mediasource_enabled();
}
/* static */
bool MediaSource::ExperimentalEnabled(JSContext* cx, JSObject* aGlobal) {
// FIXME(emilio): Looks like this should just use [Pref="..."] on the IDL.
return StaticPrefs::media_mediasource_experimental_enabled();
}
void MediaSource::SetLiveSeekableRange(double aStart, double aEnd,
ErrorResult& aRv) {
MOZ_ASSERT(NS_IsMainThread());

View File

@ -83,9 +83,6 @@ class MediaSource final : public DOMEventTargetHelper,
static nsresult IsTypeSupported(const nsAString& aType,
DecoderDoctorDiagnostics* aDiagnostics);
static bool Enabled(JSContext* cx, JSObject* aGlobal);
static bool ExperimentalEnabled(JSContext* cx, JSObject* aGlobal);
IMPL_EVENT_HANDLER(sourceopen);
IMPL_EVENT_HANDLER(sourceended);
IMPL_EVENT_HANDLER(sourceclosed);

View File

@ -79,6 +79,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 {
[Func="mozilla::dom::MediaSource::Enabled", NewObject]
[Pref="media.mediasource.enabled", NewObject]
VideoPlaybackQuality getVideoPlaybackQuality();
};

View File

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

View File

@ -15,7 +15,7 @@ enum SourceBufferAppendMode {
"sequence"
};
[Func="mozilla::dom::MediaSource::Enabled"]
[Pref="media.mediasource.enabled"]
interface SourceBuffer : EventTarget {
[SetterThrows]
attribute SourceBufferAppendMode mode;
@ -42,9 +42,9 @@ interface SourceBuffer : EventTarget {
void appendBuffer(ArrayBufferView data);
// Experimental function as proposed in:
// https://github.com/w3c/media-source/issues/100 for promise proposal.
[Throws, Func="mozilla::dom::MediaSource::ExperimentalEnabled"]
[Throws, Pref="media.mediasource.experimental.enabled"]
Promise<void> appendBufferAsync(ArrayBuffer data);
[Throws, Func="mozilla::dom::MediaSource::ExperimentalEnabled"]
[Throws, Pref="media.mediasource.experimental.enabled"]
Promise<void> appendBufferAsync(ArrayBufferView data);
//[Throws]
//void appendStream(Stream stream, [EnforceRange] optional unsigned long long maxSize);
@ -54,7 +54,7 @@ interface SourceBuffer : EventTarget {
void remove(double start, unrestricted double end);
// Experimental function as proposed in:
// https://github.com/w3c/media-source/issues/100 for promise proposal.
[Throws, Func="mozilla::dom::MediaSource::ExperimentalEnabled"]
[Throws, Pref="media.mediasource.experimental.enabled"]
Promise<void> removeAsync(double start, unrestricted double end);
// Experimental function as proposed in:
// https://github.com/w3c/media-source/issues/155

View File

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

View File

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