Closed Bug 1375163 Opened 7 years ago Closed 7 years ago

Schedule Safebrowsing.init() using requestIdleCallback instead of setTimeout

Categories

(Toolkit :: Safe Browsing, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1376591

People

(Reporter: Felipe, Unassigned)

References

(Blocks 1 open bug)

Details

Currently, SafeBrowsing.init() is scheduled off a 2sec setTimeout call from _delayedStartup.  This means that it can arbitrarily start running while the browser is not idle, and it might hang the browser for the user while they are interacting.

This is some critical code, so we can't postpone it forever.. But if we use requestIdleCallback with a small timeout (say, 10s?), it has a better change of being scheduled on a more appropriate time.
Whiteboard: [photon-performance] → [photon-performance] [triage]
We should also move this to nsBrowserGlue.js so that it doesn't happen for each new window.
Blocks: 1300126
(In reply to :Felipe Gomes (needinfo me!) from comment #0)
> This is some critical code, so we can't postpone it forever.. But if we use
> requestIdleCallback with a small timeout (say, 10s?), it has a better change
> of being scheduled on a more appropriate time.

As far as I know, it's also required as soon as you want to load a URL. I'm not sure we can relay delay it.
Flags: qe-verify-
Priority: -- → P2
Whiteboard: [photon-performance] [triage] → [photon-performance]
See Also: → 1376591
This will be rolled into bug 1376591.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Flags: qe-verify-
Priority: P2 → --
Whiteboard: [photon-performance]
You need to log in before you can comment on or make changes to this bug.