Closed Bug 1263647 Opened 9 years ago Closed 9 years ago

Avoid unnecessary Tab:AudioPlayingChange messages

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(firefox48 fixed)

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+
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: