xref: /aosp_15_r20/external/cronet/net/proxy_resolution/proxy_config_with_annotation.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2018 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "net/proxy_resolution/proxy_config_with_annotation.h"
6 
7 namespace net {
8 
9 namespace {
10 
11 constexpr NetworkTrafficAnnotationTag kDirectProxyTrafficAnnotation =
12     DefineNetworkTrafficAnnotation("proxy_config_direct", R"(
13     semantics {
14       sender: "Proxy Config"
15       description:
16         "Direct connections are being used instead of a proxy. This is a place "
17         "holder annotation that would include details about where the "
18         "configuration, which can trigger fetching a PAC file, came from."
19       trigger:
20         "Connecting directly to destination sites instead of using a proxy is "
21         "the default behavior."
22       data:
23         "None."
24       destination: WEBSITE
25     }
26     policy {
27       cookies_allowed: NO
28       setting:
29         "This isn't a real network request. A proxy can be selected in "
30         "settings."
31       policy_exception_justification:
32         "Using 'ProxySettings' policy can set Chrome to use specific proxy "
33         "settings and avoid directly connecting to the websites."
34     })");
35 
36 }  // namespace
37 
ProxyConfigWithAnnotation()38 ProxyConfigWithAnnotation::ProxyConfigWithAnnotation()
39     : value_(ProxyConfig::CreateDirect()),
40       traffic_annotation_(
41           MutableNetworkTrafficAnnotationTag(kDirectProxyTrafficAnnotation)) {}
42 
43 ProxyConfigWithAnnotation::ProxyConfigWithAnnotation(
44     const ProxyConfig& proxy_config,
45     const NetworkTrafficAnnotationTag& traffic_annotation)
46     : value_(proxy_config),
47       traffic_annotation_(
48           MutableNetworkTrafficAnnotationTag(traffic_annotation)) {}
49 
50 }  // namespace net
51