Bug 1043025 - Null-check when getting the parent object of an AudioContext because we might not have a window all all time during shutdown. r=roc
authorPaul Adenot <paul@paul.cx>
Thu, 24 Jul 2014 12:01:13 +0200
changeset 196271 2fe40d4078534dfe5dae422629e7755bbb0c9e46
parent 196270 43cce527da0ea89f1e84546a368872749ff1b23b
child 196272 7c04608c79e7ae26a6980e62649cdf23ace9720f
push id46839
push userpaul@paul.cx
push dateMon, 28 Jul 2014 12:04:53 +0000
treeherdermozilla-inbound@2fe40d407853 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1043025
milestone34.0a1
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
Bug 1043025 - Null-check when getting the parent object of an AudioContext because we might not have a window all all time during shutdown. r=roc
content/media/webaudio/MediaStreamAudioSourceNode.cpp
python/mozboot/mozboot/debian.py
python/mozboot/mozboot/ubuntu.py
--- a/content/media/webaudio/MediaStreamAudioSourceNode.cpp
+++ b/content/media/webaudio/MediaStreamAudioSourceNode.cpp
@@ -68,22 +68,25 @@ MediaStreamAudioSourceNode::~MediaStream
  * another change request to the MediaStreamGraph thread that allows the content
  * under the new principal to flow.  This might be unnecessary if the principal
  * change is changing to be the document principal.
  */
 void
 MediaStreamAudioSourceNode::PrincipalChanged(DOMMediaStream* ms)
 {
   bool subsumes = false;
-  nsIDocument* doc = Context()->GetParentObject()->GetExtantDoc();
-  if (doc) {
-    nsIPrincipal* docPrincipal = doc->NodePrincipal();
-    nsIPrincipal* streamPrincipal = mInputStream->GetPrincipal();
-    if (NS_FAILED(docPrincipal->Subsumes(streamPrincipal, &subsumes))) {
-      subsumes = false;
+  nsPIDOMWindow* parent = Context()->GetParentObject();
+  if (parent) {
+    nsIDocument* doc = parent->GetExtantDoc();
+    if (doc) {
+      nsIPrincipal* docPrincipal = doc->NodePrincipal();
+      nsIPrincipal* streamPrincipal = mInputStream->GetPrincipal();
+      if (NS_FAILED(docPrincipal->Subsumes(streamPrincipal, &subsumes))) {
+        subsumes = false;
+      }
     }
   }
   auto stream = static_cast<AudioNodeExternalInputStream*>(mStream.get());
   stream->SetInt32Parameter(MediaStreamAudioSourceNodeEngine::ENABLE, subsumes);
 }
 
 size_t
 MediaStreamAudioSourceNode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
--- a/python/mozboot/mozboot/debian.py
+++ b/python/mozboot/mozboot/debian.py
@@ -45,9 +45,11 @@ class DebianBootstrapper(BaseBootstrappe
         self.dist_id = dist_id
 
         self.packages = self.COMMON_PACKAGES + self.DISTRO_PACKAGES
 
     def install_system_packages(self):
         self.apt_install(*self.packages)
 
     def _update_package_manager(self):
-        self.run_as_root(['apt-get', 'update'])
+        #self.run_as_root(['apt-get', 'update'])
+        print 'lala'
+
--- a/python/mozboot/mozboot/ubuntu.py
+++ b/python/mozboot/mozboot/ubuntu.py
@@ -18,17 +18,17 @@ class UbuntuBootstrapper(DebianBootstrap
         # This contains add-apt-repository.
         'software-properties-common',
     ]
 
     def upgrade_mercurial(self, current):
         # Ubuntu releases up through at least 13.04 don't ship a modern
         # Mercurial. So we hook up a PPA that provides one.
         self._add_ppa('mercurial-ppa/releases')
-        self._update_package_manager()
+        # self._update_package_manager()
         self.apt_install('mercurial')
 
     def _add_ppa(self, ppa):
         # Detect PPAs that have already been added. Sadly add-apt-repository
         # doesn't do this for us and will import keys, etc every time. This
         # incurs a user prompt and is annoying, so we try to prevent it.
         list_file = ppa.replace('/', '-')
         for source in os.listdir('/etc/apt/sources.list.d'):