1 // Copyright 2020 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 #ifndef NET_DNS_PUBLIC_SECURE_DNS_MODE_H_ 6 #define NET_DNS_PUBLIC_SECURE_DNS_MODE_H_ 7 8 #include "base/containers/fixed_flat_map.h" 9 #include "base/strings/string_piece.h" 10 11 namespace net { 12 13 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net 14 // The SecureDnsMode specifies what types of lookups (secure/insecure) should 15 // be performed and in what order when resolving a specific query. The int 16 // values should not be changed as they are logged. 17 enum class SecureDnsMode : int { 18 // In OFF mode, no DoH lookups should be performed. 19 kOff = 0, 20 // In AUTOMATIC mode, DoH lookups should be performed first if DoH is 21 // available, and insecure DNS lookups should be performed as a fallback. 22 kAutomatic = 1, 23 // In SECURE mode, only DoH lookups should be performed. 24 kSecure = 2, 25 }; 26 27 inline constexpr auto kSecureDnsModes = 28 base::MakeFixedFlatMap<SecureDnsMode, base::StringPiece>( 29 {{SecureDnsMode::kOff, "Off"}, 30 {SecureDnsMode::kAutomatic, "Automatic"}, 31 {SecureDnsMode::kSecure, "Secure"}}); 32 33 } // namespace net 34 35 #endif // NET_DNS_PUBLIC_SECURE_DNS_MODE_H_ 36