Zach Stein | e20867f | 2018-08-02 20:20:15 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 The WebRTC Project Authors. All rights reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 11 | #ifndef P2P_BASE_BASIC_ASYNC_RESOLVER_FACTORY_H_ |
| 12 | #define P2P_BASE_BASIC_ASYNC_RESOLVER_FACTORY_H_ |
Zach Stein | e20867f | 2018-08-02 20:20:15 | [diff] [blame] | 13 | |
Harald Alvestrand | e6e2f28 | 2021-03-24 12:13:28 | [diff] [blame] | 14 | #include <functional> |
| 15 | #include <memory> |
| 16 | #include <utility> |
| 17 | |
| 18 | #include "api/async_dns_resolver.h" |
Zach Stein | e20867f | 2018-08-02 20:20:15 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | |
Harald Alvestrand | b8617d1 | 2023-08-23 09:01:53 | [diff] [blame] | 22 | // A factory that vends AsyncDnsResolver instances. |
| 23 | class BasicAsyncDnsResolverFactory final |
| 24 | : public AsyncDnsResolverFactoryInterface { |
| 25 | public: |
| 26 | BasicAsyncDnsResolverFactory() = default; |
| 27 | |
| 28 | std::unique_ptr<webrtc::AsyncDnsResolverInterface> CreateAndResolve( |
| 29 | const rtc::SocketAddress& addr, |
Harald Alvestrand | 96e1882 | 2023-08-30 19:39:05 | [diff] [blame] | 30 | absl::AnyInvocable<void()> callback) override; |
Harald Alvestrand | b8617d1 | 2023-08-23 09:01:53 | [diff] [blame] | 31 | |
| 32 | std::unique_ptr<webrtc::AsyncDnsResolverInterface> CreateAndResolve( |
| 33 | const rtc::SocketAddress& addr, |
| 34 | int family, |
Harald Alvestrand | 96e1882 | 2023-08-30 19:39:05 | [diff] [blame] | 35 | absl::AnyInvocable<void()> callback) override; |
Harald Alvestrand | b8617d1 | 2023-08-23 09:01:53 | [diff] [blame] | 36 | |
| 37 | std::unique_ptr<webrtc::AsyncDnsResolverInterface> Create() override; |
| 38 | }; |
| 39 | |
Zach Stein | e20867f | 2018-08-02 20:20:15 | [diff] [blame] | 40 | } // namespace webrtc |
| 41 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 42 | #endif // P2P_BASE_BASIC_ASYNC_RESOLVER_FACTORY_H_ |