Closed Bug 1360799 Opened 7 years ago Closed 7 years ago

Expose the requestIdleCallback API to chrome code unconditionally

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: ehsan.akhgari, Unassigned)

Details

Attachments

(1 file)

We need to use this API in the front-end code, and in the off-chance
that we end up turning it off for the Web for whatever reason, or if
someone has turned off the pref, we should make sure our UI code does
not break.
Comment on attachment 8863107 [details] [diff] [review]
Expose the requestIdleCallback API to chrome code unconditionally

I don't think IsPrivilegedChromeWindow is the right check, because it's false for a bunch of our UI.  For example, I'm pretty sure it's false for all our in-tab UI like about:preferences, about:addons, etc.

Probably better to just check nsContentUtils::IsSystemCaller(aCx).  Yes, this will also allow chrome to requestIdleCallback on a content window via Xrays, but I think that's fine.

r=me with that change made.
Attachment #8863107 - Flags: review?(bzbarsky) → review+
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7af61811f270
Expose the requestIdleCallback API to chrome code unconditionally; r=bzbarsky
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7884a0eaf969
follow-up: Fix the comment in the header after addressing the review comment
https://hg.mozilla.org/mozilla-central/rev/7af61811f270
https://hg.mozilla.org/mozilla-central/rev/7884a0eaf969
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: