Closed Bug 1607356 Opened 6 years ago Closed 5 years ago

Convert the platform font loader thread to use the background thread pool instead

Categories

(Core :: Layout: Text and Fonts, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: KrisWright, Assigned: heycam)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Instead of making a static lazy idle thread [1], the work done here could be sent to the background IO thread pool [2] using the NS_DISPATCH_EVENT_MAY_BLOCK flag.

[1] https://searchfox.org/mozilla-central/rev/4537228c0a18bc0ebba2eb7f5cbebb6ea9ab211c/gfx/thebes/gfxUserFontSet.cpp#926-927
[2] https://searchfox.org/mozilla-central/rev/4537228c0a18bc0ebba2eb7f5cbebb6ea9ab211c/xpcom/threads/nsThreadUtils.h#1737-1755

Hi Kris, the work that this thread does is running the OpenType sanitizer over the font data after it has already been fetched from the network. The call into platform library functions to create the font with the sanitized data is done back on the main thread afterwards. (And this isn't used for loading locally installed fonts off the disk.) Does this mean it shouldn't use NS_DISPATCH_EVENT_MAY_BLOCK?

Assignee: nobody → cam
Status: NEW → ASSIGNED
Flags: needinfo?(kwright)

(In reply to Cameron McCormack (:heycam) from comment #1)

Hi Kris, the work that this thread does is running the OpenType sanitizer over the font data after it has already been fetched from the network. The call into platform library functions to create the font with the sanitized data is done back on the main thread afterwards. (And this isn't used for loading locally installed fonts off the disk.) Does this mean it shouldn't use NS_DISPATCH_EVENT_MAY_BLOCK?

You're correct, I only looked briefly at it so if it's not doing anything blocking then it doesn't need to use the NS_DISPATCH_EVENT_MAY_BLOCK flag.

Flags: needinfo?(kwright)
Pushed by cmccormack@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/51b437b9a933 Move OTS sanitization to background thread. r=KrisWright
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: