WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
236784
Use more StringView during CSP parsing
https://bugs.webkit.org/show_bug.cgi?id=236784
Summary
Use more StringView during CSP parsing
Chris Dumez
Reported
2022-02-17 08:16:46 PST
Use more StringView during CSP parsing.
Attachments
Patch
(7.04 KB, patch)
2022-02-17 08:18 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(9.00 KB, patch)
2022-02-17 19:51 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2022-02-17 08:18:30 PST
Created
attachment 452372
[details]
Patch
Darin Adler
Comment 2
2022-02-17 16:20:24 PST
Comment on
attachment 452372
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=452372&action=review
As long as we don’t need these things to outlive the buffer we are parsing, this is a great thing to do.
> Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp:386 > -template<typename CharacterType> std::optional<String> ContentSecurityPolicySourceList::parseScheme(StringParsingBuffer<CharacterType> buffer) > +template<typename CharacterType> std::optional<StringView> ContentSecurityPolicySourceList::parseScheme(StringParsingBuffer<CharacterType> buffer)
Given that both String and StringView have a null value, I am surprised that we feel the need to use std::optional.
Chris Dumez
Comment 3
2022-02-17 16:22:08 PST
(In reply to Darin Adler from
comment #2
)
> Comment on
attachment 452372
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=452372&action=review
> > As long as we don’t need these things to outlive the buffer we are parsing, > this is a great thing to do. > > > Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp:386 > > -template<typename CharacterType> std::optional<String> ContentSecurityPolicySourceList::parseScheme(StringParsingBuffer<CharacterType> buffer) > > +template<typename CharacterType> std::optional<StringView> ContentSecurityPolicySourceList::parseScheme(StringParsingBuffer<CharacterType> buffer) > > Given that both String and StringView have a null value, I am surprised that > we feel the need to use std::optional.
That is true. I'll see if I can fix this up too.
Chris Dumez
Comment 4
2022-02-17 19:51:28 PST
Created
attachment 452473
[details]
Patch
EWS
Comment 5
2022-02-18 09:26:52 PST
Committed
r290131
(
247475@main
): <
https://commits.webkit.org/247475@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 452473
[details]
.
Radar WebKit Bug Importer
Comment 6
2022-02-18 09:27:22 PST
<
rdar://problem/89149597
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug