Closed Bug 1263647 Opened 4 years ago Closed 4 years ago

Avoid unnecessary Tab:AudioPlayingChange messages

Categories

(Firefox for Android :: General, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 48
Tracking Status
firefox48 --- fixed

People

(Reporter: JanH, Assigned: JanH)

References

Details

Attachments

(1 file)

Managing Tab:AudioPlayingChange from one location is nice, but now we're sending out Tab:AudioPlayingChange messages when zombifying tabs even if the tab in question wasn't playing any audio.
Assignee: nobody → jh+bugzilla
Comment on attachment 8740012 [details]
MozReview Request: Bug 1263647 - When receiving a TabPreZombify event, send out a Tab:AudioPlayingChange message only if the tab is actually playing some audio. r=margaret

https://reviewboard.mozilla.org/r/45485/#review42409

::: mobile/android/chrome/content/browser.js:4104
(Diff revision 1)
>            return;
>          }
>  
> +        if (aEvent.type === "TabPreZombify" && !this.playingAudio) {
> +          return;
> +        }

Instead, what you could do, is create a `"TabPreZombify"` case up above the `"DOMAudio..."` cases, then fall through only if audio is actually playing.
Attachment #8740012 - Flags: review?(margaret.leibovic)
Comment on attachment 8740012 [details]
MozReview Request: Bug 1263647 - When receiving a TabPreZombify event, send out a Tab:AudioPlayingChange message only if the tab is actually playing some audio. r=margaret

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/45485/diff/1-2/
Attachment #8740012 - Flags: review?(margaret.leibovic)
https://reviewboard.mozilla.org/r/45485/#review42409

> Instead, what you could do, is create a `"TabPreZombify"` case up above the `"DOMAudio..."` cases, then fall through only if audio is actually playing.

Thanks for the suggestion, I'm clearly too much under the influence of C#, where fall through is a no go. But as long as we don't do anything too fancy in PreTabZombify, it seems okay.
Comment on attachment 8740012 [details]
MozReview Request: Bug 1263647 - When receiving a TabPreZombify event, send out a Tab:AudioPlayingChange message only if the tab is actually playing some audio. r=margaret

https://reviewboard.mozilla.org/r/45485/#review42993
Attachment #8740012 - Flags: review?(margaret.leibovic) → review+
https://hg.mozilla.org/mozilla-central/rev/8cbd3940c47f
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
You need to log in before you can comment on or make changes to this bug.