[webkit-reviews] review granted: [Bug 171614] When the image decoding thread makes a callOnMainThread(), ensure all the objects it needs are protected : [Attachment 310311] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 17 04:20:28 PDT 2017


David Kilzer (:ddkilzer) <ddkilzer at webkit.org> has granted Said Abou-Hallawa
<sabouhallawa at apple.com>'s request for review:
Bug 171614: When the image decoding thread makes a callOnMainThread(), ensure
all the objects it needs are protected
https://bugs.webkit.org/show_bug.cgi?id=171614

Attachment 310311: Patch

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




--- Comment #11 from David Kilzer (:ddkilzer) <ddkilzer at webkit.org> ---
Comment on attachment 310311
  --> https://bugs.webkit.org/attachment.cgi?id=310311
Patch

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

r=me with two fixes for removing 'this' from the lambda.

> Source/WebCore/platform/graphics/ImageFrameCache.cpp:298
> +	       callOnMainThread([this, protectedThis = protectedThis.copyRef(),
protectedQueue = protectedQueue.copyRef(), protectedDecoder =
protectedDecoder.copyRef(), nativeImage, frameRequest] () mutable {

Don't need to capture 'this' since you have 'protectedThis'.  (See below.)

> Source/WebCore/platform/graphics/ImageFrameCache.cpp:299
>		   // The queue may be closed if after we got the frame
NativeImage, stopAsyncDecodingQueue() was called

Nit:  Period at end of comment.

> Source/WebCore/platform/graphics/ImageFrameCache.cpp:305
> +		       LOG(Images, "ImageFrameCache::%s - %p - url: %s [frame
%ld will not cached]", __FUNCTION__, this,
protectedThis->sourceURL().string().utf8().data(), frameRequest.index);

Replace 'this' with 'protectedThis->get()' here.


More information about the webkit-reviews mailing list