Bug 1230272 - Remove version suffix from keySystem string reported by MediaKey*.keySystem attribute. r=gerald
authorChris Pearce <cpearce@mozilla.com>
Fri, 04 Dec 2015 17:35:40 +1300
changeset 275597 ef639f0bcc34fe226bfb3bf26b00a1b7fc8f66c1
parent 275596 f9246b7ca284aeaac858d4bf4f4eaac0af79c198
child 275598 368534fd8b50fad6073614bd544525289f5547b4
push id68889
push usercpearce@mozilla.com
push dateFri, 04 Dec 2015 04:37:44 +0000
treeherdermozilla-inbound@ef639f0bcc34 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1230272
milestone45.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 1230272 - Remove version suffix from keySystem string reported by MediaKey*.keySystem attribute. r=gerald
dom/media/eme/EMEUtils.cpp
dom/media/eme/EMEUtils.h
dom/media/eme/MediaKeySession.cpp
dom/media/eme/MediaKeySystemAccess.cpp
dom/media/eme/MediaKeys.cpp
dom/media/test/test_eme_requestKeySystemAccess.html
--- a/dom/media/eme/EMEUtils.cpp
+++ b/dom/media/eme/EMEUtils.cpp
@@ -98,26 +98,16 @@ ParseKeySystem(const nsAString& aInputKe
       aOutKeySystem = keySystem;
       aOutCDMVersion = minCDMVersion;
       return true;
     }
   }
   return false;
 }
 
-void
-ConstructKeySystem(const nsAString& aKeySystem,
-                   const nsAString& aCDMVersion,
-                   nsAString& aOutKeySystem)
-{
-  aOutKeySystem.Append(aKeySystem);
-  aOutKeySystem.AppendLiteral(".");
-  aOutKeySystem.Append(aCDMVersion);
-}
-
 ArrayData
 GetArrayBufferViewOrArrayBufferData(const dom::ArrayBufferViewOrArrayBuffer& aBufferOrView)
 {
   MOZ_ASSERT(aBufferOrView.IsArrayBuffer() || aBufferOrView.IsArrayBufferView());
   if (aBufferOrView.IsArrayBuffer()) {
     const dom::ArrayBuffer& buffer = aBufferOrView.GetAsArrayBuffer();
     buffer.ComputeLengthAndData();
     return ArrayData(buffer.Data(), buffer.Length());
--- a/dom/media/eme/EMEUtils.h
+++ b/dom/media/eme/EMEUtils.h
@@ -51,21 +51,16 @@ class ArrayBufferViewOrArrayBuffer;
 //
 // On success, aOutKeySystem contains the keySystem string stripped of the
 // min version number, and aOutMinCDMVersion contains the min version number
 // if present. If it was not present, aOutMinCDMVersion is NO_CDM_VERSION.
 bool ParseKeySystem(const nsAString& aKeySystem,
                     nsAString& aOutKeySystem,
                     int32_t& aOutMinCDMVersion);
 
-void
-ConstructKeySystem(const nsAString& aKeySystem,
-                   const nsAString& aCDMVersion,
-                   nsAString& aOutKeySystem);
-
 // Helper function to extract a copy of data coming in from JS in an
 // (ArrayBuffer or ArrayBufferView) IDL typed function argument.
 //
 // Only call this on a properly initialized ArrayBufferViewOrArrayBuffer.
 void
 CopyArrayBufferViewOrArrayBufferData(const dom::ArrayBufferViewOrArrayBuffer& aBufferOrView,
                                      nsTArray<uint8_t>& aOutData);
 
--- a/dom/media/eme/MediaKeySession.cpp
+++ b/dom/media/eme/MediaKeySession.cpp
@@ -86,17 +86,17 @@ MediaKeyError*
 MediaKeySession::GetError() const
 {
   return mMediaKeyError;
 }
 
 void
 MediaKeySession::GetKeySystem(nsString& aOutKeySystem) const
 {
-  ConstructKeySystem(mKeySystem, mCDMVersion, aOutKeySystem);
+  aOutKeySystem.Assign(mKeySystem);
 }
 
 void
 MediaKeySession::GetSessionId(nsString& aSessionId) const
 {
   aSessionId = GetSessionId();
 }
 
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -75,17 +75,17 @@ nsPIDOMWindow*
 MediaKeySystemAccess::GetParentObject() const
 {
   return mParent;
 }
 
 void
 MediaKeySystemAccess::GetKeySystem(nsString& aOutKeySystem) const
 {
-  ConstructKeySystem(mKeySystem, mCDMVersion, aOutKeySystem);
+  aOutKeySystem.Assign(mKeySystem);
 }
 
 void
 MediaKeySystemAccess::GetConfiguration(MediaKeySystemConfiguration& aConfig)
 {
   aConfig = mConfig;
 }
 
--- a/dom/media/eme/MediaKeys.cpp
+++ b/dom/media/eme/MediaKeys.cpp
@@ -120,17 +120,17 @@ JSObject*
 MediaKeys::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return MediaKeysBinding::Wrap(aCx, this, aGivenProto);
 }
 
 void
 MediaKeys::GetKeySystem(nsString& aOutKeySystem) const
 {
-  ConstructKeySystem(mKeySystem, mCDMVersion, aOutKeySystem);
+  aOutKeySystem.Assign(mKeySystem);
 }
 
 already_AddRefed<DetailedPromise>
 MediaKeys::SetServerCertificate(const ArrayBufferViewOrArrayBuffer& aCert, ErrorResult& aRv)
 {
   RefPtr<DetailedPromise> promise(MakePromise(aRv,
     NS_LITERAL_CSTRING("MediaKeys.setServerCertificate")));
   if (aRv.Failed()) {
--- a/dom/media/test/test_eme_requestKeySystemAccess.html
+++ b/dom/media/test/test_eme_requestKeySystemAccess.html
@@ -7,17 +7,16 @@
   <script type="text/javascript" src="manifest.js"></script>
   <script type="text/javascript" src="eme.js"></script>
 </head>
 <body>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 const CLEARKEY_ID = 'org.w3.clearkey';
-const CLEARKEY_VERSION = '1';
 const SUPPORTED_LABEL = "pass label";
 
 function ValidateConfig(name, expected, observed) {
   info("ValidateConfig " + name);
   info("expected cfg=" + JSON.stringify(expected));
   info("observed cfg=" + JSON.stringify(observed));
 
   is(observed.label, expected.label, name + " label should match");
@@ -46,17 +45,17 @@ function Test(test) {
     if (test.options) {
       p = navigator.requestMediaKeySystemAccess(test.keySystem, test.options);
     } else {
       p = navigator.requestMediaKeySystemAccess(test.keySystem);
     }
     p.then(
       function(keySystemAccess) {
         ok(test.shouldPass, name + " passed and was expected to " + (test.shouldPass ? "pass" : "fail"));
-        is(keySystemAccess.keySystem, CLEARKEY_ID + "." + CLEARKEY_VERSION, "CDM version should be in MediaKeySystemAccess.keySystem");
+        is(keySystemAccess.keySystem, CLEARKEY_ID, "CDM keySystem should be in MediaKeySystemAccess.keySystem");
         ValidateConfig(name, test.expectedConfig, keySystemAccess.getConfiguration());
         resolve();
       },
       function(ex) {
         if (test.shouldPass) {
           info(name + " failed: " + ex);
         }
         ok(!test.shouldPass, name + " failed and was expected to " + (test.shouldPass ? "pass" : "fail"));