blob: f99fb3e6b508d30ee4c5980e3a226f18472fcb7c [file] [log] [blame]
Zach Steine20867f2018-08-02 20:20:151/*
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 Anton10542f22019-01-11 17:11:0011#ifndef P2P_BASE_BASIC_ASYNC_RESOLVER_FACTORY_H_
12#define P2P_BASE_BASIC_ASYNC_RESOLVER_FACTORY_H_
Zach Steine20867f2018-08-02 20:20:1513
Harald Alvestrande6e2f282021-03-24 12:13:2814#include <functional>
15#include <memory>
16#include <utility>
17
18#include "api/async_dns_resolver.h"
Zach Steine20867f2018-08-02 20:20:1519
20namespace webrtc {
21
Harald Alvestrandb8617d12023-08-23 09:01:5322// A factory that vends AsyncDnsResolver instances.
23class BasicAsyncDnsResolverFactory final
24 : public AsyncDnsResolverFactoryInterface {
25 public:
26 BasicAsyncDnsResolverFactory() = default;
27
28 std::unique_ptr<webrtc::AsyncDnsResolverInterface> CreateAndResolve(
29 const rtc::SocketAddress& addr,
Harald Alvestrand96e18822023-08-30 19:39:0530 absl::AnyInvocable<void()> callback) override;
Harald Alvestrandb8617d12023-08-23 09:01:5331
32 std::unique_ptr<webrtc::AsyncDnsResolverInterface> CreateAndResolve(
33 const rtc::SocketAddress& addr,
34 int family,
Harald Alvestrand96e18822023-08-30 19:39:0535 absl::AnyInvocable<void()> callback) override;
Harald Alvestrandb8617d12023-08-23 09:01:5336
37 std::unique_ptr<webrtc::AsyncDnsResolverInterface> Create() override;
38};
39
Zach Steine20867f2018-08-02 20:20:1540} // namespace webrtc
41
Steve Anton10542f22019-01-11 17:11:0042#endif // P2P_BASE_BASIC_ASYNC_RESOLVER_FACTORY_H_