proxy_config_with_annotation.cc 1.7 KB

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