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

This commit is contained in:
Paul Adenot 2014-07-24 12:01:13 +02:00
parent a838adcacf
commit 905bdcf2e5
3 changed files with 13 additions and 8 deletions

View File

@ -73,12 +73,15 @@ 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());

View File

@ -50,4 +50,6 @@ class DebianBootstrapper(BaseBootstrapper):
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'

View File

@ -23,7 +23,7 @@ class UbuntuBootstrapper(DebianBootstrapper):
# 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):