Backed out changeset 9b8ef8d81775 (bug 1532682) for breaking decision task. CLOSED TREE
authorBrindusan Cristian <cbrindusan@mozilla.com>
Fri, 08 Mar 2019 00:05:52 +0200
changeset 520906 da85432905df457597fe0be424aefbf3f9af31b8
parent 520905 2d48960b28162a564b1f2896bdac851a62721b44
child 520907 362cf2e57ed2851c113a00d358207e27aded9cc5
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1532682
milestone67.0a1
backs out9b8ef8d817750751af255a622bcf208a7db1c3b2
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 9b8ef8d81775 (bug 1532682) for breaking decision task. CLOSED TREE
dom/html/HTMLVideoElement.cpp
--- a/dom/html/HTMLVideoElement.cpp
+++ b/dom/html/HTMLVideoElement.cpp
@@ -28,17 +28,16 @@
 #include "MediaDecoderStateMachine.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/WakeLock.h"
 #include "mozilla/dom/power/PowerManagerService.h"
 #include "mozilla/dom/Performance.h"
 #include "mozilla/dom/TimeRanges.h"
 #include "mozilla/dom/VideoPlaybackQuality.h"
 #include "mozilla/dom/VideoStreamTrack.h"
-#include "mozilla/Unused.h"
 
 #include <algorithm>
 #include <limits>
 
 nsGenericHTMLElement* NS_NewHTMLVideoElement(
     already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
     mozilla::dom::FromParser aFromParser) {
   mozilla::dom::HTMLVideoElement* element =
@@ -176,17 +175,19 @@ HTMLVideoElement::IsAttributeMapped(cons
 nsMapRuleToAttributesFunc HTMLVideoElement::GetAttributeMappingFunction()
     const {
   return &MapAttributesIntoRule;
 }
 
 void HTMLVideoElement::UnbindFromTree(bool aDeep, bool aNullParent) {
   if (mVisualCloneSource) {
     mVisualCloneSource->EndCloningVisually();
+    SetVisualCloneSource(nullptr);
   } else if (mVisualCloneTarget) {
+    mVisualCloneTarget->SetVisualCloneSource(nullptr);
     EndCloningVisually();
   }
 
   HTMLMediaElement::UnbindFromTree(aDeep, aNullParent);
 }
 
 nsresult HTMLVideoElement::SetAcceptHeader(nsIHttpChannel* aChannel) {
   nsAutoCString value(
@@ -451,21 +452,16 @@ void HTMLVideoElement::CloneElementVisua
              "Can't clone a video that's not bound to a DOM tree.");
   MOZ_ASSERT(!aTargetVideo.mUnboundFromTree,
              "Can't clone to a video that's not bound to a DOM tree.");
   if (mUnboundFromTree || aTargetVideo.mUnboundFromTree) {
     rv.Throw(NS_ERROR_UNEXPECTED);
     return;
   }
 
-  // Do we already have a visual clone target? If so, shut it down.
-  if (mVisualCloneTarget) {
-    EndCloningVisually();
-  }
-
   if (!SetVisualCloneTarget(&aTargetVideo)) {
     rv.Throw(NS_ERROR_FAILURE);
     return;
   }
 
   if (!aTargetVideo.SetVisualCloneSource(this)) {
     mVisualCloneTarget = nullptr;
     rv.Throw(NS_ERROR_FAILURE);
@@ -512,14 +508,13 @@ void HTMLVideoElement::EndCloningVisuall
     VideoFrameContainer* container =
         mVisualCloneTarget->GetVideoFrameContainer();
     if (container && mVisualCloneTarget->mSelectedVideoStreamTrack) {
       mVisualCloneTarget->mSelectedVideoStreamTrack->RemoveVideoOutput(
           container);
     }
   }
 
-  Unused << mVisualCloneTarget->SetVisualCloneSource(nullptr);
-  Unused << SetVisualCloneTarget(nullptr);
+  mVisualCloneTarget = nullptr;
 }
 
 }  // namespace dom
 }  // namespace mozilla