Backed out changesets f2862e93b710, 4fe81f58dbef, and f8f855f0b7dc (bug 896353) for mochitest-1 asserts.
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 26 Jul 2013 14:08:29 -0400
changeset 140133 5aa02ee02f4b59d3df9af31b74cd8dcbdd70e570
parent 140132 4ed4a7c0d0e9c6fb821ebc3ab92eb86a0bc24486
child 140199 e7045ef73a3d7735eb8eccff9152791de89dc767
push id1945
push userryanvm@gmail.com
push dateSat, 27 Jul 2013 02:27:26 +0000
treeherderfx-team@4874fa438b1c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs896353
milestone25.0a1
backs outf2862e93b71017234ca2217cbe28d2d40b940eff
4fe81f58dbef639635e15d39a0ff33d56b3ce80d
f8f855f0b7dca6063d09cc00763f787e18d944de
Backed out changesets f2862e93b710, 4fe81f58dbef, and f8f855f0b7dc (bug 896353) for mochitest-1 asserts.
content/media/MediaRecorder.cpp
content/media/MediaRecorder.h
content/media/test/Makefile.in
content/media/test/test_mediarecorder_record_audiocontext.html
content/media/webaudio/MediaStreamAudioDestinationNode.cpp
--- a/content/media/MediaRecorder.cpp
+++ b/content/media/MediaRecorder.cpp
@@ -110,19 +110,16 @@ public:
 
 private:
   nsRefPtr<MediaRecorder> mRecorder;
   nsRefPtr<MediaEncoder>  mEncoder;
 };
 
 MediaRecorder::~MediaRecorder()
 {
-  if (mStreamPort) {
-    mStreamPort->Destroy();
-  }
   if (mTrackUnionStream) {
     mTrackUnionStream->Destroy();
   }
 }
 
 void
 MediaRecorder::Init(JSContext* aCx, nsPIDOMWindow* aOwnerWindow)
 {
@@ -190,17 +187,18 @@ MediaRecorder::Start(const Optional<int3
   if (mEncodedBufferCache == nullptr) {
     mEncodedBufferCache = new EncodedBufferCache(MAX_ALLOW_MEMORY_BUFFER);
   }
 
   mEncoder = MediaEncoder::CreateEncoder(NS_LITERAL_STRING(""));
   MOZ_ASSERT(mEncoder, "CreateEncoder failed");
 
   mTrackUnionStream->SetAutofinish(true);
-  mStreamPort = mTrackUnionStream->AllocateInputPort(mStream->GetStream(), MediaInputPort::FLAG_BLOCK_OUTPUT);
+  nsRefPtr<MediaInputPort> port =
+    mTrackUnionStream->AllocateInputPort(mStream->GetStream(), MediaInputPort::FLAG_BLOCK_OUTPUT);
 
   if (mEncoder) {
     mTrackUnionStream->AddListener(mEncoder);
   } else {
     aResult.Throw(NS_ERROR_DOM_ABORT_ERR);
   }
 
   if (!mReadThread) {
--- a/content/media/MediaRecorder.h
+++ b/content/media/MediaRecorder.h
@@ -105,18 +105,16 @@ protected:
   // Runnable thread for read data from mediaEncoder. It starts at MediaRecorder::Start() and stops at MediaRecorder::Stop().
   nsCOMPtr<nsIThread> mReadThread;
   // The MediaEncoder object initializes on start() and destroys in ~MediaRecorder.
   nsRefPtr<MediaEncoder> mEncoder;
   // MediaStream passed from js context
   nsRefPtr<DOMMediaStream> mStream;
   // This media stream is used for notifying raw data to encoder and can be blocked.
   nsRefPtr<ProcessedMediaStream> mTrackUnionStream;
-  // This is used for destroing the inputport when destroy the mediaRecorder
-  nsRefPtr<MediaInputPort> mStreamPort;
   // This object creates on start() and destroys in ~MediaRecorder.
   nsAutoPtr<EncodedBufferCache> mEncodedBufferCache;
   // It specifies the container format as well as the audio and video capture formats.
   nsString mMimeType;
   // The interval of timer passed from Start(). On every mTimeSlice milliseconds, if there are buffers store in the EncodedBufferCache,
   // a dataavailable event will be fired.
   int32_t mTimeSlice;
   // The current state of the MediaRecorder object.
--- a/content/media/test/Makefile.in
+++ b/content/media/test/Makefile.in
@@ -111,17 +111,16 @@ MOCHITEST_FILES = \
 		test_source.html \
 		test_source_write.html \
 		test_source_null.html \
 		test_standalone.html \
 		test_volume.html \
 		test_video_to_canvas.html \
 		test_audiowrite.html \
 		test_mediarecorder_creation.html \
-		test_mediarecorder_record_audiocontext.html \
 		test_mozHasAudio.html \
 		test_source_media.html \
 		test_autoplay_contentEditable.html \
 		test_bug448534.html \
 		test_bug463162.xhtml \
 		test_decoder_disable.html \
 		test_mediarecorder_reload_crash.html \
 		test_media_selection.html \
deleted file mode 100644
--- a/content/media/test/test_mediarecorder_record_audiocontext.html
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test MediaRecorder Record AudioContext</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-  <script type="text/javascript" src="manifest.js"></script>
-</head>
-<body>
-
-<script class="testbody" type="text/javascript">
-
-function startTest() {
-  var context = new AudioContext();
-  var hasonstop = false;
-  var buffer = context.createBuffer(1, 80920, context.sampleRate);
-  for (var i = 0; i < 80920; ++i) {
-    buffer.getChannelData(0)[i] = Math.sin(1000 * 2 * Math.PI * i / context.sampleRate);
-  }
-
-  var source = context.createBufferSource();
-  source.buffer = buffer;
-
-  var dest = context.createMediaStreamDestination();
-  source.connect(dest);
-  var elem = document.createElement('audio');
-  elem.mozSrcObject = dest.stream;
-  mMediaStream = dest.stream;
-  source.start(0);
-  elem.play();
-  mMediaRecorder = new MediaRecorder(dest.stream);
-  mMediaRecorder.onwarning = function() {
-    ok(false, 'onwarning unexpectedly fired');
-  };
-
-  mMediaRecorder.onerror = function() {
-    ok(false, 'onerror unexpectedly fired');
-  };
-
-  mMediaRecorder.onstop = function() {
-    ok(true, 'onstop fired successfully');
-    is(mMediaRecorder.state, 'inactive', 'check recording status is inactive');
-    SimpleTest.finish();
-  };
-  mMediaRecorder.ondataavailable = function (e) {
-    if (mMediaRecorder.state == 'recording') {
-      is('audio/ogg', mMediaRecorder.mimeType, "check the record mimetype return " + mMediaRecorder.mimeType);
-      ok(e.data.size > 0, 'check blob has data');
-      mMediaRecorder.stop();
-    }
-  };
-  try {
-    mMediaRecorder.start(1000);
-    is('recording', mMediaRecorder.state, "check record state recording");
-  } catch (e) {
-    ok(false, 'Can t record audio context');
-  }
-}
-
-startTest();
-SimpleTest.waitForExplicitFinish();
-</script>
-</pre>
-</body>
-</html>
--- a/content/media/webaudio/MediaStreamAudioDestinationNode.cpp
+++ b/content/media/webaudio/MediaStreamAudioDestinationNode.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "MediaStreamAudioDestinationNode.h"
-#include "nsIDocument.h"
 #include "mozilla/dom/AudioStreamTrack.h"
 #include "mozilla/dom/MediaStreamAudioDestinationNodeBinding.h"
 #include "AudioNodeEngine.h"
 #include "AudioNodeStream.h"
 #include "DOMMediaStream.h"
 #include "TrackUnionStream.h"
 
 namespace mozilla {
@@ -69,21 +68,16 @@ MediaStreamAudioDestinationNode::MediaSt
 {
   TrackUnionStream* tus = static_cast<TrackUnionStream*>(mDOMStream->GetStream());
   MOZ_ASSERT(tus == mDOMStream->GetStream()->AsProcessedStream());
   tus->SetTrackIDFilter(FilterAudioNodeStreamTrack);
 
   MediaStreamDestinationEngine* engine = new MediaStreamDestinationEngine(this, tus);
   mStream = aContext->Graph()->CreateAudioNodeStream(engine, MediaStreamGraph::INTERNAL_STREAM);
   mPort = tus->AllocateInputPort(mStream, 0);
-
-  nsIDocument* doc = aContext->GetParentObject()->GetExtantDoc();
-  if (doc) {
-    mDOMStream->CombineWithPrincipal(doc->NodePrincipal());
-  }
 }
 
 void
 MediaStreamAudioDestinationNode::DestroyMediaStream()
 {
   AudioNode::DestroyMediaStream();
   if (mPort) {
     mPort->Destroy();