summaryrefslogtreecommitdiff
path: root/chromium/net/dns/public/resolve_error_info.h
blob: 7f466421c4dbd39b3521806d0cffe30ebc4958b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_DNS_PUBLIC_RESOLVE_ERROR_INFO_H_
#define NET_DNS_PUBLIC_RESOLVE_ERROR_INFO_H_

#include "net/base/net_errors.h"
#include "net/base/net_export.h"

namespace net {

// Host resolution error info.
struct NET_EXPORT ResolveErrorInfo {
  ResolveErrorInfo();
  explicit ResolveErrorInfo(int resolve_error,
                            bool is_secure_network_error = false);
  ResolveErrorInfo(const ResolveErrorInfo& resolve_error_info);
  ResolveErrorInfo(ResolveErrorInfo&& other);

  ResolveErrorInfo& operator=(const ResolveErrorInfo& other);
  ResolveErrorInfo& operator=(ResolveErrorInfo&& other);

  bool operator==(const ResolveErrorInfo& other) const;
  bool operator!=(const ResolveErrorInfo& other) const;

  int error = net::OK;
  // Whether |error| resulted from a DNS-over-HTTPS lookup. If an answer was
  // obtained from the cache this field will be false, regardless of whether the
  // answer was originally obtained securely, because this field is intended to
  // identify secure DNS *network* failures. This field will also always be
  // false if |error| is net::OK.
  bool is_secure_network_error = false;
};

}  // namespace net

#endif  // NET_DNS_PUBLIC_RESOLVE_ERROR_INFO_H_