[webkit-reviews] review granted: [Bug 184254] REGRESSION: MessagePort.postMessage() fails to send transferable objects : [Attachment 338142] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 17 13:31:27 PDT 2018


Daniel Bates <dbates at webkit.org> has granted Tadeu Zagallo
<tzagallo at apple.com>'s request for review:
Bug 184254: REGRESSION: MessagePort.postMessage() fails to send transferable
objects
https://bugs.webkit.org/show_bug.cgi?id=184254

Attachment 338142: Patch

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




--- Comment #27 from Daniel Bates <dbates at webkit.org> ---
Comment on attachment 338142
  --> https://bugs.webkit.org/attachment.cgi?id=338142
Patch

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

> Source/WebCore/bindings/js/SerializedScriptValue.h:164
> +    ASSERT(arrayLength > 0);

ArrayLength is an unsigned data type so it can never be < 0. By our style
guidelines you should remove the “> 0”.

> Source/WebCore/bindings/js/SerializedScriptValue.h:171
> +

Does it ever make sense that bufferSize is zero? If not, we should add an
assert.

> Source/WebCore/bindings/js/SerializedScriptValue.h:172
> +	   void* buffer = Gigacage::tryMalloc(Gigacage::Primitive, bufferSize);

For your consideration I suggest we change the data type of this local from
void* to uint8_t*. Then we can remove the static_cast<> below.


More information about the webkit-reviews mailing list