mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-17 15:47:53 +01:00
Fix clang style warnings in p2p/base/{session,transport}description
Bug: webrtc:163 Change-Id: Id876608c1a20bde49f0f7d1eda1b38dcb647bf3f Reviewed-on: https://webrtc-review.googlesource.com/17004 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Steve Anton <steveanton@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20507}
This commit is contained in:
parent
ee674431fb
commit
d3ea9996ed
6 changed files with 109 additions and 60 deletions
|
@ -45,6 +45,15 @@ const ContentInfo* FindContentInfoByType(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
ContentGroup::ContentGroup(const std::string& semantics)
|
||||
: semantics_(semantics) {}
|
||||
|
||||
ContentGroup::ContentGroup(const ContentGroup&) = default;
|
||||
ContentGroup::ContentGroup(ContentGroup&&) = default;
|
||||
ContentGroup& ContentGroup::operator=(const ContentGroup&) = default;
|
||||
ContentGroup& ContentGroup::operator=(ContentGroup&&) = default;
|
||||
ContentGroup::~ContentGroup() = default;
|
||||
|
||||
const std::string* ContentGroup::FirstContentName() const {
|
||||
return (!content_names_.empty()) ? &(*content_names_.begin()) : NULL;
|
||||
}
|
||||
|
@ -70,6 +79,31 @@ bool ContentGroup::RemoveContentName(const std::string& content_name) {
|
|||
return true;
|
||||
}
|
||||
|
||||
SessionDescription::SessionDescription() = default;
|
||||
|
||||
SessionDescription::SessionDescription(const ContentInfos& contents)
|
||||
: contents_(contents) {}
|
||||
|
||||
SessionDescription::SessionDescription(const ContentInfos& contents,
|
||||
const ContentGroups& groups)
|
||||
: contents_(contents), content_groups_(groups) {}
|
||||
|
||||
SessionDescription::SessionDescription(const ContentInfos& contents,
|
||||
const TransportInfos& transports,
|
||||
const ContentGroups& groups)
|
||||
: contents_(contents),
|
||||
transport_infos_(transports),
|
||||
content_groups_(groups) {}
|
||||
|
||||
SessionDescription::SessionDescription(const SessionDescription&) = default;
|
||||
|
||||
SessionDescription::~SessionDescription() {
|
||||
for (ContentInfos::iterator content = contents_.begin();
|
||||
content != contents_.end(); ++content) {
|
||||
delete content->description;
|
||||
}
|
||||
}
|
||||
|
||||
SessionDescription* SessionDescription::Copy() const {
|
||||
SessionDescription* copy = new SessionDescription(*this);
|
||||
// Copy all ContentDescriptions.
|
||||
|
|
|
@ -67,8 +67,12 @@ typedef std::vector<std::string> ContentNames;
|
|||
// MediaDescription.
|
||||
class ContentGroup {
|
||||
public:
|
||||
explicit ContentGroup(const std::string& semantics) :
|
||||
semantics_(semantics) {}
|
||||
explicit ContentGroup(const std::string& semantics);
|
||||
ContentGroup(const ContentGroup&);
|
||||
ContentGroup(ContentGroup&&);
|
||||
ContentGroup& operator=(const ContentGroup&);
|
||||
ContentGroup& operator=(ContentGroup&&);
|
||||
~ContentGroup();
|
||||
|
||||
const std::string& semantics() const { return semantics_; }
|
||||
const ContentNames& content_names() const { return content_names_; }
|
||||
|
@ -96,25 +100,13 @@ const ContentInfo* FindContentInfoByType(
|
|||
// contents are unique be name, but doesn't enforce that.
|
||||
class SessionDescription {
|
||||
public:
|
||||
SessionDescription() {}
|
||||
explicit SessionDescription(const ContentInfos& contents) :
|
||||
contents_(contents) {}
|
||||
SessionDescription(const ContentInfos& contents,
|
||||
const ContentGroups& groups) :
|
||||
contents_(contents),
|
||||
content_groups_(groups) {}
|
||||
SessionDescription();
|
||||
explicit SessionDescription(const ContentInfos& contents);
|
||||
SessionDescription(const ContentInfos& contents, const ContentGroups& groups);
|
||||
SessionDescription(const ContentInfos& contents,
|
||||
const TransportInfos& transports,
|
||||
const ContentGroups& groups) :
|
||||
contents_(contents),
|
||||
transport_infos_(transports),
|
||||
content_groups_(groups) {}
|
||||
~SessionDescription() {
|
||||
for (ContentInfos::iterator content = contents_.begin();
|
||||
content != contents_.end(); ++content) {
|
||||
delete content->description;
|
||||
}
|
||||
}
|
||||
const ContentGroups& groups);
|
||||
~SessionDescription();
|
||||
|
||||
SessionDescription* Copy() const;
|
||||
|
||||
|
@ -181,6 +173,8 @@ class SessionDescription {
|
|||
bool msid_supported() const { return msid_supported_; }
|
||||
|
||||
private:
|
||||
SessionDescription(const SessionDescription&);
|
||||
|
||||
ContentInfos contents_;
|
||||
TransportInfos transport_infos_;
|
||||
ContentGroups content_groups_;
|
||||
|
|
|
@ -53,4 +53,54 @@ bool ConnectionRoleToString(const ConnectionRole& role, std::string* role_str) {
|
|||
return true;
|
||||
}
|
||||
|
||||
TransportDescription::TransportDescription()
|
||||
: ice_mode(ICEMODE_FULL), connection_role(CONNECTIONROLE_NONE) {}
|
||||
|
||||
TransportDescription::TransportDescription(
|
||||
const std::vector<std::string>& transport_options,
|
||||
const std::string& ice_ufrag,
|
||||
const std::string& ice_pwd,
|
||||
IceMode ice_mode,
|
||||
ConnectionRole role,
|
||||
const rtc::SSLFingerprint* identity_fingerprint)
|
||||
: transport_options(transport_options),
|
||||
ice_ufrag(ice_ufrag),
|
||||
ice_pwd(ice_pwd),
|
||||
ice_mode(ice_mode),
|
||||
connection_role(role),
|
||||
identity_fingerprint(CopyFingerprint(identity_fingerprint)) {}
|
||||
|
||||
TransportDescription::TransportDescription(const std::string& ice_ufrag,
|
||||
const std::string& ice_pwd)
|
||||
: ice_ufrag(ice_ufrag),
|
||||
ice_pwd(ice_pwd),
|
||||
ice_mode(ICEMODE_FULL),
|
||||
connection_role(CONNECTIONROLE_NONE) {}
|
||||
|
||||
TransportDescription::TransportDescription(const TransportDescription& from)
|
||||
: transport_options(from.transport_options),
|
||||
ice_ufrag(from.ice_ufrag),
|
||||
ice_pwd(from.ice_pwd),
|
||||
ice_mode(from.ice_mode),
|
||||
connection_role(from.connection_role),
|
||||
identity_fingerprint(CopyFingerprint(from.identity_fingerprint.get())) {}
|
||||
|
||||
TransportDescription::~TransportDescription() = default;
|
||||
|
||||
TransportDescription& TransportDescription::operator=(
|
||||
const TransportDescription& from) {
|
||||
// Self-assignment
|
||||
if (this == &from)
|
||||
return *this;
|
||||
|
||||
transport_options = from.transport_options;
|
||||
ice_ufrag = from.ice_ufrag;
|
||||
ice_pwd = from.ice_pwd;
|
||||
ice_mode = from.ice_mode;
|
||||
connection_role = from.connection_role;
|
||||
|
||||
identity_fingerprint.reset(CopyFingerprint(from.identity_fingerprint.get()));
|
||||
return *this;
|
||||
}
|
||||
|
||||
} // namespace cricket
|
||||
|
|
|
@ -87,59 +87,26 @@ extern const char CONNECTIONROLE_PASSIVE_STR[];
|
|||
extern const char CONNECTIONROLE_ACTPASS_STR[];
|
||||
extern const char CONNECTIONROLE_HOLDCONN_STR[];
|
||||
|
||||
constexpr auto ICE_OPTION_TRICKLE = "trickle";
|
||||
constexpr auto ICE_OPTION_RENOMINATION = "renomination";
|
||||
constexpr auto* ICE_OPTION_TRICKLE = "trickle";
|
||||
constexpr auto* ICE_OPTION_RENOMINATION = "renomination";
|
||||
|
||||
bool StringToConnectionRole(const std::string& role_str, ConnectionRole* role);
|
||||
bool ConnectionRoleToString(const ConnectionRole& role, std::string* role_str);
|
||||
|
||||
struct TransportDescription {
|
||||
TransportDescription()
|
||||
: ice_mode(ICEMODE_FULL),
|
||||
connection_role(CONNECTIONROLE_NONE) {}
|
||||
|
||||
TransportDescription();
|
||||
TransportDescription(const std::vector<std::string>& transport_options,
|
||||
const std::string& ice_ufrag,
|
||||
const std::string& ice_pwd,
|
||||
IceMode ice_mode,
|
||||
ConnectionRole role,
|
||||
const rtc::SSLFingerprint* identity_fingerprint)
|
||||
: transport_options(transport_options),
|
||||
ice_ufrag(ice_ufrag),
|
||||
ice_pwd(ice_pwd),
|
||||
ice_mode(ice_mode),
|
||||
connection_role(role),
|
||||
identity_fingerprint(CopyFingerprint(identity_fingerprint)) {}
|
||||
const rtc::SSLFingerprint* identity_fingerprint);
|
||||
TransportDescription(const std::string& ice_ufrag,
|
||||
const std::string& ice_pwd)
|
||||
: ice_ufrag(ice_ufrag),
|
||||
ice_pwd(ice_pwd),
|
||||
ice_mode(ICEMODE_FULL),
|
||||
connection_role(CONNECTIONROLE_NONE) {}
|
||||
TransportDescription(const TransportDescription& from)
|
||||
: transport_options(from.transport_options),
|
||||
ice_ufrag(from.ice_ufrag),
|
||||
ice_pwd(from.ice_pwd),
|
||||
ice_mode(from.ice_mode),
|
||||
connection_role(from.connection_role),
|
||||
identity_fingerprint(CopyFingerprint(from.identity_fingerprint.get())) {
|
||||
}
|
||||
const std::string& ice_pwd);
|
||||
TransportDescription(const TransportDescription& from);
|
||||
~TransportDescription();
|
||||
|
||||
TransportDescription& operator=(const TransportDescription& from) {
|
||||
// Self-assignment
|
||||
if (this == &from)
|
||||
return *this;
|
||||
|
||||
transport_options = from.transport_options;
|
||||
ice_ufrag = from.ice_ufrag;
|
||||
ice_pwd = from.ice_pwd;
|
||||
ice_mode = from.ice_mode;
|
||||
connection_role = from.connection_role;
|
||||
|
||||
identity_fingerprint.reset(CopyFingerprint(
|
||||
from.identity_fingerprint.get()));
|
||||
return *this;
|
||||
}
|
||||
TransportDescription& operator=(const TransportDescription& from);
|
||||
|
||||
// TODO(deadbeef): Rename to HasIceOption, etc.
|
||||
bool HasOption(const std::string& option) const {
|
||||
|
|
|
@ -24,6 +24,8 @@ TransportDescriptionFactory::TransportDescriptionFactory()
|
|||
: secure_(SEC_DISABLED) {
|
||||
}
|
||||
|
||||
TransportDescriptionFactory::~TransportDescriptionFactory() = default;
|
||||
|
||||
TransportDescription* TransportDescriptionFactory::CreateOffer(
|
||||
const TransportOptions& options,
|
||||
const TransportDescription* current_description) const {
|
||||
|
|
|
@ -35,6 +35,8 @@ class TransportDescriptionFactory {
|
|||
public:
|
||||
// Default ctor; use methods below to set configuration.
|
||||
TransportDescriptionFactory();
|
||||
~TransportDescriptionFactory();
|
||||
|
||||
SecurePolicy secure() const { return secure_; }
|
||||
// The certificate to use when setting up DTLS.
|
||||
const rtc::scoped_refptr<rtc::RTCCertificate>& certificate() const {
|
||||
|
|
Loading…
Reference in a new issue