[Webkit-unassigned] [Bug 104354] IndexedDB: Don't use strings to represent serialized values

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Dec 16 16:36:09 PST 2012


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





--- Comment #18 from Kentaro Hara <haraken at chromium.org>  2012-12-16 16:38:27 PST ---
(From update of attachment 179599)
View in context: https://bugs.webkit.org/attachment.cgi?id=179599&action=review

> Source/WebCore/Modules/indexeddb/IDBBackingStore.cpp:1392
> +    virtual const Vector<uint8_t>* value() const { ASSERT_NOT_REACHED(); return 0; }

I would prefer returning 'const Vector<uint8_t>&' because m_currentValue is a member variable. Here you can write:

  virtual const Vector<uint8_t>& value() const { ASSERT_NOT_REACHED(); return new Vector<uint8_t>(); }

Performance of this code wouldn't be important as this is a code that must not be reached.

> Source/WebCore/Modules/indexeddb/IDBBackingStore.cpp:1447
> +    virtual const Vector<uint8_t>* value() const { return &m_currentValue; }

Ditto.

> Source/WebCore/Modules/indexeddb/IDBBackingStore.cpp:1508
> +    virtual const Vector<uint8_t>* value() const { ASSERT_NOT_REACHED(); return 0; }

Ditto.

> Source/WebCore/Modules/indexeddb/IDBBackingStore.cpp:1587
> +    virtual const Vector<uint8_t>* value() const { return &m_currentValue; }

Ditto.

> Source/WebCore/Modules/indexeddb/IDBBackingStore.h:118
> +        virtual const Vector<uint8_t>* value() const = 0;

Ditto.

> Source/WebCore/bindings/js/SerializedScriptValue.h:110
> +        Vector<uint8_t> bytes(data);
> +        return adopt(bytes);

Let's apply the comment from Alec Flett.

> Source/WebCore/bindings/v8/SerializedScriptValue.cpp:2262
> +        dst[i] = ntohs(src[i]);

Alec Flett: Does this ntohs() looks OK ?

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