[prev in list] [next in list] [prev in thread] [next in thread] 

List:       webkit-changes
Subject:    [webkit-changes] [WebKit/WebKit] 578d89: Add proper support for "Parsing Structured Fields"...
From:       Chris Dumez <noreply () github ! com>
Date:       2022-09-28 17:10:55
Message-ID: WebKit/WebKit/push/refs/heads/parseStructuredHeaderField/000000-578d89 () github ! com
[Download RAW message or body]

  Branch: refs/heads/parseStructuredHeaderField
  Home:   https://github.com/WebKit/WebKit
  Commit: 578d89b1ec42ac920aeef1eec595afb869bd69d7
      https://github.com/WebKit/WebKit/commit/578d89b1ec42ac920aeef1eec595afb869bd69d7
  Author: Chris Dumez <cdumez@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):


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic