Bug 1299072: P1. Add message attribute to MediaError object, r=bz,Ehsan,gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 09 Sep 2016 15:43:25 +1000
changeset 357289 d17a9e0123a96a5597615764cba908807eeb47ce
parent 357046 4fb8ce27c37fd72b2ea08fe299f590071dc60f8c
child 357290 a0c433d64e16dd90875ccc9d644619cd669e81c0
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, Ehsan, gerald
bugs1299072
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1299072: P1. Add message attribute to MediaError object, r=bz,Ehsan,gerald MozReview-Commit-ID: HT6mIg4X0Sz
dom/html/MediaError.cpp
dom/interfaces/html/nsIDOMMediaError.idl
dom/webidl/MediaError.webidl
modules/libpref/init/all.js
--- 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.