[webkit-reviews] review granted: [Bug 33731] Remove uses of PtrAndFlags : [Attachment 46756] New WebCore::StringImpl patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jan 16 19:28:30 PST 2010


Darin Adler <darin at apple.com> has granted Gavin Barraclough
<barraclough at apple.com>'s request for review:
Bug 33731: Remove uses of PtrAndFlags
https://bugs.webkit.org/show_bug.cgi?id=33731

Attachment 46756: New WebCore::StringImpl patch
https://bugs.webkit.org/attachment.cgi?id=46756&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
> +    OwnPtr<const UChar*> path(fileName.copyWithNullTermination());

This needs to be OwnArrayPtr<const UChar>, not OwnPtr<const UChar*>. Because
delete [] and delete without the "[]" are not the same thing.

> +    OwnPtr<const UChar*> m_queryWithNullTermination;

Same here.

> +    const UChar* copyWithNullTermination() const;

This should probably return PassOwnArrayPtr, not a raw pointer. Otherwise it's
too easy to get the type wrong for the smart pointer (as above). Unfortunately,
there is no PassOwnArrayPtr as of this writing.

Another good possibility would be to have the function take in an
OwnArrayPtr<const UChar>& and set it to point to the newly allocated buffer.

> +    static const unsigned s_refCountMask = 0xfffffffe;

I personally prefer capital hex.

review+ assuming you fix the OwnArrayPtr issue.


More information about the webkit-reviews mailing list