Bug 113283 - Code duplication between HTTPParsers and HTTPValidation
Summary: Code duplication between HTTPParsers and HTTPValidation
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
Depends on:
Reported: 2013-03-26 01:59 PDT by Chris Dumez
Modified: 2013-03-26 11:02 PDT (History)
10 users (show)

See Also:

Patch (21.93 KB, patch)
2013-03-26 02:22 PDT, Chris Dumez
ap: review+
Details | Formatted Diff | Diff
Patch for landing (20.63 KB, patch)
2013-03-26 10:12 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2013-03-26 01:59:31 PDT
isRFC2616Token() from HTTPParsers and isValidHTTPToken() from HTTPValidation are doing exactly the same thing. We should refactor to avoid code duplication.
Comment 1 Chris Dumez 2013-03-26 02:22:58 PDT
Created attachment 195038 [details]
Comment 2 Alexey Proskuryakov 2013-03-26 09:48:48 PDT
Comment on attachment 195038 [details]

OK. We can consider splitting parsing and validation again if this file grows unwieldy.

As far as naming goes, "isRFC2616Token" seems a little less descriptive to me than "isValidHTTPToken". The reason why I like the remaining name less is that one could wonder whether being an RFC2616 token is a built-in property of a String, like being atomic or being static. The other name reads a little more like a validity check that it is. But the difference is very small, and maybe it's just me thinking so.
Comment 3 Chris Dumez 2013-03-26 10:12:53 PDT
Created attachment 195105 [details]
Patch for landing

- Renamed to isValidHTTPToken().
Comment 4 WebKit Review Bot 2013-03-26 11:02:21 PDT
Comment on attachment 195105 [details]
Patch for landing

Clearing flags on attachment: 195105

Committed r146908: <http://trac.webkit.org/changeset/146908>
Comment 5 WebKit Review Bot 2013-03-26 11:02:27 PDT
All reviewed patches have been landed.  Closing bug.