xref: /aosp_15_r20/external/cronet/net/dns/public/resolve_error_info.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2019 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_RESOLVE_ERROR_INFO_H_
6 #define NET_DNS_PUBLIC_RESOLVE_ERROR_INFO_H_
7 
8 #include "net/base/net_errors.h"
9 #include "net/base/net_export.h"
10 
11 namespace net {
12 
13 // Host resolution error info.
14 struct NET_EXPORT ResolveErrorInfo {
15   ResolveErrorInfo();
16   explicit ResolveErrorInfo(int resolve_error,
17                             bool is_secure_network_error = false);
18   ResolveErrorInfo(const ResolveErrorInfo& resolve_error_info);
19   ResolveErrorInfo(ResolveErrorInfo&& other);
20 
21   ResolveErrorInfo& operator=(const ResolveErrorInfo& other);
22   ResolveErrorInfo& operator=(ResolveErrorInfo&& other);
23 
24   bool operator==(const ResolveErrorInfo& other) const;
25   bool operator!=(const ResolveErrorInfo& other) const;
26 
27   int error = net::OK;
28   // Whether |error| resulted from a DNS-over-HTTPS lookup. If an answer was
29   // obtained from the cache this field will be false, regardless of whether the
30   // answer was originally obtained securely, because this field is intended to
31   // identify secure DNS *network* failures. This field will also always be
32   // false if |error| is net::OK.
33   bool is_secure_network_error = false;
34 };
35 
36 }  // namespace net
37 
38 #endif  // NET_DNS_PUBLIC_RESOLVE_ERROR_INFO_H_
39