Changeset 221031 in webkit


Ignore:
Timestamp:
Aug 22, 2017 11:46:17 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[Cache API] Optimize whitespace trimming in Vary header values
https://bugs.webkit.org/show_bug.cgi?id=175837

Patch by Youenn Fablet <youenn@apple.com> on 2017-08-22
Reviewed by Alex Christensen.

No change of behavior.

Introducing a StringView version of stripLeadingAndTrailingHTTPSpaces.

  • Modules/cache/Cache.cpp:

(WebCore::hasResponseVaryStarHeaderValue):

  • platform/network/HTTPParsers.h:

(WebCore::stripLeadingAndTrailingHTTPSpaces):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r221028 r221031  
     12017-08-22  Youenn Fablet  <youenn@apple.com>
     2
     3        [Cache API] Optimize whitespace trimming in Vary header values
     4        https://bugs.webkit.org/show_bug.cgi?id=175837
     5
     6        Reviewed by Alex Christensen.
     7
     8        No change of behavior.
     9
     10        Introducing a StringView version of stripLeadingAndTrailingHTTPSpaces.
     11
     12        * Modules/cache/Cache.cpp:
     13        (WebCore::hasResponseVaryStarHeaderValue):
     14        * platform/network/HTTPParsers.h:
     15        (WebCore::stripLeadingAndTrailingHTTPSpaces):
     16
    1172017-08-22  Alex Christensen  <achristensen@webkit.org>
    218
  • trunk/Source/WebCore/Modules/cache/Cache.cpp

    r221024 r221031  
    128128    bool hasStar = false;
    129129    varyValue.split(',', false, [&](StringView view) {
    130         if (!hasStar && stripLeadingAndTrailingHTTPSpaces(view.toStringWithoutCopying()) == "*")
     130        if (!hasStar && stripLeadingAndTrailingHTTPSpaces(view) == "*")
    131131            hasStar = true;
    132132    });
  • trunk/Source/WebCore/platform/network/HTTPParsers.h

    r219276 r221031  
    113113}
    114114
     115inline StringView stripLeadingAndTrailingHTTPSpaces(StringView string)
     116{
     117    return string.stripLeadingAndTrailingMatchedCharacters(isHTTPSpace);
     118}
     119
    115120}
    116121
Note: See TracChangeset for help on using the changeset viewer.