Merge mozilla-central to autoland. a=merge CLOSED TREE
authorNoemi Erli <nerli@mozilla.com>
Fri, 11 Jan 2019 23:59:12 +0200
changeset 453557 610a3472661a
parent 453556 28f05d905fcf (current diff)
parent 453520 c1894cbb4e71 (diff)
child 453558 aae6e06aa88b
push id35360
push usernbeleuzu@mozilla.com
push dateSat, 12 Jan 2019 09:39:47 +0000
treeherdermozilla-central@cb35977ae7a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone66.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
Merge mozilla-central to autoland. a=merge CLOSED TREE
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/Scalars.yaml
--- a/dom/media/mediasink/AudioSink.cpp
+++ b/dom/media/mediasink/AudioSink.cpp
@@ -182,19 +182,17 @@ nsresult AudioSink::InitializeAudioStrea
   if (NS_FAILED(rv)) {
     mAudioStream->Shutdown();
     mAudioStream = nullptr;
     return rv;
   }
 
   // Set playback params before calling Start() so they can take effect
   // as soon as the 1st DataCallback of the AudioStream fires.
-  if (aParams.mVolume) {
-    mAudioStream->SetVolume(*aParams.mVolume);
-  }
+  mAudioStream->SetVolume(aParams.mVolume);
   mAudioStream->SetPlaybackRate(aParams.mPlaybackRate);
   mAudioStream->SetPreservesPitch(aParams.mPreservesPitch);
   return mAudioStream->Start();
 }
 
 TimeUnit AudioSink::GetEndTime() const {
   int64_t written;
   {
--- a/dom/media/mediasink/AudioSinkWrapper.cpp
+++ b/dom/media/mediasink/AudioSinkWrapper.cpp
@@ -24,19 +24,17 @@ void AudioSinkWrapper::Shutdown() {
 const MediaSink::PlaybackParams& AudioSinkWrapper::GetPlaybackParams() const {
   AssertOwnerThread();
   return mParams;
 }
 
 void AudioSinkWrapper::SetPlaybackParams(const PlaybackParams& aParams) {
   AssertOwnerThread();
   if (mAudioSink) {
-    if (aParams.mVolume) {
-      mAudioSink->SetVolume(*aParams.mVolume);
-    }
+    mAudioSink->SetVolume(aParams.mVolume);
     mAudioSink->SetPlaybackRate(aParams.mPlaybackRate);
     mAudioSink->SetPreservesPitch(aParams.mPreservesPitch);
   }
   mParams = aParams;
 }
 
 RefPtr<MediaSink::EndedPromise> AudioSinkWrapper::OnEnded(TrackType aType) {
   AssertOwnerThread();
@@ -93,17 +91,17 @@ TimeUnit AudioSinkWrapper::GetPosition(T
 
 bool AudioSinkWrapper::HasUnplayedFrames(TrackType aType) const {
   AssertOwnerThread();
   return mAudioSink ? mAudioSink->HasUnplayedFrames() : false;
 }
 
 void AudioSinkWrapper::SetVolume(double aVolume) {
   AssertOwnerThread();
-  mParams.mVolume = Some(aVolume);
+  mParams.mVolume = aVolume;
   if (mAudioSink) {
     mAudioSink->SetVolume(aVolume);
   }
 }
 
 void AudioSinkWrapper::SetPlaybackRate(double aPlaybackRate) {
   AssertOwnerThread();
   if (!mAudioEnded) {
@@ -193,20 +191,16 @@ void AudioSinkWrapper::Stop() {
   AssertOwnerThread();
   MOZ_ASSERT(mIsStarted, "playback not started.");
 
   mIsStarted = false;
   mAudioEnded = true;
 
   if (mAudioSink) {
     mAudioSinkEndedPromise.DisconnectIfExists();
-    // Reset volume to signal that it should
-    // not be updated, in case the volume
-    // has been changed outside MediaElement.
-    mParams.mVolume.reset();
     mAudioSink->Shutdown();
     mAudioSink = nullptr;
     mEndedPromise = nullptr;
   }
 }
 
 bool AudioSinkWrapper::IsStarted() const {
   AssertOwnerThread();
--- a/dom/media/mediasink/DecodedStream.cpp
+++ b/dom/media/mediasink/DecodedStream.cpp
@@ -474,17 +474,17 @@ void DecodedStream::SetPlaying(bool aPla
     return;
   }
 
   mPlaying = aPlaying;
 }
 
 void DecodedStream::SetVolume(double aVolume) {
   AssertOwnerThread();
-  mParams.mVolume = Some(aVolume);
+  mParams.mVolume = aVolume;
 }
 
 void DecodedStream::SetPlaybackRate(double aPlaybackRate) {
   AssertOwnerThread();
   mParams.mPlaybackRate = aPlaybackRate;
 }
 
 void DecodedStream::SetPreservesPitch(bool aPreservesPitch) {
@@ -725,18 +725,17 @@ void DecodedStream::SendData() {
   AssertOwnerThread();
   MOZ_ASSERT(mStartTime.isSome(), "Must be called after StartPlayback()");
 
   // Not yet created on the main thread. MDSM will try again later.
   if (!mData) {
     return;
   }
 
-  MOZ_ASSERT(mParams.mVolume.isSome(), "Volume should exist at that point");
-  SendAudio(mParams.mVolume.value(), mSameOrigin, mPrincipalHandle);
+  SendAudio(mParams.mVolume, mSameOrigin, mPrincipalHandle);
   SendVideo(mSameOrigin, mPrincipalHandle);
 }
 
 TimeUnit DecodedStream::GetEndTime(TrackType aType) const {
   AssertOwnerThread();
   if (aType == TrackInfo::kAudioTrack && mInfo.HasAudio() && mData) {
     auto t = mStartTime.ref() +
              FramesToTimeUnit(mData->mAudioFramesWritten, mInfo.mAudio.mRate);
--- a/dom/media/mediasink/MediaSink.h
+++ b/dom/media/mediasink/MediaSink.h
@@ -34,18 +34,18 @@ class TimeStamp;
  */
 class MediaSink {
  public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaSink);
   typedef mozilla::TrackInfo::TrackType TrackType;
 
   struct PlaybackParams {
     PlaybackParams()
-        : mVolume(Some(1.0)), mPlaybackRate(1.0), mPreservesPitch(true) {}
-    Maybe<double> mVolume;
+        : mVolume(1.0), mPlaybackRate(1.0), mPreservesPitch(true) {}
+    double mVolume;
     double mPlaybackRate;
     bool mPreservesPitch;
     RefPtr<AudioDeviceInfo> mSink;
   };
 
   // Return the playback parameters of this sink.
   // Can be called in any state.
   virtual const PlaybackParams& GetPlaybackParams() const = 0;
--- a/js/src/builtin/TypedArray.js
+++ b/js/src/builtin/TypedArray.js
@@ -1569,17 +1569,17 @@ function TypedArraySpecies() {
 _SetCanonicalName(TypedArraySpecies, "get [Symbol.species]");
 
 // ES 2017 draft June 2, 2016 22.2.3.32
 function TypedArrayToStringTag() {
     // Step 1.
     var O = this;
 
     // Steps 2-3.
-    if (!IsObject(O) || !IsTypedArray(O))
+    if (!IsObject(O) || !IsPossiblyWrappedTypedArray(O))
         return undefined;
 
     // Steps 4-6.
     // Modified to retrieve the [[TypedArrayName]] from the constructor.
     return _NameForTypedArray(O);
 }
 _SetCanonicalName(TypedArrayToStringTag, "get [Symbol.toStringTag]");
 
new file mode 100644
--- /dev/null
+++ b/js/src/tests/non262/TypedArray/toStringTag-cross-compartment.js
@@ -0,0 +1,12 @@
+const TypedArrayPrototype = Object.getPrototypeOf(Int8Array.prototype);
+const {get: toStringTag} = Object.getOwnPropertyDescriptor(TypedArrayPrototype, Symbol.toStringTag);
+
+const otherGlobal = newGlobal();
+
+for (let constructor of anyTypedArrayConstructors) {
+    let ta = new otherGlobal[constructor.name](0);
+    assertEq(toStringTag.call(ta), constructor.name);
+}
+
+if (typeof reportCompare === "function")
+    reportCompare(true, true);
--- a/js/src/vm/SelfHosting.cpp
+++ b/js/src/vm/SelfHosting.cpp
@@ -2135,18 +2135,20 @@ static bool intrinsic_ConstructorForType
 }
 
 static bool intrinsic_NameForTypedArray(JSContext* cx, unsigned argc,
                                         Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   MOZ_ASSERT(args.length() == 1);
   MOZ_ASSERT(args[0].isObject());
 
-  RootedObject object(cx, &args[0].toObject());
-  MOZ_ASSERT(object->is<TypedArrayObject>());
+  auto* object = UnwrapAndDowncastValue<TypedArrayObject>(cx, args[0]);
+  if (!object) {
+    return false;
+  }
 
   JSProtoKey protoKey = StandardProtoKeyOrNull(object);
   MOZ_ASSERT(protoKey);
 
   args.rval().setString(ClassName(protoKey, cx));
   return true;
 }
 
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -14197,32 +14197,32 @@
     "n_buckets": 22,
     "keyed": true,
     "bug_numbers": [1341569],
     "description": "Milliseconds between starting to fill an autofill-eligible form field and submitting the form, keyed by the combination of form type and filling type."
   },
   "GFX_OMTP_PAINT_TIME": {
     "record_in_processes": ["content"],
     "alert_emails": ["gfx-telemetry-alerts@mozilla.com", "rhunt@mozilla.com"],
-    "expires_in_version": "70",
+    "expires_in_version": "never",
     "kind": "exponential",
     "high": 10000,
     "n_buckets": 50,
     "description": "Amount of time in tenths of a millisecond from the beginning of the first async paint until all async paints are finished.",
-    "bug_numbers": [1483245]
+    "bug_numbers": [1483245, 1518669]
   },
   "GFX_OMTP_PAINT_WAIT_TIME": {
     "record_in_processes": ["content"],
     "alert_emails": ["gfx-telemetry-alerts@mozilla.com", "rhunt@mozilla.com"],
-    "expires_in_version": "66",
+    "expires_in_version": "never",
     "kind": "exponential",
     "high": 200,
     "n_buckets": 50,
     "description": "Amount of time in milliseconds the main thread spends waiting for the paint thread to complete, if the time was greater than 200us.",
-    "bug_numbers": [1386968]
+    "bug_numbers": [1386968, 1518669]
   },
   "GFX_OMTP_PAINT_TASK_COUNT": {
     "record_in_processes": ["content"],
     "alert_emails": ["gfx-telemetry-alerts@mozilla.com", "rhunt@mozilla.com"],
     "expires_in_version": "70",
     "kind": "exponential",
     "high": 100,
     "n_buckets": 25,
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -1828,22 +1828,23 @@ gfx.advanced.layers:
       - rhunt@mozilla.com
     record_in_processes:
       - 'main'
 
 gfx.omtp:
   paint_wait_ratio:
     bug_numbers:
       - 1386968
+      - 1518669
     description: >
       Ratio (in units of 1/100th of a percent) of how many times OMTP waited
       for a paint for more than 200us, versus the total number of paints.
     keyed: false
     kind: uint
-    expires: "66"
+    expires: "never"
     notification_emails:
       - gfx-telemetry-alerts@mozilla.com
       - rhunt@mozilla.com
     record_in_processes:
       - 'content'
 
 # The following section contains the form autofill related scalars.
 formautofill: