Bug 1325215 - Ensure that all AudioContext members that need to participate in cycle collection do so; r=padenot
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 18 Jan 2017 10:48:40 +0100
changeset 374921 c01f7957ff5227a21e7ce7d1a529193c2f3460cc
parent 374920 72cfa0d3be9f189bdf73a3e873c5869b7f649cdd
child 374922 353266dd63ede28fd3f8f5ddd8d855f5beb7395d
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1325215
milestone53.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 1325215 - Ensure that all AudioContext members that need to participate in cycle collection do so; r=padenot MozReview-Commit-ID: JIL0nFL4lMW
dom/media/webaudio/AudioContext.cpp
layout/tools/reftest/runreftest.py
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -73,33 +73,44 @@ namespace dom {
 // AudioContext.
 static dom::AudioContext::AudioContextId gAudioContextId = 1;
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(AudioContext)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AudioContext)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mDestination)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mListener)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK(mPromiseGripArray)
   if (!tmp->mIsStarted) {
     NS_IMPL_CYCLE_COLLECTION_UNLINK(mActiveNodes)
   }
+  // mDecodeJobs owns the WebAudioDecodeJob objects whose lifetime is managed explicitly.
+  // mAllNodes is an array of weak pointers, ignore it here.
+  // mPannerNodes is an array of weak pointers, ignore it here.
+  // mBasicWaveFormCache cannot participate in cycles, ignore it here.
+
   // Remove weak reference on the global window as the context is not usable
   // without mDestination.
   tmp->DisconnectFromWindow();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END_INHERITED(DOMEventTargetHelper)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(AudioContext,
                                                   DOMEventTargetHelper)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDestination)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mListener)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPromiseGripArray)
   if (!tmp->mIsStarted) {
     MOZ_ASSERT(tmp->mIsOffline,
                "Online AudioContexts should always be started");
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mActiveNodes)
   }
+  // mDecodeJobs owns the WebAudioDecodeJob objects whose lifetime is managed explicitly.
+  // mAllNodes is an array of weak pointers, ignore it here.
+  // mPannerNodes is an array of weak pointers, ignore it here.
+  // mBasicWaveFormCache cannot participate in cycles, ignore it here.
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_ADDREF_INHERITED(AudioContext, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(AudioContext, DOMEventTargetHelper)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(AudioContext)
   NS_INTERFACE_MAP_ENTRY(nsIMemoryReporter)
 NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
--- a/layout/tools/reftest/runreftest.py
+++ b/layout/tools/reftest/runreftest.py
@@ -364,27 +364,17 @@ class RefTest(object):
             ix = v.find("=")
             if ix <= 0:
                 print "Error: syntax error in --setenv=" + v
                 return None
             browserEnv[v[:ix]] = v[ix + 1:]
 
         # Enable leaks detection to its own log file.
         self.leakLogFile = os.path.join(profileDir, "runreftest_leaks.log")
-
-        # Leak checking was broken in reftest unnoticed for a length of time. During
-        # this time, a leak slipped into the crashtest suite. The leak checking was
-        # fixed by bug 1325148, but it couldn't land until the regression in crashtest
-        # was also fixed or backed out. Rather than waiting and risking new regressions,
-        # temporarily disable leak checking in crashtest. Fix is tracked by bug 1325215.
-        if options.suite == 'crashtest' and mozinfo.info['os'] == 'linux':
-            self.log.warning('WARNING | leakcheck disabled due to bug 1325215')
-        else:
-            browserEnv["XPCOM_MEM_BLOAT_LOG"] = self.leakLogFile
-
+        browserEnv["XPCOM_MEM_BLOAT_LOG"] = self.leakLogFile
         return browserEnv
 
     def killNamedOrphans(self, pname):
         """ Kill orphan processes matching the given command name """
         self.log.info("Checking for orphan %s processes..." % pname)
 
         def _psInfo(line):
             if pname in line: