• David Van Cleve's avatar
    Add a Trust Tokens argument to Fetch's RequestInit. · fc9c7810
    David Van Cleve authored
    This CL expands the Fetch API, when the runtime-enabled feature
    "TrustTokens" is enabled, to include a new experimental parameter
    `trustTokens` denoting a request to execute a Trust Tokens protocol step
    (https://github.com/wicg/trust-token-api) alongside the fetch at hand,
    by adding request headers and processing corresponding response
    headers.
    
    This is an experimental interface that will be used in an origin trial.
    It only needs to support fetches from frames (i.e., it is OK from a
    usability perspective for the origin trial if the parameter is not
    populated when fetch is called from other settings).
    
    The main parts of the CL are:
    - as specified in the linked explainer, expand Fetch's RequestInit
    dictionary with a new trustToken parameter, specifying a single Trust
    Tokens protocol operation of token issuance, token redemption, or
    request signing;
    - add this data to blink::ResourceRequest and associated objects, so
    that it gets copied to network::ResourceRequest in
    blink::PopulateResourceRequest.
    
    Test:
    - Adds integration tests in //content to ensure that calling the API
    results in the right ResourceRequest members being populated.
    
    Change-Id: I5c5b0c0ed5450eeb80c19be856f62941e50ec0e1
    Bug: 1043118
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2036648Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
    Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
    Commit-Queue: David Van Cleve <davidvc@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#749622}
    fc9c7810
trust_token_parameters_browsertest.cc 9.85 KB