Bug 127336 - Add protocolIsInHTTPFamily for strings and use it where appropriate
Summary: Add protocolIsInHTTPFamily for strings and use it where appropriate
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: jochen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-21 00:19 PST by jochen
Modified: 2014-01-23 07:45 PST (History)
6 users (show)

See Also:


Attachments
Patch (4.29 KB, patch)
2014-01-21 00:20 PST, jochen
no flags Details | Formatted Diff | Diff
Patch (4.57 KB, patch)
2014-01-22 11:14 PST, jochen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jochen 2014-01-21 00:19:39 PST
Add protocolIsInHTTPFamily for strings and use it where appropriate
Comment 1 jochen 2014-01-21 00:20:16 PST
Created attachment 221726 [details]
Patch
Comment 2 Alexey Proskuryakov 2014-01-21 09:54:38 PST
Comment on attachment 221726 [details]
Patch

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

> Source/WebCore/platform/URL.cpp:1780
> +    return protocolIs(url, "http") || protocolIs(url, "https");

This function seems like it could be made faster - we check for "http" prefix twice here.
Comment 3 Darin Adler 2014-01-21 18:30:12 PST
Comment on attachment 221726 [details]
Patch

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

>> Source/WebCore/platform/URL.cpp:1780
>> +    return protocolIs(url, "http") || protocolIs(url, "https");
> 
> This function seems like it could be made faster - we check for "http" prefix twice here.

I agree that we could make a tighter version.
Comment 4 jochen 2014-01-22 11:14:40 PST
Created attachment 221879 [details]
Patch
Comment 5 jochen 2014-01-22 12:26:54 PST
ptal

I considered changing URL::parse to use this method but it would require constructing a String from the const char* url. Not sure whether that's worth it
Comment 6 WebKit Commit Bot 2014-01-22 14:13:08 PST
Comment on attachment 221879 [details]
Patch

Clearing flags on attachment: 221879

Committed r162555: <http://trac.webkit.org/changeset/162555>
Comment 7 WebKit Commit Bot 2014-01-22 14:13:10 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Darin Adler 2014-01-23 07:45:27 PST
(In reply to comment #5)
> I considered changing URL::parse to use this method but it would require constructing a String from the const char* url. Not sure whether that's worth it

It’s not.