xref: /aosp_15_r20/external/cronet/net/proxy_resolution/proxy_chain_util_apple.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2023 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_CHAIN_UTIL_APPLE_H_
6 #define NET_PROXY_RESOLUTION_PROXY_CHAIN_UTIL_APPLE_H_
7 
8 #include <CoreFoundation/CoreFoundation.h>
9 
10 #include "net/base/proxy_chain.h"
11 
12 namespace net {
13 
14 // Utility function to pull out a host/port pair from a dictionary and return
15 // it as a ProxyChain object. Pass in a dictionary that has a value for the
16 // host key, a proxy_type, and optionally a value for the port key. In the error
17 // condition where the host value is especially malformed, returns an invalid
18 // ProxyChain.
19 NET_EXPORT ProxyChain ProxyDictionaryToProxyChain(CFStringRef proxy_type,
20                                                   CFDictionaryRef dict,
21                                                   CFStringRef host_key,
22                                                   CFStringRef port_key);
23 
24 }  // namespace net
25 
26 #endif  // NET_PROXY_RESOLUTION_PROXY_CHAIN_UTIL_APPLE_H_
27