[Webkit-unassigned] [Bug 40018] Image Resizer Patch 1: Adding basic classes to perform the resizing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 7 07:56:46 PDT 2010


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


Dmitry Titov <dimich at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #57927|review?, commit-queue?      |review-, commit-queue-
               Flag|                            |




--- Comment #16 from Dmitry Titov <dimich at chromium.org>  2010-06-07 07:56:45 PST ---
(From update of attachment 57927)
Getting closer and hotter :-) There is one more note about lifetime, see below.

WebCore/html/AsyncImageResizer.cpp:68
 +      if (!cachedImage->stillNeedsLoad() && cachedImage->isLoaded()) {
I wonder if using notifyFinished() callback of CachedResourceClient w/o this check is a better way to go here, because the check is not needed then.

WebCore/html/AsyncImageResizer.h:80
 +      ImageResizerThread* m_thread;
This variable seems to be not used.

WebCore/html/ImageResizerThread.cpp:51
 +      delete callbackInfo->imageResizerThread;
Now you have 2 'delete' operations on the ImageResizerThread - one here and one in thread function. Not sure this will work.

One way to fix this could be to not keep CallbackInfo as part of the thread object (so you need to keep tread object alive until callback is fired) but rather allocate an independent CalbackInfo instance when thread is done resizing, fill it in and schedule callback on the main thread - and then detach/delete the thread, since the callback call is now independent. Keeping AsyncImageResizer in RefPtr along the way is a good thing, it'll keep it alive until calback is actually fired (whether or not it'l reach the javascript is a separate issue for future). At the end of this static callback function, the CallbackInfo can be deleted.

r- because of 2 'delete's, but it's close.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list