[Webkit-unassigned] [Bug 14124] [CURL] Support data URLs
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Oct 26 16:30:55 PDT 2007
http://bugs.webkit.org/show_bug.cgi?id=14124
------- Comment #5 from andersca at apple.com 2007-10-26 16:30 PDT -------
(In reply to comment #4)
> (In reply to comment #3)
> > (From update of attachment 16876 [edit] [edit])
> > > unsigned len = in.size();
> > > const char* data = in.data();
> > >
> >
> > Can these just be folded into the new base64Decode call now?
>
> Like this?
>
> return base64Decode(in.data(), in.size(), out);
>
> Sure.
Good.
>
> >
> > >+ 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?
>
> These checks were in the original base64Decode(). The first is a base case and
> seems to still be necessary, but the second is probably redundant.
>
Are they still in the method that takes a vector? If so, can they be removed
from there?
> >
> > > while (len && data[len-1] == '=')
> > > --len;
> > >
> >
> > >+static void parseDataUrl(ResourceHandle* job)
> >
> > Please name the variable "handle" instead of "job".
>
> OK.
>
> >
> > >+{
> > >+ 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.
>
> Its features were closest to the original code (eg. DeprecatedString::mid()).
> KURL's KURL::decode_string() also expects and returns DeprecatedString, which
> we call for percent-encoded data.
>
String::substring is the equivalent of DeprecatedString::mid.
--
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