2018-08-02 13:20:15 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright 2018 The WebRTC Project Authors. All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-01-11 09:11:00 -08:00
|
|
|
#ifndef P2P_BASE_BASIC_ASYNC_RESOLVER_FACTORY_H_
|
|
|
|
|
#define P2P_BASE_BASIC_ASYNC_RESOLVER_FACTORY_H_
|
2018-08-02 13:20:15 -07:00
|
|
|
|
2021-03-24 12:13:28 +00:00
|
|
|
#include <functional>
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
|
|
#include "api/async_dns_resolver.h"
|
2018-08-02 13:20:15 -07:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
2023-08-23 09:01:53 +00:00
|
|
|
// A factory that vends AsyncDnsResolver instances.
|
|
|
|
|
class BasicAsyncDnsResolverFactory final
|
|
|
|
|
: public AsyncDnsResolverFactoryInterface {
|
|
|
|
|
public:
|
|
|
|
|
BasicAsyncDnsResolverFactory() = default;
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<webrtc::AsyncDnsResolverInterface> CreateAndResolve(
|
|
|
|
|
const rtc::SocketAddress& addr,
|
2023-08-30 19:39:05 +00:00
|
|
|
absl::AnyInvocable<void()> callback) override;
|
2023-08-23 09:01:53 +00:00
|
|
|
|
|
|
|
|
std::unique_ptr<webrtc::AsyncDnsResolverInterface> CreateAndResolve(
|
|
|
|
|
const rtc::SocketAddress& addr,
|
|
|
|
|
int family,
|
2023-08-30 19:39:05 +00:00
|
|
|
absl::AnyInvocable<void()> callback) override;
|
2023-08-23 09:01:53 +00:00
|
|
|
|
|
|
|
|
std::unique_ptr<webrtc::AsyncDnsResolverInterface> Create() override;
|
|
|
|
|
};
|
|
|
|
|
|
2018-08-02 13:20:15 -07:00
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2019-01-11 09:11:00 -08:00
|
|
|
#endif // P2P_BASE_BASIC_ASYNC_RESOLVER_FACTORY_H_
|