[Webkit-unassigned] [Bug 175595] New: Remove the ImageSource from the class hierarchy that connects BitmapImage to ImageFrame

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 15 13:27:32 PDT 2017


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

            Bug ID: 175595
           Summary: Remove the ImageSource from the class hierarchy that
                    connects BitmapImage to ImageFrame
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Images
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sabouhallawa at apple.com

Currently we have this hierarchy: BitmapImage -> ImageSource -> ImageFrameCache -> ImageDecoder + ImageFrame. This hierarchy structure has been troublesome. Two reasons for that:

1) Unclear purpose of ImageSource: The initial plan was to have ImageSource be responsible of retrieving and caching the image metadata. And have ImageFrameCache be responsible of retrieving and caching the image frames. This plan changed gradually by having ImageFrameCache be responsible for both. ImageSource mainly became a bridge connecting BitmapImage to ImageFrameCache. Other than that, it has few APIs which set the encoded data in the ImageDecoder. Some other APIs ensure the decoder is created and the rest are just helper APIs. All these APIs can fit better in either BitmapImage or ImageFrameCache.

2) The life cycle of the decoder has become problematic and hard to be understood: This is because it is shared among
   -- ImageSource (for setting the encoded data)
   -- ImageFrameCache (for retrieving the image metadata and decoding the image frames synchronously)
   -- The decoding thread (for decoding the image frames asynchronously)

The way it shared is the following. The ImageSource creates the ImageDecoder and passes a RefPtr to ImageDecoder to the ImageFrameCache. The ImageFrameCache passes a RefPtr to ImageDecoder to the decoding thread. We saw few crashes because the ImageDecoder was not a RefPtr at the beginning. Then we saw other crashes because the ImageDecoder was not protected by the decoding thread.

To fix this issue, here is the plan:
-- Get rid of ImageSource by moving its APIs to ImageFrameCache and BitmapImage.
-- Have BitmapImage::m_source a RefPtr of type ImageFrameCache
-- In followup patch rename ImageFrameCache to be ImageSource

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


More information about the webkit-unassigned mailing list