Backed out changeset 0e1dbfd10378 (bug 1501709) for build bustages on Windows platform, CLOSED TREE.
authorRazvan Maries <rmaries@mozilla.com>
Fri, 30 Nov 2018 06:58:06 +0200
changeset 505352 7e99dc45f560afd931870bd24f3ec60578a3c82b
parent 505351 0e1dbfd1037861318aa39868eb658cc26ed225fc
child 505353 b5e141f4ca9b59ae61e778c54536bf7aadff0dfc
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1501709
milestone65.0a1
backs out0e1dbfd1037861318aa39868eb658cc26ed225fc
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
Backed out changeset 0e1dbfd10378 (bug 1501709) for build bustages on Windows platform, CLOSED TREE.
dom/media/webaudio/AudioParamDescriptorMap.h
dom/media/webaudio/AudioWorkletGlobalScope.cpp
dom/media/webaudio/AudioWorkletGlobalScope.h
dom/media/webaudio/moz.build
dom/webidl/AudioParamDescriptor.webidl
dom/webidl/moz.build
dom/worklet/tests/test_audioWorkletGlobalScopeRegisterProcessor.html
dom/worklet/tests/worklet_test_audioWorkletGlobalScopeRegisterProcessor.js
deleted file mode 100644
--- a/dom/media/webaudio/AudioParamDescriptorMap.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_AudioParamDescriptor_h
-#define mozilla_dom_AudioParamDescriptor_h
-
-#include "mozilla/dom/AudioParamDescriptorBinding.h"
-#include "nsTArray.h"
-
-namespace mozilla {
-namespace dom {
-
-// Note: we call this "map" to match the spec, but we store audio param
-// descriptors in an array, because we need ordered access, and don't need the
-// map functionalities.
-typedef nsTArray<AudioParamDescriptor> AudioParamDescriptorMap;
-
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_AudioParamDescriptor_h
--- a/dom/media/webaudio/AudioWorkletGlobalScope.cpp
+++ b/dom/media/webaudio/AudioWorkletGlobalScope.cpp
@@ -5,19 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "AudioWorkletGlobalScope.h"
 
 #include "AudioWorkletImpl.h"
 #include "jsapi.h"
 #include "mozilla/dom/AudioWorkletGlobalScopeBinding.h"
 #include "mozilla/dom/WorkletPrincipal.h"
-#include "mozilla/dom/AudioParamDescriptorBinding.h"
-#include "nsPrintfCString.h"
-#include "nsTHashtable.h"
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(AudioWorkletGlobalScope, WorkletGlobalScope,
                                    mNameToProcessorMap);
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AudioWorkletGlobalScope)
@@ -176,103 +173,24 @@ void AudioWorkletGlobalScope::RegisterPr
     return;
   }
 
   /**
    * 11. Queue a task to the control thread to add the key-value pair
    *     (name - descriptors) to the node name to parameter descriptor
    *     map of the associated BaseAudioContext.
    */
-  AudioParamDescriptorMap map = DescriptorsFromJS(aCx, descriptors, aRv);
-  if (aRv.Failed()) {
-    return;
-  }
   // TODO: we don't have a proper mechanism to communicate with the
   // control thread currently. See
   // https://bugzilla.mozilla.org/show_bug.cgi?id=1473467#c3
   // and https://bugzilla.mozilla.org/show_bug.cgi?id=1492014
 }
 
 WorkletImpl* AudioWorkletGlobalScope::Impl() const { return mImpl; }
 
 uint64_t AudioWorkletGlobalScope::CurrentFrame() const { return mCurrentFrame; }
 
 double AudioWorkletGlobalScope::CurrentTime() const { return mCurrentTime; }
 
 float AudioWorkletGlobalScope::SampleRate() const { return mSampleRate; }
 
