Backed out changeset 04430cc26dba (bug 1180940) for Mulet Gij(4) bustage again.
authorNigel Babu <nigelbabu@gmail.com>
Thu, 01 Oct 2015 13:53:14 +0530
changeset 265583 705689bc6b9213eaf2756d0ecfa015d3550afacb
parent 265582 8e7b4e096ae37abee12c5da5e3b91094258b7fed
child 265584 3b2aa51abf0811692611f4c9eb7617bafe506fbb
push id15472
push usercbook@mozilla.com
push dateFri, 02 Oct 2015 11:51:34 +0000
treeherderfx-team@2c33ef6b27e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1180940
milestone44.0a1
backs out04430cc26dba5f5918b6710f37239566d3176e4e
Backed out changeset 04430cc26dba (bug 1180940) for Mulet Gij(4) bustage again.
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,31 +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) {
-    nsresult rv = mDestination->CreateAudioChannelAgent();
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return rv;
-    }
-    mDestination->SetIsOnlyNodeForContext(true);
-  }
-
-  return NS_OK;
+  mDestination->CreateAudioChannelAgent();
+  mDestination->SetIsOnlyNodeForContext(true);
 }
 
 AudioContext::~AudioContext()
 {
   nsPIDOMWindow* window = GetOwner();
   if (window) {
     window->RemoveAudioContext(this);
   }
@@ -162,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,
@@ -184,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
@@ -624,43 +624,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.
   StreamTime 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;