[webkit-changes] [WebKit/WebKit] 578d89: Add proper support for "Parsing Structured Fields"...

Chris Dumez noreply at github.com
Wed Sep 28 10:10:55 PDT 2022


  Branch: refs/heads/parseStructuredHeaderField
  Home:   https://github.com/WebKit/WebKit
  Commit: 578d89b1ec42ac920aeef1eec595afb869bd69d7
      https://github.com/WebKit/WebKit/commit/578d89b1ec42ac920aeef1eec595afb869bd69d7
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2022-09-28 (Wed, 28 Sep 2022)

  Changed paths:
    M Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp
    M Source/WebCore/Modules/reporting/ReportingScope.cpp
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/loader/CrossOriginEmbedderPolicy.cpp
    M Source/WebCore/loader/CrossOriginOpenerPolicy.cpp
    M Source/WebCore/loader/HTTPHeaderField.cpp
    M Source/WebCore/loader/HTTPHeaderField.h
    M Source/WebCore/loader/HeaderFieldTokenizer.cpp
    M Source/WebCore/platform/network/HTTPParsers.cpp
    M Source/WebCore/platform/network/HTTPParsers.h
    A Source/WebCore/platform/network/RFC7230.cpp
    A Source/WebCore/platform/network/RFC7230.h
    A Source/WebCore/platform/network/RFC8941.cpp
    A Source/WebCore/platform/network/RFC8941.h

  Log Message:
  -----------
  Add proper support for "Parsing Structured Fields" from RFC8941
https://bugs.webkit.org/show_bug.cgi?id=245757

Reviewed by NOBODY (OOPS!).

Add proper support for "Parsing Structured Fields" from RFC8941 for both "item"
and "dictionary" types. The spec also supports the "list" type, but I didn't
add it yet since we don't have any users yet.

The "item" type is used to parse the Cross-Origin-Opener-Policy &
Cross-Origin-Embedder-Policy headers:
- https://html.spec.whatwg.org/multipage/origin.html#obtain-coop (step 3)
- https://html.spec.whatwg.org/multipage/origin.html#obtain-an-embedder-policy (step 3)

The "dictionary" type is used to parse the Reporting-Endpoints header:
- https://w3c.github.io/reporting/#process-header (step 2)

We had partial support in 2 different places with no code sharing. We know have
near complete support with code sharing.

This will allow us to implement support for the Permission-Policy header more easily in the near future:
- https://www.w3.org/TR/permissions-policy-1/#algo-process-response-policy (step 1)

* Source/WebCore/Modules/reporting/ReportingScope.cpp:
(WebCore::ReportingScope::parseReportingEndpointsFromHeader):
(WebCore::isQuote): Deleted.
* Source/WebCore/loader/CrossOriginEmbedderPolicy.cpp:
(WebCore::obtainCrossOriginEmbedderPolicy):
* Source/WebCore/loader/CrossOriginOpenerPolicy.cpp:
(WebCore::obtainCrossOriginOpenerPolicy):
* Source/WebCore/platform/network/HTTPParsers.cpp:
(WebCore::RFC8941::parseKey):
(WebCore::RFC8941::parseString):
(WebCore::RFC8941::parseToken):
(WebCore::RFC8941::parseBoolean):
(WebCore::RFC8941::parseBareItem):
(WebCore::RFC8941::parseParameters):
(WebCore::RFC8941::parseItem):
(WebCore::RFC8941::parseInnerList):
(WebCore::RFC8941::parseItemOrInnerList):
(WebCore::RFC8941::parseDictionary):
(WebCore::RFC8941::parseItemStructuredFieldValue):
(WebCore::RFC8941::parseDictionaryStructuredFieldValue):
(WebCore::parseStructuredFieldValue): Deleted.
* Source/WebCore/platform/network/HTTPParsers.h:
(WebCore::RFC8941::Token::Token):
(WebCore::RFC8941::Token::string const):




More information about the webkit-changes mailing list