[Webkit-unassigned] [Bug 14124] [CURL] Support data URLs
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Oct 26 16:12:15 PDT 2007
http://bugs.webkit.org/show_bug.cgi?id=14124
andersca at apple.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #16876|review? |review-
Flag| |
------- Comment #3 from andersca at apple.com 2007-10-26 16:12 PDT -------
(From update of attachment 16876)
> unsigned len = in.size();
> const char* data = in.data();
>
Can these just be folded into the new base64Decode call now?
>+ return base64Decode(data, len, out);
>+}
>+
>+bool base64Decode(const char* data, unsigned len, Vector<char>& out)
>+{
>+ out.clear();
>+ if (len == 0)
>+ return true;
>+
>+ // If the input string is pathologically large, just return nothing.
>+ if (len > UINT_MAX)
>+ return false;
>+
Why is this change needed?
> while (len && data[len-1] == '=')
> --len;
>
>+static void parseDataUrl(ResourceHandle* job)
Please name the variable "handle" instead of "job".
>+{
>+ DeprecatedString data = job->request().url().url().latin1();
Why do you need to call latin1() here? Also, we recommend against using
DeprecatedString in newly written code.
>+
>+ ASSERT(data.startsWith("data:"));
URL schemes are case insensitive so this is not correct.
>+
> void ResourceHandleManager::startJob(ResourceHandle* job)
I take it that startJob is called from the main loop.
> {
>+ KURL kurl = job->request().url();
>+ String protocol = kurl.protocol();
>+
>+ if (protocol == "data") {
URL schemes are insensitive, please use equalIgnoringCase here.
>+ parseDataUrl(job);
>+ return;
>+ }
>+
> ResourceHandleInternal* d = job->getInternal();
--
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list