Backed out changeset 49847eb6c1ce (bug 1180940) for Mulet Gij(4) bustage on CLOSED TREE
authorNigel Babu <nigelbabu@gmail.com>
Thu, 24 Sep 2015 12:37:52 +0530
changeset 264156 2a9e3231861078e6dc186d72c03d19266748912b
parent 264155 3e3620f7905d5ed1bfd69ad521f2bcc5764f628c
child 264157 6a24bb175f76ea9de2e595b2c187ac2350ac7d81
push id65545
push usernigelbabu@gmail.com
push dateThu, 24 Sep 2015 07:08:11 +0000
treeherdermozilla-inbound@2a9e32318610 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1180940
milestone44.0a1
backs out49847eb6c1cef1fd242474aee543dc9a98299b4c
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 49847eb6c1ce (bug 1180940) for Mulet Gij(4) bustage on CLOSED TREE
dom/audiochannel/AudioChannelAgent.cpp
dom/media/webaudio/AudioContext.cpp
dom/media/webaudio/AudioContext.h
dom/media/webaudio/AudioDestinationNode.cpp
dom/media/webaudio/AudioDestinationNode.h
--- a/dom/audiochannel/AudioChannelAgent.cpp
+++ b/dom/audiochannel/AudioChannelAgent.cpp
@@ -99,29 +99,25 @@ AudioChannelAgent::InitInternal(nsIDOMWi
 
   if (mAudioChannelType != AUDIO_AGENT_CHANNEL_ERROR ||
       aChannelType > AUDIO_AGENT_CHANNEL_PUBLICNOTIFICATION ||
       aChannelType < AUDIO_AGENT_CHANNEL_NORMAL) {
     return NS_ERROR_FAILURE;
   }
 
   if (NS_WARN_IF(!aWindow)) {
-    return NS_OK;
+    return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsPIDOMWindow> pInnerWindow = do_QueryInterface(aWindow);
   MOZ_ASSERT(pInnerWindow->IsInnerWindow());
   mInnerWindowID = pInnerWindow->WindowID();
 
   nsCOMPtr<nsIDOMWindow> topWindow;
   aWindow->GetScriptableTop(getter_AddRefs(topWindow));
-  if (NS_WARN_IF(!topWindow)) {
-    return NS_OK;
-  }
-
   mWindow = do_QueryInterface(topWindow);
   if (mWindow) {
     mWindow = mWindow->GetOuterWindow();
   }
 
   if (!mWindow) {
     return NS_ERROR_FAILURE;
   }
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -112,32 +112,24 @@ AudioContext::AudioContext(nsPIDOMWindow
                                           aNumberOfChannels, aLength, aSampleRate);
 
   // The context can't be muted until it has a destination.
   if (mute) {
     Mute();
   }
 }
 
-nsresult
+void
 AudioContext::Init()
 {
   // We skip calling SetIsOnlyNodeForContext and the creation of the
   // audioChannelAgent during mDestination's constructor, because we can only
   // call them after mDestination has been set up.
-  if (mIsOffline) {
-    mDestination->SetIsOnlyNodeForContext(true);
-  } else {
-    nsresult rv = mDestination->CreateAudioChannelAgent();
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return rv;
-    }
-  }
-
-  return NS_OK;
+  mDestination->CreateAudioChannelAgent();
+  mDestination->SetIsOnlyNodeForContext(true);
 }
 
 AudioContext::~AudioContext()
 {
   nsPIDOMWindow* window = GetOwner();
   if (window) {
     window->RemoveAudioContext(this);
   }
@@ -163,20 +155,17 @@ AudioContext::Constructor(const GlobalOb
   if (!window) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   nsRefPtr<AudioContext> object =
     new AudioContext(window, false,
                      AudioChannelService::GetDefaultAudioChannel());
-  aRv = object->Init();
-  if (NS_WARN_IF(aRv.Failed())) {
-     return nullptr;
-  }
+  object->Init();
 
   RegisterWeakMemoryReporter(object);
 
   return object.forget();
 }
 
 /* static */ already_AddRefed<AudioContext>
 AudioContext::Constructor(const GlobalObject& aGlobal,
@@ -185,20 +174,17 @@ AudioContext::Constructor(const GlobalOb
 {
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.GetAsSupports());
   if (!window) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   nsRefPtr<AudioContext> object = new AudioContext(window, false, aChannel);
-  aRv = object->Init();
-  if (NS_WARN_IF(aRv.Failed())) {
-     return nullptr;
-  }
+  object->Init();
 
   RegisterWeakMemoryReporter(object);
 
   return object.forget();
 }
 
 /* static */ already_AddRefed<AudioContext>
 AudioContext::Constructor(const GlobalObject& aGlobal,
--- a/dom/media/webaudio/AudioContext.h
+++ b/dom/media/webaudio/AudioContext.h
@@ -119,17 +119,17 @@ class AudioContext final : public DOMEve
   AudioContext(nsPIDOMWindow* aParentWindow,
                bool aIsOffline,
                AudioChannel aChannel,
                uint32_t aNumberOfChannels = 0,
                uint32_t aLength = 0,
                float aSampleRate = 0.0f);
   ~AudioContext();
 
-  nsresult Init();
+  void Init();
 
 public:
   typedef uint64_t AudioContextId;
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioContext,
                                            DOMEventTargetHelper)
   MOZ_DEFINE_MALLOC_SIZE_OF(MallocSizeOf)
--- a/dom/media/webaudio/AudioDestinationNode.cpp
+++ b/dom/media/webaudio/AudioDestinationNode.cpp
@@ -625,43 +625,33 @@ AudioDestinationNode::CheckAudioChannelP
                       AudioChannelValues::strings[uint32_t(aValue)].length);
   permissionManager->TestExactPermissionFromPrincipal(principal,
     nsCString(NS_LITERAL_CSTRING("audio-channel-") + channel).get(),
     &perm);
 
   return perm == nsIPermissionManager::ALLOW_ACTION;
 }
 
