Bug 161970 - URLParser: Add fast path for hosts containing no non-ASCII or percent characters
Summary: URLParser: Add fast path for hosts containing no non-ASCII or percent characters
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-14 09:46 PDT by Alex Christensen
Modified: 2016-09-14 12:37 PDT (History)
1 user (show)

See Also:


Attachments
Patch (4.69 KB, patch)
2016-09-14 09:48 PDT, Alex Christensen
dbates: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2016-09-14 09:46:58 PDT
URLParser: Add fast path for hosts containing no non-ASCII or percent characters
Comment 1 Alex Christensen 2016-09-14 09:48:59 PDT
Created attachment 288826 [details]
Patch
Comment 2 Daniel Bates 2016-09-14 10:42:01 PDT
Comment on attachment 288826 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=288826&action=review

> Source/WebCore/platform/URLParser.cpp:748
> +            if (!isASCII(*c) || *c == '%')

I suggest that we define a static inline helper function, say isPercentEncodedOrASCII(), that takes a character c and returns the result of evaluating "!isASCII(c) || c == '%'" instead of repeating the "!isASCII(*c) || *c == '%'" check throughout the code.

> Source/WebCore/platform/URLParser.h:51
> +    bool m_hostHasPercentOrNonASCII { false };

Maybe a better name for this variable would be m_hostHasPercentEncodedOrNonASCIICharacter?
Comment 3 Alex Christensen 2016-09-14 12:37:32 PDT
https://trac.webkit.org/changeset/205922