xref: /aosp_15_r20/external/cronet/net/proxy_resolution/proxy_retry_info.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2006-2008 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_PROXY_RESOLUTION_PROXY_RETRY_INFO_H_
6 #define NET_PROXY_RESOLUTION_PROXY_RETRY_INFO_H_
7 
8 #include <map>
9 
10 #include "base/time/time.h"
11 #include "net/base/proxy_chain.h"
12 
13 namespace net {
14 
15 // Contains the information about when to retry a particular proxy chain.
16 struct ProxyRetryInfo {
17   ProxyRetryInfo() = default;
18 
19   // We should not retry until this time.
20   base::TimeTicks bad_until;
21 
22   // This is the current delay. If the proxy chain is still bad, we need to
23   // increase this delay.
24   base::TimeDelta current_delay;
25 
26   // True if this proxy chain should be considered even if still bad.
27   bool try_while_bad = true;
28 
29   // The network error received when this proxy failed, or |OK| if the proxy
30   // was added to the retry list for a non-network related reason. (e.g. local
31   // policy).
32   int net_error = 0;
33 };
34 
35 // Map of previously failed ProxyChains to the associated RetryInfo structures.
36 typedef std::map<ProxyChain, ProxyRetryInfo> ProxyRetryInfoMap;
37 
38 }  // namespace net
39 
40 #endif  // NET_PROXY_RESOLUTION_PROXY_RETRY_INFO_H_
41