Upload upstream chromium 108.0.5359.1
[platform/framework/web/chromium-efl.git] / services / proxy_resolver / proxy_host_resolver.h
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 SERVICES_PROXY_RESOLVER_PROXY_HOST_RESOLVER_H_
6 #define SERVICES_PROXY_RESOLVER_PROXY_HOST_RESOLVER_H_
7
8 #include <memory>
9 #include <string>
10 #include <vector>
11
12 #include "net/base/completion_once_callback.h"
13 #include "net/base/ip_address.h"
14 #include "net/proxy_resolution/proxy_resolve_dns_operation.h"
15
16 namespace net {
17 class NetworkAnonymizationKey;
18 }  // namespace net
19
20 namespace proxy_resolver {
21
22 // Interface for a limited (compared to the standard HostResolver) host resolver
23 // used just for proxy resolution.
24 class ProxyHostResolver {
25  public:
26   virtual ~ProxyHostResolver() {}
27
28   class Request {
29    public:
30     virtual ~Request() {}
31     virtual int Start(net::CompletionOnceCallback callback) = 0;
32     virtual const std::vector<net::IPAddress>& GetResults() const = 0;
33   };
34
35   virtual std::unique_ptr<Request> CreateRequest(
36       const std::string& hostname,
37       net::ProxyResolveDnsOperation operation,
38       const net::NetworkAnonymizationKey& network_aonymization_key) = 0;
39 };
40
41 }  // namespace proxy_resolver
42
43 #endif  // SERVICES_PROXY_RESOLVER_PROXY_HOST_RESOLVER_H_