-nsresult
+void
 AudioDestinationNode::CreateAudioChannelAgent()
 {
   if (mIsOffline) {
-    return NS_OK;
+    return;
   }
 
-  nsresult rv = NS_OK;
   if (mAudioChannelAgent) {
-    rv = mAudioChannelAgent->NotifyStoppedPlaying(nsIAudioChannelAgent::AUDIO_AGENT_NOTIFY);
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return rv;
-    }
+    mAudioChannelAgent->NotifyStoppedPlaying(nsIAudioChannelAgent::AUDIO_AGENT_NOTIFY);
   }
 
   mAudioChannelAgent = new AudioChannelAgent();
-  rv = mAudioChannelAgent->InitWithWeakCallback(GetOwner(),
+  mAudioChannelAgent->InitWithWeakCallback(GetOwner(),
                                            static_cast<int32_t>(mAudioChannel),
                                            this);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
 
-  rv = WindowAudioCaptureChanged();
-  NS_WARN_IF(NS_FAILED(rv));
-  return rv;
-
+  WindowAudioCaptureChanged();
 }
 
 void
 AudioDestinationNode::NotifyStableState()
 {
   mExtraCurrentTimeUpdatedSinceLastStableState = false;
 }
 
--- a/dom/media/webaudio/AudioDestinationNode.h
+++ b/dom/media/webaudio/AudioDestinationNode.h
@@ -68,17 +68,17 @@ public:
 
   // An amount that should be added to the MediaStream's current time to
   // get the AudioContext.currentTime.
   double ExtraCurrentTime();
 
   // When aIsOnlyNode is true, this is the only node for the AudioContext.
   void SetIsOnlyNodeForContext(bool aIsOnlyNode);
 
-  nsresult CreateAudioChannelAgent();
+  void CreateAudioChannelAgent();
   void DestroyAudioChannelAgent();
 
   virtual const char* NodeType() const override
   {
     return "AudioDestinationNode";
   }
 
   virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override;