[webkit-reviews] review granted: [Bug 127012] Use KeyedCoding as a persistent storage mechanism for blobs : [Attachment 221323] Patch v1

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 16 13:13:27 PST 2014


Anders Carlsson <andersca at apple.com> has granted Brady Eidson
<beidson at apple.com>'s request for review:
Bug 127012: Use KeyedCoding as a persistent storage mechanism for blobs
https://bugs.webkit.org/show_bug.cgi?id=127012

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

------- Additional Comments from Anders Carlsson <andersca at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=221323&action=review


> Source/WebCore/platform/KeyedCoding.h:79
> +	   while (beginArrayElement()) {

If beginArrayElement() returns false result will be uninitialized. I'd
initialize result to true and change the loop to

while (true) { if (!beginArrayElement()) { result = false; break; }

> Source/WebCore/platform/KeyedCoding.h:81
> +	       objects.append(T());
> +	       result = function(*this, objects.last());

Instead of appending to the array do something like:
T element;
if (!function(*this, t)) {
    result = false;
    break;
}

object.append(std::move(element));

> Source/WebCore/platform/KeyedCoding.h:115
> +    virtual PassRefPtr<SharedBuffer> createBuffer() = 0;

Let's call this finishEncoding() instead to indicate that it can only be called
when you're done.

> Source/WebKit2/ChangeLog:7
> +

Extra newline.


More information about the webkit-reviews mailing list