Bug 1299072: P1. Add message attribute to MediaError object, r?gerald
MozReview-Commit-ID: HT6mIg4X0Sz
--- a/dom/html/MediaError.cpp
+++ b/dom/html/MediaError.cpp
@@ -30,16 +30,21 @@ MediaError::MediaError(HTMLMediaElement*
NS_IMETHODIMP MediaError::GetCode(uint16_t* aCode)
{
if (aCode)
*aCode = Code();
return NS_OK;
}
+NS_IMETHODIMP MediaError::GetMessage(nsAString& aResult)
+{
+ return NS_OK;
+}
+
JSObject*
MediaError::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return MediaErrorBinding::Wrap(aCx, this, aGivenProto);
}
} // namespace dom
} // namespace mozilla
--- a/dom/interfaces/html/nsIDOMMediaError.idl
+++ b/dom/interfaces/html/nsIDOMMediaError.idl
@@ -7,21 +7,23 @@
[uuid(7bd8c29f-8a76-453f-9373-79f820f2dc01)]
interface nsIDOMMediaError : nsISupports
{
/* The download of the media resource was aborted by
the user agent at the user's requet */
const unsigned short MEDIA_ERR_ABORTED = 1;
- /* A network error of some description caused the
+ /* A network error of some description caused the
user agent to stop downloading the media resource */
const unsigned short MEDIA_ERR_NETWORK = 2;
- /* An error of some description occurred while decoding
+ /* An error of some description occurred while decoding
the media resource */
const unsigned short MEDIA_ERR_DECODE = 3;
/* No suitable media resource could be found */
const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
readonly attribute unsigned short code;
+
+ readonly attribute DOMString message;
};
--- a/dom/webidl/MediaError.webidl
+++ b/dom/webidl/MediaError.webidl
@@ -14,9 +14,11 @@
interface MediaError {
const unsigned short MEDIA_ERR_ABORTED = 1;
const unsigned short MEDIA_ERR_NETWORK = 2;
const unsigned short MEDIA_ERR_DECODE = 3;
const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
[Constant]
readonly attribute unsigned short code;
+ [Pref="dom.MediaError.message.enabled"]
+ readonly attribute DOMString message;
};
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -292,16 +292,23 @@ pref("print.shrink-to-fit.scale-limit-pe
pref("print.use_simplify_page", false);
// Disable support for MathML
pref("mathml.disabled", false);
// Enable scale transform for stretchy MathML operators. See bug 414277.
pref("mathml.scale_stretchy_operators.enabled", true);
+// Disable MediaError.message.
+#ifdef RELEASE_BUILD
+pref("dom.MediaError.message.enabled", false);
+#else
+pref("dom.MediaError.message.enabled", true);
+#endif
+
// Media cache size in kilobytes
pref("media.cache_size", 512000);
// When a network connection is suspended, don't resume it until the
// amount of buffered data falls below this threshold (in seconds).
pref("media.cache_resume_threshold", 999999);
// Stop reading ahead when our buffered data is this many seconds ahead
// of the current playback position. This limit can stop us from using arbitrary
// amounts of network bandwidth prefetching huge videos.