[Webkit-unassigned] [Bug 37874] Provide mechanism to cache metadata for a resource

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 5 09:59:06 PDT 2010


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





--- Comment #17 from Adam Barth <abarth at webkit.org>  2010-05-05 09:59:04 PST ---
> Would it be controversial if I mailed a patch to add a comment pointing to the
> documentation in RefPtr.h?

Please do.  Not enough people read that doc.  :)

> > WebCore/loader/CachedMetadataMap.cpp:91
> >  +  void CachedMetadataMap::appendValueToBuffer(const T* value,
> > PassRefPtr<SharedBuffer> buffer) const
> > This should be a raw SharedBuffer*.  We use PassRefPtr to signal that we're
> > passing ownership of the refcounted object.
> 
> I'm now passing a const Vector<char>&. Is that ideal?

That's probably good.  I'll look.

> > WebCore/loader/CachedMetadataMap.cpp:93
> >  +      buffer->append(reinterpret_cast<const char*>(value), sizeof(T));
> > Yuck.  This isn't strictly ANSI compliant.
> 
> Are you referring to ANSI C (i.e. char could be another size) or ANSI unicode
> (i.e. doesn't handle UTF-8)?
> 
> If C: I could switch to uint8_t/uint32_t instead of char/unsigned. But I'd
> still have to cast at the API level to make this useful.
> 
> If Unicode: Keep in mind that I'm expecting this to be a serialization of bytes
> of metadata. It is not a string.
> 
> If something else, please explain.

I meant I don't think it's a strictly legal reinterpret_cast according to ANSI
C.  Just my way of complaining about low-level memory poking.

Looking at the new patch now.

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