Bug 1641161 - Bug 1285290 Document suspend/resume accounting wrt ApplyAudioContextOperation() r=padenot
authorKarl Tomlinson <karlt+@karlt.net>
Wed, 27 May 2020 08:39:48 +0000
changeset 532354 a1dd9afbfdf5deddd0a6b2f1a76d9f83dc0bb66a
parent 532353 1823eb201ef68f7f4ba6f250c6449de53230f3f5
child 532355 1d049fb23f850080f9cc80f1b59d644234b913f5
push id37454
push userccoroiu@mozilla.com
push dateWed, 27 May 2020 16:14:31 +0000
treeherdermozilla-central@a1dd9afbfdf5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1641161, 1285290
milestone78.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 1641161 - Bug 1285290 Document suspend/resume accounting wrt ApplyAudioContextOperation() r=padenot Depends on D76803 Differential Revision: https://phabricator.services.mozilla.com/D76804
dom/media/MediaTrackGraph.h
--- a/dom/media/MediaTrackGraph.h
+++ b/dom/media/MediaTrackGraph.h
@@ -1078,20 +1078,26 @@ class MediaTrackGraph {
   using GraphStartedPromise = GenericPromise;
   RefPtr<GraphStartedPromise> NotifyWhenGraphStarted(MediaTrack* aTrack);
   /* Same as above but the promise is resolved when the devices has started.
    * Audio is initially processed in the FallbackDriver's thread during the
    * device is start up. In a newly created graph, the promise from this method
    * will be resolved later than the promise of the method above.*/
   RefPtr<GraphStartedPromise> NotifyWhenDeviceStarted(MediaTrack* aTrack);
 
-  /* From the main thread, suspend, resume or close an AudioContext.
+  /* From the main thread, suspend, resume or close an AudioContext.  Calls
+   * are not counted.  Even Resume calls can be more frequent than Suspend
+   * calls.
+   *
    * aTracks are the tracks of all the AudioNodes of the AudioContext that
-   * need to be suspended or resumed. This can be empty if this is a second
-   * consecutive suspend call and all the nodes are already suspended.
+   * need to be suspended or resumed.  Suspend and Resume operations on these
+   * tracks are counted.  Resume operations must not outnumber Suspends and a
+   * track will not resume until the number of Resume operations matches the
+   * number of Suspends.  This array may be empty if, for example, this is a
+   * second consecutive suspend call and all the nodes are already suspended.
    *
    * This can possibly pause the graph thread, releasing system resources, if
    * all tracks have been suspended/closed.
    *
    * When the operation is complete, the returned promise is resolved.
    */
   using AudioContextOperationPromise =
       MozPromise<dom::AudioContextState, bool, true>;