#include "chrome/browser/media/router/discovery/access_code/access_code_media_sink_util.h"
#include <map>
#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "components/media_router/common/discovery/media_sink_internal.h"
#include "components/media_router/common/mojom/media_router.mojom.h"
#include "components/media_router/common/providers/cast/channel/cast_device_capability.h"
#include "net/base/host_port_pair.h"
#include "net/base/ip_address.h"
#include "net/base/port_util.h"
#include "net/base/url_util.h"
namespace media_router {
namespace {
CastDeviceCapability;
CastDeviceCapabilitySet;
constexpr char kSinkDictKey[] = …;
constexpr char kSinkIdKey[] = …;
constexpr char kDisplayNameKey[] = …;
constexpr char kExtraDataDictKey[] = …;
constexpr char kCapabilitiesKey[] = …;
constexpr char kPortKey[] = …;
constexpr char kIpAddressKey[] = …;
constexpr char kModelName[] = …;
constexpr char kDefaultAccessCodeModelName[] = …;
CastDeviceCapabilitySet ConvertDeviceCapabilities(
chrome_browser_media::proto::DeviceCapabilities proto) { … }
std::optional<net::IPAddress> GetIPAddress(NetworkInfo network_info) { … }
}
std::pair<std::optional<MediaSinkInternal>, CreateCastMediaSinkResult>
CreateAccessCodeMediaSink(const DiscoveryDevice& discovery_device) { … }
base::Value::Dict CreateValueDictFromMediaSinkInternal(
const MediaSinkInternal& sink) { … }
std::optional<MediaSinkInternal> ParseValueDictIntoMediaSinkInternal(
const base::Value::Dict& value_dict) { … }
AccessCodeCastAddSinkResult AddSinkResultMetricsHelper(
AddSinkResultCode value) { … }
std::optional<net::IPEndPoint> GetIPEndPointFromValueDict(
const base::Value::Dict& value_dict) { … }
}