chromium/services/network/public/mojom/proxy_config.mojom

// 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";

// This corresponds to the string representation of net::ProxyConfigBypassRules.
struct ProxyBypassRules {
  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 {
  ProxyBypassRules 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;
};

// These fields mirror those of net::ProxyConfig.
struct ProxyConfig {
  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,
};