Bug 113283

Summary: Code duplication between HTTPParsers and HTTPValidation
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebGLAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ap, eric, gyuyoung.kim, hausmann, laszlo.gombos, mkwst, rakuco, rniwa, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ap: review+
Patch for landing none

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]
Patch
Comment 2 Alexey Proskuryakov 2013-03-26 09:48:48 PDT
Comment on attachment 195038 [details]
Patch

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.