RESOLVED WONTFIX 47620
[WTFURL] Implement URLFragmentCanonicalizer
https://bugs.webkit.org/show_bug.cgi?id=47620
Summary [WTFURL] Implement URLFragmentCanonicalizer
Adam Barth
Reported 2010-10-13 13:54:57 PDT
[WTFURL] Implement URLFragmentCanonicalizer
Attachments
Patch (15.16 KB, patch)
2010-10-13 14:00 PDT, Adam Barth
eric: review-
Adam Barth
Comment 1 2010-10-13 14:00:35 PDT
Eric Seidel (no email)
Comment 2 2010-11-02 02:47:40 PDT
Comment on attachment 70657 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=70657&action=review I think we should see a patch with a couple more comments. r- for the nits. > JavaScriptCore/wtf/url/src/URLCanonicalizer.h:44 > + static void canonicalize(const InChar* spec, const URLSegments& segments, URLBuffer<OutChar>& buffer, URLSegments& resultSegments) > + { > + // FIXME: Implement this function. > + } > +}; Should this be ASSERT_NOT_REACHED? > JavaScriptCore/wtf/url/src/URLFragmentCanonicalizer.h:43 > + if (fragment.length() < 0) { isEmpty? Or isNull? or isValid? length() < 0 seems very opaque. > JavaScriptCore/wtf/url/src/URLFragmentCanonicalizer.h:50 > + convertFragment(spec, fragment, buffer); Why doesn't convertFragment return a length? Maybe by refernce? > JavaScriptCore/wtf/url/src/URLFragmentCanonicalizer.h:59 > + if (spec[i] == '\0') Does this have sign-extension problems? I guess not since \0 is 0, and thus could never error due to sign extension... You mentioned in person that this line needs a FIXME. Please add. > JavaScriptCore/wtf/url/src/URLFragmentCanonicalizer.h:61 > + if (static_cast<unsigned>(spec[i]) < 0x20) { Do we want a compareTo helper here to avoid anyone doing this wrong? This probably needs some comments to explain what this is doing. These are fast-paths, but they're not obvious. > JavaScriptCore/wtf/url/src/URLFragmentCanonicalizer.h:66 > + buffer.append(static_cast<char>(spec[i])); Shouldn't this be OutChar? > JavaScriptCore/wtf/url/src/URLQueryCanonicalizer.h:97 > + Unicode::decodeToBuffer(spec, query.begin(), query.end(), convertedQuery); Unicode:: seems more like a platform-style dependency instead of one needing templates. But that's something which can be changed in a later patch. In either case, I think using Unicode:: is better than convertCharset was.
Adam Barth
Comment 3 2011-05-23 10:17:05 PDT
WTFURL is gone.
Note You need to log in before you can comment on or make changes to this bug.