Backed out changeset 69cd9c72bd4e (bug 1343550) for failing e.g. crashtest 812785.html. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 14 Mar 2017 16:20:54 +0100
changeset 347604 141d25bf6372bc0fe2e42d4142d827a0c804ac0d
parent 347603 6690e9b920dae16f4f1c5c895757d036a909f00d
child 347605 907a28cd35b045950df8f077383581c455f6af3c
push id31500
push userkwierso@gmail.com
push dateWed, 15 Mar 2017 00:19:11 +0000
treeherdermozilla-central@8dd496fd015a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1343550, 812785
milestone55.0a1
backs out69cd9c72bd4ed419e3f7f7b5ab64ee0fa8bd89a2
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 69cd9c72bd4e (bug 1343550) for failing e.g. crashtest 812785.html. r=backout
dom/media/webaudio/AudioContext.cpp
dom/media/webaudio/AudioContext.h
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -135,17 +135,16 @@ AudioContext::AudioContext(nsPIDOMWindow
   , mSampleRate(GetSampleRateForAudioContext(aIsOffline, aSampleRate))
   , mAudioContextState(AudioContextState::Suspended)
   , mNumberOfChannels(aNumberOfChannels)
   , mIsOffline(aIsOffline)
   , mIsStarted(!aIsOffline)
   , mIsShutDown(false)
   , mCloseCalled(false)
   , mSuspendCalled(false)
-  , mIsDisconnecting(false)
 {
   bool mute = aWindow->AddAudioContext(this);
 
   // Note: AudioDestinationNode needs an AudioContext that must already be
   // bound to the window.
   mDestination = new AudioDestinationNode(this, aIsOffline, aChannel,
                                           aNumberOfChannels, aLength, aSampleRate);
 
@@ -256,18 +255,17 @@ AudioContext::Constructor(const GlobalOb
 
   RegisterWeakMemoryReporter(object);
 
   return object.forget();
 }
 
 bool AudioContext::CheckClosed(ErrorResult& aRv)
 {
-  if (mAudioContextState == AudioContextState::Closed ||
-      mIsShutDown) {
+  if (mAudioContextState == AudioContextState::Closed) {
     aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
     return true;
   }
   return false;
 }
 
 already_AddRefed<AudioBufferSourceNode>
 AudioContext::CreateBufferSource(ErrorResult& aRv)
@@ -637,41 +635,31 @@ AudioContext::DestinationStream() const
 
 double
 AudioContext::CurrentTime() const
 {
   MediaStream* stream = Destination()->Stream();
   return stream->StreamTimeToSeconds(stream->GetCurrentTime());
 }
 
-void AudioContext::DisconnectFromOwner()
-{
-  mIsDisconnecting = true;
-  Shutdown();
-  DOMEventTargetHelper::DisconnectFromOwner();
-}
-
 void
 AudioContext::Shutdown()
 {
   mIsShutDown = true;
 
-  // We don't want to touch promises if the global is going away soon.
-  if (mIsDisconnecting) {
-    if (!mIsOffline) {
-      IgnoredErrorResult dummy;
-      RefPtr<Promise> ignored = Close(dummy);
-    }
+  if (!mIsOffline) {
+    ErrorResult dummy;
+    RefPtr<Promise> ignored = Close(dummy);
+  }
 
-    for (auto p : mPromiseGripArray) {
-      p->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
-    }
+  for (auto p : mPromiseGripArray) {
+    p->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
+  }
 
-    mPromiseGripArray.Clear();
-  }
+  mPromiseGripArray.Clear();
 
   // Release references to active nodes.
   // Active AudioNodes don't unregister in destructors, at which point the
   // Node is already unregistered.
   mActiveNodes.Clear();
 
   // For offline contexts, we can destroy the MediaStreamGraph at this point.
   if (mIsOffline && mDestination) {
--- a/dom/media/webaudio/AudioContext.h
+++ b/dom/media/webaudio/AudioContext.h
@@ -137,18 +137,16 @@ public:
                                            DOMEventTargetHelper)
   MOZ_DEFINE_MALLOC_SIZE_OF(MallocSizeOf)
 
   nsPIDOMWindowInner* GetParentObject() const
   {
     return GetOwner();
   }
 
-  virtual void DisconnectFromOwner() override;
-
   void Shutdown(); // idempotent
 
   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
   using DOMEventTargetHelper::DispatchTrustedEvent;
 
   // Constructor for regular AudioContext
   static already_AddRefed<AudioContext>
@@ -369,17 +367,16 @@ private:
   uint32_t mNumberOfChannels;
   bool mIsOffline;
   bool mIsStarted;
   bool mIsShutDown;
   // Close has been called, reject suspend and resume call.
   bool mCloseCalled;
   // Suspend has been called with no following resume.
   bool mSuspendCalled;
-  bool mIsDisconnecting;
 };
 
 static const dom::AudioContext::AudioContextId NO_AUDIO_CONTEXT = 0;
 
 } // namespace dom
 } // namespace mozilla
 
 #endif