[webkit-reviews] review granted: [Bug 87938] [GTK] Avoid unnecessary heap allocations during drag and drop operations : [Attachment 145013] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 31 06:07:35 PDT 2012


Martin Robinson <mrobinson at webkit.org> has granted Carlos Garcia Campos
<cgarcia at igalia.com>'s request for review:
Bug 87938: [GTK] Avoid unnecessary heap allocations during drag and drop
operations
https://bugs.webkit.org/show_bug.cgi?id=87938

Attachment 145013: Patch
https://bugs.webkit.org/attachment.cgi?id=145013&action=review

------- Additional Comments from Martin Robinson <mrobinson at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=145013&action=review


Hrm. I'm not sure if I prefer the new approach. It does avoid an allocation on
the heap, but replaces it with an allocation on the stack which is arguably
riskier and with the result of creating more code.   Additionally this moves
from two places in the code having to create DragData  to six.

I worry also that the use of position as an in and out parameter could be
confusing and would prefer to simply have a getter on DragAndDropHelper.

> Source/WebCore/platform/gtk/GtkDragAndDropHelper.cpp:161
> -	   return adoptPtr(static_cast<DragData*>(0));
> +	   return 0;
>  

I'm not sure what I was thinking when I wrote this code. This should be return
nullptr here.


More information about the webkit-reviews mailing list