Adopt absl::string_view in some fakes under rtc_base/
Bug: webrtc:13579 Change-Id: I52462a0edb4fb309cea3bc27f60dc81c5ea50522 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260464 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Ali Tofigh <alito@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36710}
This commit is contained in:
parent
daee870a35
commit
d3890781be
@ -15,6 +15,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "rtc_base/ip_address.h"
|
||||
#include "rtc_base/location.h"
|
||||
#include "rtc_base/mdns_responder_interface.h"
|
||||
@ -53,7 +54,7 @@ class FakeMdnsResponder : public MdnsResponderInterface {
|
||||
thread_->PostTask(ToQueuedTask([callback, result]() { callback(result); }));
|
||||
}
|
||||
|
||||
rtc::IPAddress GetMappedAddressForName(const std::string& name) const {
|
||||
rtc::IPAddress GetMappedAddressForName(absl::string_view name) const {
|
||||
for (const auto& addr_name_pair : addr_name_map_) {
|
||||
if (addr_name_pair.second == name) {
|
||||
return addr_name_pair.first;
|
||||
|
||||
@ -48,13 +48,13 @@ class FakeNetworkManager : public NetworkManagerBase,
|
||||
AddInterface(iface, "test" + rtc::ToString(next_index_++));
|
||||
}
|
||||
|
||||
void AddInterface(const SocketAddress& iface, const std::string& if_name) {
|
||||
void AddInterface(const SocketAddress& iface, absl::string_view if_name) {
|
||||
AddInterface(iface, if_name, ADAPTER_TYPE_UNKNOWN);
|
||||
}
|
||||
|
||||
void AddInterface(
|
||||
const SocketAddress& iface,
|
||||
const std::string& if_name,
|
||||
absl::string_view if_name,
|
||||
AdapterType type,
|
||||
absl::optional<AdapterType> underlying_vpn_adapter_type = absl::nullopt) {
|
||||
SocketAddress address(if_name, 0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user