[Webkit-unassigned] [Bug 27777] ImageSourceCG makes bad data refs (race condition causes blank images)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 28 15:12:22 PDT 2009


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


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #33674|review?                     |review+
               Flag|                            |




--- Comment #7 from Darin Adler <darin at apple.com>  2009-07-28 15:12:21 PDT ---
(From update of attachment 33674)
> +void SharedBufferDerefCallback(void*, void* info)

Function names should start with a lowercase letter. Since this is private to
this source file it should use "static" to get internal linkage.

> +    SharedBuffer* sharedBuffer = reinterpret_cast<SharedBuffer*>(info);

This should be static_cast, which can convert a void* to a specific pointer
type.

> +    data->ref();
> +    CFAllocatorContext context = {0, data, 0, 0, 0, 0, 0, SharedBufferDerefCallback, 0};
> +    CFAllocatorRef derefAllocator = CFAllocatorCreate(kCFAllocatorDefault, &context);
> +    CFDataRef cfData = CFDataCreateWithBytesNoCopy(0, reinterpret_cast<const UInt8*>(data->data()), data->size(), derefAllocator);
> +    CFRelease(derefAllocator);

Creating a unique allocator each time is unfortunate, but I can't think of any
better idea.

r=me but the style issues I mention above should be fixed

-- 
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