Closed Bug 1659551 Opened 4 years ago Closed 4 years ago

Implement caching for nsPrinterBase::CreateDefaultSettings

Categories

(Core :: Printing: Setup, task, P2)

task

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: nordzilla, Assigned: nordzilla)

References

(Blocks 1 open bug)

Details

(Whiteboard: [print2020_v81])

Attachments

(1 file)

The nsPrinterBase::CreateDefaultSettings() function needs to resolve a promise with a new print settings object for each time that it's called.

Currently, this function will spawn a new background task and initialize a default print settings object with each function call.

We should improve the performance for the case of multiple calls by caching the first-created print settings object and resolving all subsequent promises by cloning the already-initialized, cached settings.

This way we won't be spawning multiple background tasks if CreateDefaultSettings() is invoked multiple times.

We probably don't need this for the inital release, so bumping to v82 (although if we get to it for v81 that's great).

Whiteboard: [print2020_v81] → [print2020_v82]
Assignee: nobody → enordin
Status: NEW → ASSIGNED

Adds caching for each nsPrinterBase's PrintSettingsInitializer so that
subsequent calls don't need to spawn a background task to retrieve it.

Attachment #9171016 - Attachment description: Bug 1659551 - Cache PrintSettingsInitializer → Bug 1659551 - Cache PrintSettingsInitializer r=jwatt,emilio
Attachment #9171016 - Attachment description: Bug 1659551 - Cache PrintSettingsInitializer r=jwatt,emilio → Bug 1659551 - Cache PrintSettingsInitializer
Attachment #9171016 - Attachment description: Bug 1659551 - Cache PrintSettingsInitializer → Bug 1659551 - Cache PrintSettingsInitializer r=jwatt,emilio
Pushed by nerli@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c4d781be7a1d
Cache PrintSettingsInitializer r=jwatt,emilio
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Whiteboard: [print2020_v82] → [print2020_v81]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: