Summary: | REGRESSION(r198782): SHOULD NEVER BE REACHED failure in ImageSource::setData since r198782 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||||
Component: | Platform | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bugs-noreply, sabouhallawa, simon.fraser | ||||||
Priority: | P2 | Keywords: | Gtk, Regression | ||||||
Version: | WebKit Local Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 155322 | ||||||||
Attachments: |
|
Description
Carlos Garcia Campos
2016-04-18 02:32:20 PDT
Created attachment 276626 [details]
Patch
Comment on attachment 276626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=276626&action=review > Source/WebCore/platform/graphics/ImageSource.cpp:74 > +bool ImageSource::tryEnsureDecoderIfNeeded(const SharedBuffer& data) "try ensure" is not a good name, and "if needed" is more like "if possible". (In reply to comment #2) > Comment on attachment 276626 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=276626&action=review > > > Source/WebCore/platform/graphics/ImageSource.cpp:74 > > +bool ImageSource::tryEnsureDecoderIfNeeded(const SharedBuffer& data) > > "try ensure" is not a good name, and "if needed" is more like "if possible". My initial idea was to use try create instead, but normally try create methods return the created object or nullptr, but this one ensures it exists. So that's why I kept the ensure part. The "if possible" is already covered by try, if needed is not because ImageDecoder::create can fail, but because there's an early return in case the decoder has already been created. I added the if needed because I initially called it try create, but I agree the ensure also covers if needed. In any case, the ensure method is only called by setData() so I wonder if we really need an ensure method after all. Btw, this is causing a lot of crashes in a our debug bot, so I would like tho fix this soon, to avoid the early exit. Created attachment 276704 [details]
Updated patch
I think the code is simpler and clearer without the ensure method. In the end we can't ensure the decoder is created.
Comment on attachment 276704 [details]
Updated patch
Please wait one day in case Said has comments.
Committed r199764: <http://trac.webkit.org/changeset/199764> |