[webkit-reviews] review granted: [Bug 206055] Decoding an SVG off the main thread causes a crash : [Attachment 427409] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 30 10:33:11 PDT 2021


Darin Adler <darin at apple.com> has granted Chris Lord <clord at igalia.com>'s
request for review:
Bug 206055: Decoding an SVG off the main thread causes a crash
https://bugs.webkit.org/show_bug.cgi?id=206055

Attachment 427409: Patch

https://bugs.webkit.org/attachment.cgi?id=427409&action=review




--- Comment #4 from Darin Adler <darin at apple.com> ---
Comment on attachment 427409
  --> https://bugs.webkit.org/attachment.cgi?id=427409
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=427409&action=review

> Source/WebCore/html/ImageBitmap.cpp:739
> +    auto image = BitmapImage::create(&observer.get());

The better idiom here is observer.ptr().

> Source/WebCore/html/ImageBitmap.cpp:760
> +    bitmapData->context().drawImage(image.get(), destRect,
sourceRectangle.releaseReturnValue(), {
interpolationQualityForResizeQuality(options.resizeQuality),
imageOrientationForOrientation(options.imageOrientation) });

Not sure we need ".get()" here. Ref typically converts itself to a reference
when passing it as an argument.

> Source/WebCore/svg/graphics/SVGImage.cpp:83
> +    ASSERT(isMainThread());

Consider also having this assertion in Image::create itself?

The assertion without a comment seems a little mysterious; not that I’d want a
long comment.


More information about the webkit-reviews mailing list