Bug 1281866 - Rename gUM's SourceUnavailableError to NotReadableError. draft
authorJan-Ivar Bruaroey <jib@mozilla.com>
Thu, 23 Jun 2016 14:08:52 -0400
changeset 380940 d50e88426ce939183e3e196776e9438d4e1adfe8
parent 376275 ec20b463c04f57a4bfca1edb987fcb9e9707c364
child 381487 c5dacd59d04a0b33edd3be13d88504539623beaa
child 381490 b1a19a8a1e56fe2a402dec96372fd7896eb6d5fe
push id21356
push userjbruaroey@mozilla.com
push dateThu, 23 Jun 2016 18:13:17 +0000
bugs1281866
milestone50.0a1
Bug 1281866 - Rename gUM's SourceUnavailableError to NotReadableError. MozReview-Commit-ID: 53703E0DLHf
dom/media/MediaManager.cpp
dom/media/MediaStreamError.cpp
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -1189,30 +1189,30 @@ public:
 
     nsresult rv;
 
     if (mAudioDevice) {
       rv = mAudioDevice->Allocate(GetInvariant(mConstraints.mAudio),
                                   mPrefs, mOrigin);
       if (NS_FAILED(rv)) {
         LOG(("Failed to allocate audiosource %d",rv));
-        Fail(NS_LITERAL_STRING("SourceUnavailableError"),
+        Fail(NS_LITERAL_STRING("NotReadableError"),
              NS_LITERAL_STRING("Failed to allocate audiosource"));
         return NS_OK;
       }
     }
     if (mVideoDevice) {
       rv = mVideoDevice->Allocate(GetInvariant(mConstraints.mVideo),
                                   mPrefs, mOrigin);
       if (NS_FAILED(rv)) {
         LOG(("Failed to allocate videosource %d\n",rv));
         if (mAudioDevice) {
           mAudioDevice->GetSource()->Deallocate();
         }
-        Fail(NS_LITERAL_STRING("SourceUnavailableError"),
+        Fail(NS_LITERAL_STRING("NotReadableError"),
              NS_LITERAL_STRING("Failed to allocate videosource"));
         return NS_OK;
       }
     }
     PeerIdentity* peerIdentity = nullptr;
     if (!mConstraints.mPeerIdentity.IsEmpty()) {
       peerIdentity = new PeerIdentity(mConstraints.mPeerIdentity);
     }
--- a/dom/media/MediaStreamError.cpp
+++ b/dom/media/MediaStreamError.cpp
@@ -20,19 +20,18 @@ BaseMediaMgrError::BaseMediaMgrError(con
   if (mMessage.IsEmpty()) {
     if (mName.EqualsLiteral("NotFoundError")) {
       mMessage.AssignLiteral("The object can not be found here.");
     } else if (mName.EqualsLiteral("NotAllowedError")) {
       mMessage.AssignLiteral("The request is not allowed by the user agent "
                              "or the platform in the current context.");
     } else if (mName.EqualsLiteral("SecurityError")) {
       mMessage.AssignLiteral("The operation is insecure.");
-    } else if (mName.EqualsLiteral("SourceUnavailableError")) {
-      mMessage.AssignLiteral("The source of the MediaStream could not be "
-          "accessed due to a hardware error (e.g. lock from another process).");
+    } else if (mName.EqualsLiteral("NotReadableError")) {
+      mMessage.AssignLiteral("The I/O read operation failed.");
     } else if (mName.EqualsLiteral("InternalError")) {
       mMessage.AssignLiteral("Internal error.");
     } else if (mName.EqualsLiteral("NotSupportedError")) {
       mMessage.AssignLiteral("The operation is not supported.");
     } else if (mName.EqualsLiteral("OverconstrainedError")) {
       mMessage.AssignLiteral("Constraints could be not satisfied.");
     }
   }