Closed Bug 1375235 Opened 7 years ago Closed 7 years ago

AudioChannelService::IsWindowActive() creates unnecessary AudioChannelWindow objects

Categories

(Core :: Web Audio, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: bkelly, Assigned: bkelly)

References

Details

Attachments

(1 file)

We are using GetOrCreateWindowData() here:

http://searchfox.org/mozilla-central/source/dom/audiochannel/AudioChannelService.cpp#635

We probably just want GetWindowData() instead.  If it returns nullptr then we know that mAudibleAgents is effectively empty.
Assignee: nobody → bkelly
Status: NEW → ASSIGNED
Comment on attachment 8880388 [details] [diff] [review]
Don't create the AudioChannelWindow unnecessarily when checking for audio activity in the window. r=padenot

Paul, this is just a small optimization to avoid allocating AudioChannelWindow objects when the window is not using audio.  We call IsWindowActive() for every window using setTimeout(), so we are probably allocating a lot of these that are never really needed.
Attachment #8880388 - Flags: review?(padenot)
Component: Audio/Video → Web Audio
Rank: 21
Priority: -- → P2
Attachment #8880388 - Flags: review?(padenot) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/85d571396597
Don't create the AudioChannelWindow unnecessarily when checking for audio activity in the window. r=padenot
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/85d571396597
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.