-AudioParamDescriptorMap AudioWorkletGlobalScope::DescriptorsFromJS(
-    JSContext* aCx, const JS::Rooted<JS::Value>& aDescriptors, ErrorResult& aRv)
-{
-  // We already checked if aDescriptors is an array or undefined in step 8 of
-  // registerProcessor, so we should be confident aDescriptors if valid here
-  if (aDescriptors.isUndefined()) {
-    return AudioParamDescriptorMap();
-  }
-  MOZ_ASSERT(aDescriptors.isObject());
-
-  AudioParamDescriptorMap res;
-  // To check for duplicates
-  nsTHashtable<nsStringHashKey> namesSet;
-
-  JS::Rooted<JSObject*> aDescriptorsArray(aCx, &aDescriptors.toObject());
-  uint32_t length = 0;
-  if (!JS_GetArrayLength(aCx, aDescriptorsArray, &length)) {
-    aRv.NoteJSContextException(aCx);
-    return AudioParamDescriptorMap();
-  }
-
-  for (uint32_t i = 0; i < length; ++i) {
-    JS::Rooted<JS::Value> descriptorElement(aCx);
-    if (!JS_GetElement(aCx, aDescriptorsArray, i, &descriptorElement)) {
-      aRv.NoteJSContextException(aCx);
-      return AudioParamDescriptorMap();
-    }
-
-    AudioParamDescriptor descriptor;
-    nsPrintfCString sourceDescription("Element %u in parameterDescriptors", i);
-    if (!descriptor.Init(aCx, descriptorElement, sourceDescription.get())) {
-      aRv.NoteJSContextException(aCx);
-      return AudioParamDescriptorMap();
-    }
-
-    if (namesSet.Contains(descriptor.mName)) {
-      aRv.ThrowDOMException(NS_ERROR_DOM_NOT_SUPPORTED_ERR,
-          NS_LITERAL_CSTRING("Duplicated name \"") +
-          NS_ConvertUTF16toUTF8(descriptor.mName) +
-          NS_LITERAL_CSTRING("\" in parameterDescriptors."));
-      return AudioParamDescriptorMap();
-    }
-
-    if (descriptor.mMinValue > descriptor.mMaxValue) {
-      aRv.ThrowDOMException(NS_ERROR_DOM_NOT_SUPPORTED_ERR,
-          NS_LITERAL_CSTRING("In parameterDescriptors, ") +
-          NS_ConvertUTF16toUTF8(descriptor.mName) +
-          NS_LITERAL_CSTRING(" minValue should be smaller than maxValue."));
-      return AudioParamDescriptorMap();
-    }
-
-    if (descriptor.mDefaultValue < descriptor.mMinValue ||
-        descriptor.mDefaultValue > descriptor.mMaxValue) {
-      aRv.ThrowDOMException(NS_ERROR_DOM_NOT_SUPPORTED_ERR,
-          NS_LITERAL_CSTRING("In parameterDescriptors, ") +
-          NS_ConvertUTF16toUTF8(descriptor.mName) +
-          NS_LITERAL_CSTRING(" defaultValue is out of the range defined by "
-              "minValue and maxValue."));
-      return AudioParamDescriptorMap();
-    }
-
-    if (!res.AppendElement(descriptor)) {
-      aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
-      return AudioParamDescriptorMap();
-    }
-
-    if (!namesSet.PutEntry(descriptor.mName, fallible)) {
-      aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
-      return AudioParamDescriptorMap();
-    }
-  }
-
-  return res;
-}
-
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/media/webaudio/AudioWorkletGlobalScope.h
+++ b/dom/media/webaudio/AudioWorkletGlobalScope.h
@@ -2,17 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_AudioWorkletGlobalScope_h
 #define mozilla_dom_AudioWorkletGlobalScope_h
 
-#include "mozilla/dom/AudioParamDescriptorMap.h"
 #include "mozilla/dom/FunctionBinding.h"
 #include "mozilla/dom/WorkletGlobalScope.h"
 #include "nsRefPtrHashtable.h"
 
 namespace mozilla {
 
 class AudioWorkletImpl;
 
@@ -38,23 +37,16 @@ class AudioWorkletGlobalScope final : pu
 
   double CurrentTime() const;
 
   float SampleRate() const;
 
  private:
   ~AudioWorkletGlobalScope() = default;
 
-  // Returns an AudioParamDescriptorMap filled with AudioParamDescriptor
-  // objects, extracted from JS. Returns an empty map in case of error and set
-  // aRv accordingly.
-  AudioParamDescriptorMap DescriptorsFromJS(
-      JSContext* aCx, const JS::Rooted<JS::Value>& aDescriptors,
-      ErrorResult& aRv);
-
   const RefPtr<AudioWorkletImpl> mImpl;
 
   uint64_t mCurrentFrame;
   double mCurrentTime;
   float mSampleRate;
 
   typedef nsRefPtrHashtable<nsStringHashKey, VoidFunction>
       NodeNameToProcessorDefinitionMap;
--- a/dom/media/webaudio/moz.build
+++ b/dom/media/webaudio/moz.build
@@ -42,17 +42,16 @@ EXPORTS.mozilla.dom += [
     'AnalyserNode.h',
     'AudioBuffer.h',
     'AudioBufferSourceNode.h',
     'AudioContext.h',
     'AudioDestinationNode.h',
     'AudioListener.h',
     'AudioNode.h',
     'AudioParam.h',
-    'AudioParamDescriptorMap.h',
     'AudioParamMap.h',
     'AudioProcessingEvent.h',
     'AudioScheduledSourceNode.h',
     'AudioWorkletGlobalScope.h',
     'AudioWorkletNode.h',
     'AudioWorkletProcessor.h',
     'BiquadFilterNode.h',
     'ChannelMergerNode.h',
deleted file mode 100644
--- a/dom/webidl/AudioParamDescriptor.webidl
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * https://webaudio.github.io/web-audio-api/#dictdef-audioparamdescriptor
- *
- * Copyright © 2018 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
- * liability, trademark and document use rules apply.
- */
-
-dictionary AudioParamDescriptor {
-    required DOMString name;
-    float defaultValue = 0;
-    float minValue = -3.4028235e38;
-    float maxValue = 3.4028235e38;
-    // AutomationRate for AudioWorklet is not needed until bug 1504984 is
-    // implemented
-    // AutomationRate automationRate = "a-rate";
-};
-
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -373,17 +373,16 @@ WEBIDL_FILES = [
     'Attr.webidl',
     'AudioBuffer.webidl',
     'AudioBufferSourceNode.webidl',
     'AudioContext.webidl',
     'AudioDestinationNode.webidl',
     'AudioListener.webidl',
     'AudioNode.webidl',
     'AudioParam.webidl',
-    'AudioParamDescriptor.webidl',
     'AudioParamMap.webidl',
     'AudioProcessingEvent.webidl',
     'AudioScheduledSourceNode.webidl',
     'AudioTrack.webidl',
     'AudioTrackList.webidl',
     'AudioWorklet.webidl',
     'AudioWorkletGlobalScope.webidl',
     'AudioWorkletNode.webidl',
--- a/dom/worklet/tests/test_audioWorkletGlobalScopeRegisterProcessor.html
+++ b/dom/worklet/tests/test_audioWorkletGlobalScopeRegisterProcessor.html
@@ -15,25 +15,16 @@ function configureTest() {
   var expected_errors = [
     "TypeError: Argument 2 of AudioWorkletGlobalScope.registerProcessor is not a constructor.",
     "NotSupportedError: Argument 1 of AudioWorkletGlobalScope.registerProcessor should not be an empty string.",
     "TypeError: Argument 2 of AudioWorkletGlobalScope.registerProcessor is not an object.",
     "TypeError: Argument 2 of AudioWorkletGlobalScope.registerProcessor constructor.process is not callable.",
     "TypeError: Argument 2 of AudioWorkletGlobalScope.registerProcessor constructor.process is not callable.",
     "TypeError: Argument 2 of AudioWorkletGlobalScope.registerProcessor constructor.parameterDescriptors is neither an array nor undefined.",
     "NotSupportedError: Argument 1 of AudioWorkletGlobalScope.registerProcessor is invalid: a class with the same name is already registered.",
-    "TypeError: Missing required 'name' member of AudioParamDescriptor.",
-    "TypeError: 'defaultValue' member of AudioParamDescriptor is not a finite floating-point value.",
-    "TypeError: 'minValue' member of AudioParamDescriptor is not a finite floating-point value.",
-    "TypeError: 'maxValue' member of AudioParamDescriptor is not a finite floating-point value.",
-    "NotSupportedError: Duplicated name \"test\" in parameterDescriptors.",
-    "TypeError: Element 0 in parameterDescriptors can't be converted to a dictionary.",
-    "NotSupportedError: In parameterDescriptors, test defaultValue is out of the range defined by minValue and maxValue.",
-    "NotSupportedError: In parameterDescriptors, test defaultValue is out of the range defined by minValue and maxValue.",
-    "NotSupportedError: In parameterDescriptors, test minValue should be smaller than maxValue.",
     ];
 
   var expected_errors_i = 0;
 
   function consoleListener() {
     SpecialPowers.addObserver(this, "console-api-log-event");
   }
 
--- a/dom/worklet/tests/worklet_test_audioWorkletGlobalScopeRegisterProcessor.js
+++ b/dom/worklet/tests/worklet_test_audioWorkletGlobalScopeRegisterProcessor.js
@@ -36,154 +36,16 @@ class GoodDescriptorsWorkletProcessor ex
 class DummyProcessWorkletProcessor extends AudioWorkletProcessor {
   constructor() { super(); }
 
   process() {
     // Do nothing, output silence
   }
 }
 
-class DescriptorsNoNameWorkletProcessor extends AudioWorkletProcessor {
-  constructor() { super(); }
-
-  process() {
-    // Do nothing, output silence
-  }
-
-  static get parameterDescriptors() {
-    return [{
-      defaultValue: 0.707
-    }];
-  }
-}
-
-class DescriptorsDefaultValueNotNumberWorkletProcessor extends AudioWorkletProcessor {
-  constructor() { super(); }
-
-  process() {
-    // Do nothing, output silence
-  }
-
-  static get parameterDescriptors() {
-    return [{
-      name: "test",
-      defaultValue: "test"
-    }];
-  }
-}
-
-class DescriptorsMinValueNotNumberWorkletProcessor extends AudioWorkletProcessor {
-  constructor() { super(); }
-
-  process() {
-    // Do nothing, output silence
-  }
-
-  static get parameterDescriptors() {
-    return [{
-      name: "test",
-      minValue: "test"
-    }];
-  }
-}
-
-class DescriptorsMaxValueNotNumberWorkletProcessor extends AudioWorkletProcessor {
-  constructor() { super(); }
-
-  process() {
-    // Do nothing, output silence
-  }
-
-  static get parameterDescriptors() {
-    return [{
-      name: "test",
-      maxValue: "test"
-    }];
-  }
-}
-
-class DescriptorsDuplicatedNameWorkletProcessor extends AudioWorkletProcessor {
-  constructor() { super(); }
-
-  process() {
-    // Do nothing, output silence
-  }
-
-  static get parameterDescriptors() {
-    return [{
-      name: "test",
-    }, {
-      name: "test",
-    }];
-  }
-}
-
-class DescriptorsNotDictWorkletProcessor extends AudioWorkletProcessor {
-  constructor() { super(); }
-
-  process() {
-    // Do nothing, output silence
-  }
-
-  static get parameterDescriptors() {
-    return [42];
-  }
-}
-
-class DescriptorsOutOfRangeMinWorkletProcessor extends AudioWorkletProcessor {
-  constructor() { super(); }
-
-  process() {
-    // Do nothing, output silence
-  }
-
-  static get parameterDescriptors() {
-    return [{
-      name: 'test',
-      defaultValue: 0,
-      minValue: 1,
-      maxValue: 2,
-    }];
-  }
-}
-
-class DescriptorsOutOfRangeMaxWorkletProcessor extends AudioWorkletProcessor {
-  constructor() { super(); }
-
-  process() {
-    // Do nothing, output silence
-  }
-
-  static get parameterDescriptors() {
-    return [{
-      name: 'test',
-      defaultValue: 3,
-      minValue: 1,
-      maxValue: 2,
-    }];
-  }
-}
-
-class DescriptorsBadRangeMaxWorkletProcessor extends AudioWorkletProcessor {
-  constructor() { super(); }
-
-  process() {
-    // Do nothing, output silence
-  }
-
-  static get parameterDescriptors() {
-    return [{
-      name: 'test',
-      defaultValue: 1.5,
-      minValue: 2,
-      maxValue: 1,
-    }];
-  }
-}
-
 // Test not a constructor
 // "TypeError: Argument 2 of AudioWorkletGlobalScope.registerProcessor is not a constructor."
 try {
   registerProcessor("sure!", () => {});
 } catch (e) {
   console.log(e)
 }
 
@@ -237,80 +99,8 @@ registerProcessor("dummy-worklet-process
 
 // Test class adding class with the same name twice
 // "NotSupportedError: Operation is not supported: Argument 1 of AudioWorkletGlobalScope.registerProcessor is invalid: a class with the same name is already registered."
 try {
   registerProcessor("dummy-worklet-processor", DummyProcessWorkletProcessor);
 } catch (e) {
   console.log(e)
 }
-
-// "name" is a mandatory field in descriptors
-// "TypeError: Missing required 'name' member of AudioParamDescriptor."
-try {
-  registerProcessor("descriptors-no-name-worklet-processor", DescriptorsNoNameWorkletProcessor);
-} catch (e) {
-  console.log(e)
-}
-
-// "defaultValue" should be a number
-// "TypeError: 'defaultValue' member of AudioParamDescriptor is not a finite floating-point value."
-try {
-  registerProcessor("descriptors-default-value-not-number-worklet-processor", DescriptorsDefaultValueNotNumberWorkletProcessor);
-} catch (e) {
-  console.log(e)
-}
-
-// "min" should be a number
-// "TypeError: 'minValue' member of AudioParamDescriptor is not a finite floating-point value."
-try {
-  registerProcessor("descriptors-min-value-not-number-worklet-processor", DescriptorsMinValueNotNumberWorkletProcessor);
-} catch (e) {
-  console.log(e)
-}
-
-// "max" should be a number
-// "TypeError: 'maxValue' member of AudioParamDescriptor is not a finite floating-point value."
-try {
-  registerProcessor("descriptors-max-value-not-number-worklet-processor", DescriptorsMaxValueNotNumberWorkletProcessor);
-} catch (e) {
-  console.log(e)
-}
-
-// Duplicated values are not allowed for "name"
-// "NotSupportedError: Duplicated name \"test\" in parameterDescriptors"
-try {
-  registerProcessor("descriptors-duplicated-name-worklet-processor", DescriptorsDuplicatedNameWorkletProcessor);
-} catch (e) {
-  console.log(e)
-}
-
-// Descriptors' elements should be dictionnary
-// "TypeError: Element 0 in parameterDescriptors can't be converted to a dictionary.",
-try {
-  registerProcessor("descriptors-not-dict-worklet-processor", DescriptorsNotDictWorkletProcessor);
-} catch (e) {
-  console.log(e)
-}
-
-// defaultValue value should be in range [minValue, maxValue]. defaultValue < minValue is not allowed
-// "NotSupportedError: In parameterDescriptors, test defaultValue is out of the range defined by minValue and maxValue.",
-try {
-  registerProcessor("descriptors-out-of-range-min-worklet-processor", DescriptorsOutOfRangeMinWorkletProcessor);
-} catch (e) {
-  console.log(e)
-}
-
-// defaultValue value should be in range [minValue, maxValue]. defaultValue > maxValue is not allowed
-// "NotSupportedError: In parameterDescriptors, test defaultValue is out of the range defined by minValue and maxValue.",
-try {
-  registerProcessor("descriptors-out-of-range-max-worklet-processor", DescriptorsOutOfRangeMaxWorkletProcessor);
-} catch (e) {
-  console.log(e)
-}
-
-// We should have minValue < maxValue to define a valid range
-// "NotSupportedError: In parameterDescriptors, test minValue should be smaller than maxValue.",
-try {
-  registerProcessor("descriptors-bad-range-max-worklet-processor", DescriptorsBadRangeMaxWorkletProcessor);
-} catch (e) {
-  console.log(e)
-}