Avoid unnecessary Tab:AudioPlayingChange messages

RESOLVED FIXED in Firefox 48

Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: JanH, Assigned: JanH)

Tracking

Trunk
Firefox 48
Points:
---

Firefox Tracking Flags

(firefox48 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
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)

Comment 1

3 years ago
Created 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 commit: https://reviewboard.mozilla.org/r/45485/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/45485/
Attachment #8740012 - Flags: review?(margaret.leibovic)
(Assignee)

Updated

3 years ago
Assignee: nobody → jh+bugzilla

Comment 2

3 years ago
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)
(Assignee)

Comment 3

3 years ago
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)
(Assignee)

Comment 4

3 years ago
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 5

3 years ago
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+

Comment 8

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/8cbd3940c47f
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox48: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
You need to log in before you can comment on or make changes to this bug.