xref: /aosp_15_r20/external/cronet/net/dns/public/resolve_error_info.cc (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 #include "net/dns/public/resolve_error_info.h"
6 
7 namespace net {
8 
9 ResolveErrorInfo::ResolveErrorInfo() = default;
10 
ResolveErrorInfo(int resolve_error,bool is_secure_network_error)11 ResolveErrorInfo::ResolveErrorInfo(int resolve_error,
12                                    bool is_secure_network_error)
13     : error(resolve_error), is_secure_network_error(is_secure_network_error) {
14   DCHECK(!(is_secure_network_error && resolve_error == net::OK));
15 }
16 
17 ResolveErrorInfo::ResolveErrorInfo(const ResolveErrorInfo& resolve_error_info) =
18     default;
19 
20 ResolveErrorInfo::ResolveErrorInfo(ResolveErrorInfo&& other) = default;
21 
22 ResolveErrorInfo& ResolveErrorInfo::operator=(const ResolveErrorInfo& other) =
23     default;
24 
25 ResolveErrorInfo& ResolveErrorInfo::operator=(ResolveErrorInfo&& other) =
26     default;
27 
operator ==(const ResolveErrorInfo & other) const28 bool ResolveErrorInfo::operator==(const ResolveErrorInfo& other) const {
29   return error == other.error &&
30          is_secure_network_error == other.is_secure_network_error;
31 }
32 
operator !=(const ResolveErrorInfo & other) const33 bool ResolveErrorInfo::operator!=(const ResolveErrorInfo& other) const {
34   return !(*this == other);
35 }
36 
37 }  // namespace net
38