Bug 239021

Summary: Avoid redundant calls to findHTTPHeaderName()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, darin, ews-watchlist, ggaren, toyoshim, webkit-bug-importer, youennf, yutak
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Chris Dumez
Reported 2022-04-08 16:35:06 PDT
Avoid redundant calls to findHTTPHeaderName().
Attachments
Patch (11.88 KB, patch)
2022-04-08 16:41 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2022-04-08 16:41:06 PDT
Darin Adler
Comment 2 2022-04-10 15:46:11 PDT
Comment on attachment 457127 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457127&action=review > Source/WebCore/ChangeLog:3 > + Avoid redundant calls to findHTTPHeaderName() Can some of this be changed to use StringView later?
Chris Dumez
Comment 3 2022-04-10 16:03:14 PDT
(In reply to Darin Adler from comment #2) > Comment on attachment 457127 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=457127&action=review > > > Source/WebCore/ChangeLog:3 > > + Avoid redundant calls to findHTTPHeaderName() > > Can some of this be changed to use StringView later? What part? findHTTPHeaderName() already takes a Stringview: Source/WebCore/platform/network/create-http-header-name-table:bool findHTTPHeaderName(StringView stringView, HTTPHeaderName& headerName)
EWS
Comment 4 2022-04-10 16:55:41 PDT
Committed r292692 (249484@main): <https://commits.webkit.org/249484@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 457127 [details].
Radar WebKit Bug Importer
Comment 5 2022-04-10 17:03:58 PDT
Darin Adler
Comment 6 2022-04-11 08:34:00 PDT
Comment on attachment 457127 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457127&action=review >>> Source/WebCore/ChangeLog:3 >>> + Avoid redundant calls to findHTTPHeaderName() >> >> Can some of this be changed to use StringView later? > > What part? findHTTPHeaderName() already takes a Stringview: > Source/WebCore/platform/network/create-http-header-name-table:bool findHTTPHeaderName(StringView stringView, HTTPHeaderName& headerName) For example, setHTTPHeaderField and addHTTPHeaderField. It requires making arguments into String if they aren’t known HTTP header names, but do those String objects get kept around? It’s good we don’t do it with string literals, but what about other sources of strings? And what about the value? Does it get stored as a String or some other way? I think there are still extra String involved in those functions.
Note You need to log in before you can comment on or make changes to this bug.