blob: 5eb06997257aee8f5988e41e6ba02e3642a59ec5 [file] [log] [blame]
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module network.mojom;
import "mojo/public/mojom/base/time.mojom";
import "services/network/public/mojom/content_security_policy.mojom";
import "services/network/public/mojom/cross_origin_embedder_policy.mojom";
import "services/network/public/mojom/cross_origin_opener_policy.mojom";
import "services/network/public/mojom/web_client_hints_types.mojom";
import "services/network/public/mojom/x_frame_options.mojom";
// Holds the parsed representation of several security related HTTP headers.
// This struct should only be populated by network::PopulateParsedHeaders()
struct ParsedHeaders {
// The parsed Content-Security-Policy from the response headers.
array<ContentSecurityPolicy> content_security_policy;
// The parsed value of the Allow-CSP-From response header.
AllowCSPFromHeaderValue? allow_csp_from;
// The parsed representation of Cross-Origin-Embedder-Policy and
// Cross-Origin-Embedder-Policy-Report-Only headers.
CrossOriginEmbedderPolicy cross_origin_embedder_policy;
// The parsed value of the Cross-Origin-Opener-Policy (COOP) and
// Cross-Origin-opener-Policy-Report-Only headers.
CrossOriginOpenerPolicy cross_origin_opener_policy;
// The parsed value of the Origin-Agent-Cluster header.
bool origin_agent_cluster = false;
// The parsed Accept-CH from response headers.
//
// If this is missing, there is no valid accept-ch header, so client hints
// handling should not change.
//
// If this is present and an empty array, this means that client hints should
// be disabled (if updating client hint preference is valid in this context).
array<WebClientHintsType>? accept_ch;
// Parsed Accept-CH-Lifetime value, if any. Zero if missing or on parse error.
mojo_base.mojom.TimeDelta accept_ch_lifetime;
// The parsed Critical-CH response header.
//
// Should be parsed in the same way (i.e. same tokens and grammar) as the
// Accept-CH header.
//
// Indicates that if these headers are missing from the Client Hint
// preference storage but not otherwise blocked from being sent, the
// appropriate preferences should be stored and the request should be
// restarted (with the new client hint preferences taken into account).
//
// All hints present in the Critical-CH header SHOULD also be present in the
// Accept-CH header.
//
// An empty list means the headers value was empty (i.e. 'Critical-CH:'). A
// null value means the header was not present in the response. These are
// both functionally a no-op.
//
// For more information, see:
// https://tools.ietf.org/html/draft-davidben-http-client-hint-reliability#section-3
array<WebClientHintsType>? critical_ch;
// The parsed value of the X-Frame-Options header.
XFrameOptionsValue xfo = XFrameOptionsValue.kNone;
};