Title: [221031] trunk/Source/WebCore
- Revision
- 221031
- Author
- [email protected]
- Date
- 2017-08-22 11:46:17 -0700 (Tue, 22 Aug 2017)
Log Message
[Cache API] Optimize whitespace trimming in Vary header values
https://bugs.webkit.org/show_bug.cgi?id=175837
Patch by Youenn Fablet <[email protected]> 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (221030 => 221031)
--- trunk/Source/WebCore/ChangeLog 2017-08-22 18:45:06 UTC (rev 221030)
+++ trunk/Source/WebCore/ChangeLog 2017-08-22 18:46:17 UTC (rev 221031)
@@ -1,3 +1,19 @@
+2017-08-22 Youenn Fablet <[email protected]>
+
+ [Cache API] Optimize whitespace trimming in Vary header values
+ https://bugs.webkit.org/show_bug.cgi?id=175837
+
+ 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):
+
2017-08-22 Alex Christensen <[email protected]>
Remove ChromeClient::scrollbarsModeDidChange
Modified: trunk/Source/WebCore/Modules/cache/Cache.cpp (221030 => 221031)
--- trunk/Source/WebCore/Modules/cache/Cache.cpp 2017-08-22 18:45:06 UTC (rev 221030)
+++ trunk/Source/WebCore/Modules/cache/Cache.cpp 2017-08-22 18:46:17 UTC (rev 221031)
@@ -127,7 +127,7 @@
auto varyValue = response.headers().internalHeaders().get(WebCore::HTTPHeaderName::Vary);
bool hasStar = false;
varyValue.split(',', false, [&](StringView view) {
- if (!hasStar && stripLeadingAndTrailingHTTPSpaces(view.toStringWithoutCopying()) == "*")
+ if (!hasStar && stripLeadingAndTrailingHTTPSpaces(view) == "*")
hasStar = true;
});
return hasStar;
Modified: trunk/Source/WebCore/platform/network/HTTPParsers.h (221030 => 221031)
--- trunk/Source/WebCore/platform/network/HTTPParsers.h 2017-08-22 18:45:06 UTC (rev 221030)
+++ trunk/Source/WebCore/platform/network/HTTPParsers.h 2017-08-22 18:46:17 UTC (rev 221031)
@@ -112,6 +112,11 @@
return string.stripWhiteSpace(isHTTPSpace);
}
+inline StringView stripLeadingAndTrailingHTTPSpaces(StringView string)
+{
+ return string.stripLeadingAndTrailingMatchedCharacters(isHTTPSpace);
}
+}
+
#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes