Code-cleanup around nsPrintJob initialization code
Categories
(Core :: Printing: Output, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox103 | --- | fixed |
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
Attachments
(2 files)
Similar to bug 1776074: nsPrintJob has a fallible Initialize
method, which after some analysis, turns out to be actually infallible. Let's make that clearer and then merge it into the constructor.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
This patch doesn't change behavior.
Depends on D150177
Assignee | ||
Comment 2•2 years ago
|
||
This patch doesn't change behavior; it's just collapsing logic from
nsPrintJob's Initialize method (which is now de-facto infallible) into the
constructor.
I'm also removing the "Methods needed by the DocViewer" header-comment since
it's clearly innacurate at this point. It's only surrounding this constructor
and GetSeqFrameAndCountSheets, which is silly since nsDocumentViewer uses more
of our API than that.
(I also placed TODO(dholbert) comments for a few things that looked odd, to
follow up on later. In particular, I noticed that nsDocumentViewer holds a
dedicated stack-owned RefPtr reference to nsPrintJob after creating it, which
superficially looks unnecessary. I don't want to risk changing behvior or
introducing a crash by removing that reference in this refactoring patch, so
I'm leaving that as-is and simply flagging it as suspicious.)
Depends on D150194
Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d3c69c86d287 part 1: Change nsPrintJob::Initialize to take references instead of pointers, to avoid the need for unnecessary null-checks. r=emilio https://hg.mozilla.org/integration/autoland/rev/c2fa397508dc part 2: Merge nsPrintJob::Initialize into the constructor. r=emilio
Comment 4•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d3c69c86d287
https://hg.mozilla.org/mozilla-central/rev/c2fa397508dc
Description
•