[Webkit-unassigned] [Bug 36903] Implement BlobBuilder internal class for BlobBuilder support as defined in FileWriter

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 1 00:11:17 PDT 2010


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





--- Comment #3 from TAMURA, Kent <tkent at chromium.org>  2010-04-01 00:11:17 PST ---
(From update of attachment 52227)
> diff --git a/WebCore/html/BlobBuilder.cpp b/WebCore/html/BlobBuilder.cpp
> new file mode 100644
> index 0000000..c076180
> --- /dev/null
> +++ b/WebCore/html/BlobBuilder.cpp
> +typedef HashMap<String, BlobBuilder::EndingsType, CaseFoldingHash> EndingsTypeMap;
> +static const EndingsTypeMap* createEndingsTypeMap()
> +{
> +    EndingsTypeMap* map = new EndingsTypeMap;
> +    map->add("transparent", BlobBuilder::ENDING_TRANSPARENT);
> +    map->add("native", BlobBuilder::ENDING_NATIVE);
> +    map->add("lf", BlobBuilder::ENDING_LF);
> +    map->add("cr", BlobBuilder::ENDING_CR);
> +    map->add("crlf", BlobBuilder::ENDING_CRLF);

Are all the "endings" strings fixed?  If so, we had better use AtomicString
instead of String.
AtomicString is faster in comparing instances.


> +String BlobBuilder::endings() const
> +{
> +    switch (m_endings) {
> +    case ENDING_TRANSPARENT: return "transparent";
> +    case ENDING_NATIVE: return "native";
> +    case ENDING_LF: return "lf";
> +    case ENDING_CR: return "cr";
> +    case ENDING_CRLF: return "crlf";
> +    }
> +    ASSERT_NOT_REACHED();
> +    return "transparent";

ditto.  AtomicString is better.

> diff --git a/WebCore/html/ByteStore.h b/WebCore/html/ByteStore.h
> new file mode 100644
> index 0000000..c1a99cf
> --- /dev/null
> +++ b/WebCore/html/ByteStore.h
> +    // Reads the data into |out| at most |maxLength| bytes.
> +    int64_t read(char* out, size_t offset, size_t maxLength) const;
> +
> +    // Appends raw data |in|.  Returns false if the data could not be added.
> +    bool append(const char* in, size_t length);

WebKit doesn't have |parameter| notation.

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