Closed
Bug 1291071
Opened 10 years ago
Closed 10 years ago
Stop passing a Decoder object to RasterImage::FinalizeDecoder() and rename it appropriately
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla51
| Tracking | Status | |
|---|---|---|
| firefox51 | --- | fixed |
People
(Reporter: seth, Assigned: seth)
References
Details
Attachments
(6 files, 1 obsolete file)
|
5.35 KB,
patch
|
eflores
:
review+
|
Details | Diff | Splinter Review |
|
5.30 KB,
patch
|
eflores
:
review+
|
Details | Diff | Splinter Review |
|
9.68 KB,
patch
|
eflores
:
review+
|
Details | Diff | Splinter Review |
|
10.30 KB,
patch
|
eflores
:
review+
|
Details | Diff | Splinter Review |
|
10.60 KB,
patch
|
eflores
:
review+
|
Details | Diff | Splinter Review |
|
7.16 KB,
patch
|
eflores
:
review+
|
Details | Diff | Splinter Review |
RasterImage::FinalizeDecoder() is used to communicate the final results of the decoding process to RasterImage. However, the fact that it requires a real Decoder object requires some awkward workarounds when errors are detected outside of the Decoder itself. We should rework FinalizeDecoder() so it does not actually take a Decoder object as an argument, just the relevant data, the same way that NotifyProgress() works. Having done that, it'll probably also be appropriate to rename it.
| Assignee | ||
Comment 1•10 years ago
|
||
All of these patches are pretty straightforward; we're just pulling all of the
data that FinalizeDecoder() needs to inspect off of the decoder and passing it
in directly.
This patch handles ImageMetadata.
Attachment #8777157 -
Flags: review?(edwin)
| Assignee | ||
Comment 2•10 years ago
|
||
Since we call NotifyProgress() one final time in FinalizeDecoder(), we need to
pass in the same stuff that we pass to NotifyProgress().
Attachment #8777158 -
Flags: review?(edwin)
| Assignee | ||
Comment 3•10 years ago
|
||
This patch makes us pass in telemetry data explicitly.
Attachment #8777159 -
Flags: review?(edwin)
| Assignee | ||
Comment 4•10 years ago
|
||
Decoder::SpeedHistogram() doesn't have the best design right now. It's
non-const, which prevented me from marking Decoder::Telemetry() const. It uses
an invalid telemetry ID value to indicate that we don't want to record telemetry
for a particular decoder. And at this point it should really be protected rather
than public. Let's fix all that stuff.
Attachment #8777160 -
Flags: review?(edwin)
| Assignee | ||
Comment 5•10 years ago
|
||
FinalizeDecoder() inspects what amounts to a few bits of state to determine
whether the decode succeeded and what kind of error handling to perform. This
patch bundles all that state up in a struct.
Attachment #8777163 -
Flags: review?(edwin)
| Assignee | ||
Comment 6•10 years ago
|
||
Now we've eliminated any reason to pass a decoder to FinalizeDecoder(), so we
can stop doing so. Now that it's more of a notification callback like
NotifyProgress(), it makes sense to rename it to match the same pattern, and to
make the function that sends the callback like NotifyProgress() does.
Attachment #8777166 -
Flags: review?(edwin)
| Assignee | ||
Comment 7•10 years ago
|
||
I noticed there's a line of dead code in NotifyProgress(); let's remove it.
Attachment #8777167 -
Flags: review?(edwin)
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → seth.bugzilla
| Assignee | ||
Comment 8•10 years ago
|
||
It's worth noting that we'll be able to clean this stuff up more later. In this bug I'm just trying to preserve the same behavior / state / etc that we have now, but without giving RasterImage direct access to the decoder. Once the animated image refactoring stuff lands, there will be some further simplification opportunities.
Attachment #8777157 -
Flags: review?(edwin) → review+
Attachment #8777158 -
Flags: review?(edwin) → review+
Attachment #8777159 -
Flags: review?(edwin) → review+
Attachment #8777160 -
Flags: review?(edwin) → review+
Attachment #8777163 -
Flags: review?(edwin) → review+
Attachment #8777166 -
Flags: review?(edwin) → review+
Attachment #8777167 -
Flags: review?(edwin) → review+
| Assignee | ||
Comment 9•10 years ago
|
||
Thanks for the reviews, Edwin!
| Assignee | ||
Comment 10•10 years ago
|
||
Comment on attachment 8777167 [details] [diff] [review]
(Part 7) - Remove dead line of code in NotifyProgress().
I ended up folding this into bug 1291045.
Attachment #8777167 -
Attachment is obsolete: true
| Assignee | ||
Comment 11•10 years ago
|
||
Here's a try job:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b2e23ab1a51f
Comment 12•10 years ago
|
||
Pushed by seth.bugzilla@blackhail.net:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d416df8849a0
(Part 1) - Move an assertion from RasterImage::FinalizeDecoder() to IDecodingTask::NotifyDecodeComplete(). r=edwin
https://hg.mozilla.org/integration/mozilla-inbound/rev/5ce50dc53516
(Part 1) - Pass ImageMetadata explicitly to FinalizeDecoder. r=edwin
https://hg.mozilla.org/integration/mozilla-inbound/rev/801b6b88b490
(Part 2) - Pass decoder progress explicitly to FinalizeDecoder. r=edwin
https://hg.mozilla.org/integration/mozilla-inbound/rev/9b9a6dca2883
(Part 3) - Pass telemetry explicitly to FinalizeDecoder. r=edwin
https://hg.mozilla.org/integration/mozilla-inbound/rev/eef2029cae9d
(Part 4) - Clean up Decoder::SpeedHistogram() and related code. r=edwin
https://hg.mozilla.org/integration/mozilla-inbound/rev/55a26e91a828
(Part 5) - Pass the decoder's final status explicitly to FinalizeDecoder(). r=edwin
https://hg.mozilla.org/integration/mozilla-inbound/rev/731d13870f6a
(Part 6) - Stop passing a decoder to FinalizeDecoder() and rename it NotifyDecodeComplete(). r=edwin
Comment 13•10 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/d416df8849a0
https://hg.mozilla.org/mozilla-central/rev/5ce50dc53516
https://hg.mozilla.org/mozilla-central/rev/801b6b88b490
https://hg.mozilla.org/mozilla-central/rev/9b9a6dca2883
https://hg.mozilla.org/mozilla-central/rev/eef2029cae9d
https://hg.mozilla.org/mozilla-central/rev/55a26e91a828
https://hg.mozilla.org/mozilla-central/rev/731d13870f6a
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in
before you can comment on or make changes to this bug.
Description
•