[Webkit-unassigned] [Bug 156690] REGRESSION(r198782): SHOULD NEVER BE REACHED failure in ImageSource::setData since r198782

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 18 23:36:44 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=156690

--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com> ---
(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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160419/f4455eb2/attachment.html>


More information about the webkit-unassigned mailing list