-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port remaining WebCore/loader types to the new serialization format #9383
Port remaining WebCore/loader types to the new serialization format #9383
Conversation
EWS run on previous version of this PR (hash 6663991) |
6663991
to
3198bc9
Compare
EWS run on previous version of this PR (hash 3198bc9) |
bool isValid() const { return m_content != nullptr; } | ||
bool shouldRevealToSessionHistory() const { return m_shouldRevealToSessionHistory == SessionHistoryVisibility::Visible; } | ||
|
||
const FragmentedSharedBuffer* content() const { return m_content.get(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you changed this return type to RefPtr and shouldRevealToSessionHistory to SessionHistoryVisibility you could avoid "friend struct IPC::ArgumentCoder"
StringView strippedName = StringView(name).stripLeadingAndTrailingMatchedCharacters(RFC7230::isWhitespace<UChar>); | ||
StringView strippedValue = StringView(value).stripLeadingAndTrailingMatchedCharacters(RFC7230::isWhitespace<UChar>); | ||
|
||
ASSERT(RFC7230::isValidName(strippedName) && RFC7230::isValidValue(strippedValue)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this assertion is valid when decoding from an untrusted source, even after stripping whitespace.
String name = strippedName.length() == unparsedName.length() ? WTFMove(unparsedName) : strippedName.toString(); | ||
String value = strippedValue.length() == unparsedValue.length() ? WTFMove(unparsedValue) : strippedValue.toString(); | ||
return {{ WTFMove(name), WTFMove(value) }}; | ||
std::optional<HTTPHeaderField> HTTPHeaderField::create(String&& unparsedName, String&& unparsedValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use CreateUsing=create and make a new attribute to allow the create function to return a std::optional, then just leave HTTPHeaderField class alone.
3198bc9
to
1534fd2
Compare
EWS run on previous version of this PR (hash 1534fd2) |
1534fd2
to
749b27d
Compare
EWS run on previous version of this PR (hash 749b27d) |
EWS run on previous version of this PR (hash 9656efd) |
9656efd
to
2768bfc
Compare
EWS run on current version of this PR (hash 2768bfc) |
https://bugs.webkit.org/show_bug.cgi?id=251434 rdar://104866054 Reviewed by Alex Christensen. This change includes porting types: - CanvasActivityRecord - AttributionSecondsUntilSendData - CrossOriginOpenerPolicyValue - CrossOriginOpenerPolicy - CustomHeaderFields - HTTPHeaderField - NavigationRequester - PolicyContainer - SessionHistoryVisibility - SubstituteData * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/loader/AttributionSecondsUntilSendData.h: (WebCore::PCM::AttributionSecondsUntilSendData::minSecondsUntilSend): (WebCore::PCM::AttributionSecondsUntilSendData::encode const): Deleted. (WebCore::PCM::AttributionSecondsUntilSendData::decode): Deleted. * Source/WebCore/loader/CanvasActivityRecord.h: (WebCore::CanvasActivityRecord::encode const): Deleted. (WebCore::CanvasActivityRecord::decode): Deleted. * Source/WebCore/loader/CrossOriginOpenerPolicy.h: (WebCore::CrossOriginOpenerPolicy::encode const): Deleted. (WebCore::CrossOriginOpenerPolicy::decode): Deleted. * Source/WebCore/loader/CustomHeaderFields.h: (WebCore::CustomHeaderFields::encode const): Deleted. (WebCore::CustomHeaderFields::decode): Deleted. * Source/WebCore/loader/HTTPHeaderField.cpp: (WebCore::HTTPHeaderField::HTTPHeaderField): (WebCore::HTTPHeaderField::isValid): (WebCore::HTTPHeaderField::create): * Source/WebCore/loader/HTTPHeaderField.h: (WebCore::HTTPHeaderField::encode const): Deleted. (WebCore::HTTPHeaderField::decode): Deleted. * Source/WebCore/loader/NavigationRequester.h: (WebCore::NavigationRequester::encode const): Deleted. (WebCore::NavigationRequester::decode): Deleted. * Source/WebCore/loader/PolicyContainer.h: (WebCore::PolicyContainer::isolatedCopy): (WebCore::PolicyContainer::encode const): Deleted. (WebCore::PolicyContainer::decode): Deleted. * Source/WebCore/loader/SubstituteData.h: (WebCore::SubstituteData::SubstituteData): (WebCore::SubstituteData::isValid const): (WebCore::SubstituteData::shouldRevealToSessionHistory const): (WebCore::SubstituteData::content const): (WebCore::SubstituteData::mimeType const): (WebCore::SubstituteData::textEncoding const): (WebCore::SubstituteData::failingURL const): (WebCore::SubstituteData::response const): (WebCore::SubstituteData::encode const): Deleted. (WebCore::SubstituteData::decode): Deleted. * Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in: Canonical link: https://commits.webkit.org/259811@main
2768bfc
to
148e18a
Compare
Committed 259811@main (148e18a): https://commits.webkit.org/259811@main Reviewed commits have been landed. Closing PR #9383 and removing active labels. |
148e18a
2768bfc
π§ͺ api-gtk