blob: 1047c8da7a8340fc06858154609f96f8de168aa5 [file] [log] [blame]
// Copyright 2017 The Chromium Authors
// 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/big_string.mojom";
import "services/network/public/mojom/network_param.mojom";
import "url/mojom/scheme_host_port.mojom";
// This corresponds to the string representation of
// `net::ProxyHostMatchingRules`.
struct ProxyHostMatchingRules {
array<string> rules;
};
// A list of proxy chains.
struct ProxyList {
array<network.mojom.ProxyChain> proxies;
};
// This corresponds to `net::ProxyConfig::ProxyRules::Type`.
enum ProxyRulesType {
EMPTY,
PROXY_LIST,
PROXY_LIST_PER_SCHEME,
};
// These fields mirror those of `net::ProxyConfig::ProxyRules`.
struct ProxyRules {
ProxyHostMatchingRules bypass_rules;
bool reverse_bypass;
ProxyRulesType type;
ProxyList single_proxies;
ProxyList proxies_for_http;
ProxyList proxies_for_https;
ProxyList proxies_for_ftp;
ProxyList fallback_proxies;
};
// This corresponds to `net::ProxyConfig::ProxyOverrideRule::Result`.
enum ProxyOverrideRuleResult {
kNotFound,
kResolved,
};
// This corresponds to `net::ProxyConfig::ProxyOverrideRule::DnsProbeCondition`.
struct DnsProbeCondition {
url.mojom.SchemeHostPort host;
ProxyOverrideRuleResult result;
};
// These fields mirror those of `net::ProxyConfig::ProxyOverrideRule`.
struct ProxyOverrideRule {
ProxyHostMatchingRules destination_matchers;
ProxyHostMatchingRules exclude_destination_matchers;
array<DnsProbeCondition> dns_conditions;
ProxyList proxy_list;
};
// These fields mirror those of `net::ProxyConfig`.
struct ProxyConfig {
array<ProxyOverrideRule> proxy_override_rules;
bool auto_detect;
// If true, indicates that the `ProxyConfig` object was created from system
// settings.
bool from_system;
// Note that a `BigString` is used rather than a `url.mojom.Url`, since
// `url.mojom.Url` imposes a smaller limit on URL size than GURL, and
// `ProxyConfig::pac_url` may contain large data: URLs that exceed this limit.
mojo_base.mojom.BigString pac_url;
bool pac_mandatory;
ProxyRules proxy_rules;
};
// The policy used for bypassing requests that are eligible for IP Protection.
// Even if a domain is part of the masked domain list, the bypass policy can
// be used to bypass certain network requests from IP Protection.
enum IpProtectionProxyBypassPolicy {
// No bypass policy.
kNone = 0,
// Request to domains that are first party to the top level frame are
// bypassed.
kFirstPartyToTopLevelFrame = 1,
// Request to domains that are on a given exclusion list are bypassed. This
// exclusion list is set through `NetworkService::UpdateMaskedDomainList`.
kExclusionList = 2,
};