Enable clang::find_bad_constructs for sdk/android (part 1/2).
This CL removes //build/config/clang:find_bad_constructs from the suppressed_configs list, which means that clang:find_bad_constructs is now enabled on these translation units. Bug: webrtc:9251, webrtc:163, webrtc:9544 Change-Id: I7c211c4ac6b2e095e4c6594fce09fdb487bb1d9e Reviewed-on: https://webrtc-review.googlesource.com/89600 Reviewed-by: Steve Anton <steveanton@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24056}
This commit is contained in:

committed by
Commit Bot

parent
97ddbd7eba
commit
2ffed6d65c
@ -57,6 +57,7 @@ rtc_static_library("libjingle_peerconnection_api") {
|
||||
"dtmfsenderinterface.h",
|
||||
"jsep.cc",
|
||||
"jsep.h",
|
||||
"jsepicecandidate.cc",
|
||||
"jsepicecandidate.h",
|
||||
"jsepsessiondescription.h",
|
||||
"mediaconstraintsinterface.cc",
|
||||
|
83
api/jsepicecandidate.cc
Normal file
83
api/jsepicecandidate.cc
Normal file
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "api/jsepicecandidate.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
std::string JsepIceCandidate::sdp_mid() const {
|
||||
return sdp_mid_;
|
||||
}
|
||||
|
||||
int JsepIceCandidate::sdp_mline_index() const {
|
||||
return sdp_mline_index_;
|
||||
}
|
||||
|
||||
const cricket::Candidate& JsepIceCandidate::candidate() const {
|
||||
return candidate_;
|
||||
}
|
||||
|
||||
std::string JsepIceCandidate::server_url() const {
|
||||
return candidate_.url();
|
||||
}
|
||||
|
||||
JsepCandidateCollection::JsepCandidateCollection() = default;
|
||||
|
||||
JsepCandidateCollection::JsepCandidateCollection(JsepCandidateCollection&& o)
|
||||
: candidates_(std::move(o.candidates_)) {}
|
||||
|
||||
size_t JsepCandidateCollection::count() const {
|
||||
return candidates_.size();
|
||||
}
|
||||
|
||||
void JsepCandidateCollection::add(JsepIceCandidate* candidate) {
|
||||
candidates_.push_back(candidate);
|
||||
}
|
||||
|
||||
const IceCandidateInterface* JsepCandidateCollection::at(size_t index) const {
|
||||
return candidates_[index];
|
||||
}
|
||||
|
||||
JsepCandidateCollection::~JsepCandidateCollection() {
|
||||
for (std::vector<JsepIceCandidate*>::iterator it = candidates_.begin();
|
||||
it != candidates_.end(); ++it) {
|
||||
delete *it;
|
||||
}
|
||||
}
|
||||
|
||||
bool JsepCandidateCollection::HasCandidate(
|
||||
const IceCandidateInterface* candidate) const {
|
||||
bool ret = false;
|
||||
for (std::vector<JsepIceCandidate*>::const_iterator it = candidates_.begin();
|
||||
it != candidates_.end(); ++it) {
|
||||
if ((*it)->sdp_mid() == candidate->sdp_mid() &&
|
||||
(*it)->sdp_mline_index() == candidate->sdp_mline_index() &&
|
||||
(*it)->candidate().IsEquivalent(candidate->candidate())) {
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
size_t JsepCandidateCollection::remove(const cricket::Candidate& candidate) {
|
||||
auto iter = std::find_if(candidates_.begin(), candidates_.end(),
|
||||
[candidate](JsepIceCandidate* c) {
|
||||
return candidate.MatchesForRemoval(c->candidate());
|
||||
});
|
||||
if (iter != candidates_.end()) {
|
||||
delete *iter;
|
||||
candidates_.erase(iter);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
@ -31,20 +31,20 @@ class JsepIceCandidate : public IceCandidateInterface {
|
||||
JsepIceCandidate(const std::string& sdp_mid,
|
||||
int sdp_mline_index,
|
||||
const cricket::Candidate& candidate);
|
||||
~JsepIceCandidate();
|
||||
~JsepIceCandidate() override;
|
||||
// |err| may be null.
|
||||
bool Initialize(const std::string& sdp, SdpParseError* err);
|
||||
void SetCandidate(const cricket::Candidate& candidate) {
|
||||
candidate_ = candidate;
|
||||
}
|
||||
|
||||
virtual std::string sdp_mid() const { return sdp_mid_; }
|
||||
virtual int sdp_mline_index() const { return sdp_mline_index_; }
|
||||
virtual const cricket::Candidate& candidate() const { return candidate_; }
|
||||
std::string sdp_mid() const override;
|
||||
int sdp_mline_index() const override;
|
||||
const cricket::Candidate& candidate() const override;
|
||||
|
||||
virtual std::string server_url() const { return candidate_.url(); }
|
||||
std::string server_url() const override;
|
||||
|
||||
virtual bool ToString(std::string* out) const;
|
||||
bool ToString(std::string* out) const override;
|
||||
|
||||
private:
|
||||
std::string sdp_mid_;
|
||||
@ -57,23 +57,18 @@ class JsepIceCandidate : public IceCandidateInterface {
|
||||
// Implementation of IceCandidateCollection which stores JsepIceCandidates.
|
||||
class JsepCandidateCollection : public IceCandidateCollection {
|
||||
public:
|
||||
JsepCandidateCollection() {}
|
||||
JsepCandidateCollection();
|
||||
// Move constructor is defined so that a vector of JsepCandidateCollections
|
||||
// can be resized.
|
||||
JsepCandidateCollection(JsepCandidateCollection&& o)
|
||||
: candidates_(std::move(o.candidates_)) {}
|
||||
~JsepCandidateCollection();
|
||||
virtual size_t count() const { return candidates_.size(); }
|
||||
virtual bool HasCandidate(const IceCandidateInterface* candidate) const;
|
||||
JsepCandidateCollection(JsepCandidateCollection&& o);
|
||||
~JsepCandidateCollection() override;
|
||||
size_t count() const override;
|
||||
bool HasCandidate(const IceCandidateInterface* candidate) const override;
|
||||
// Adds and takes ownership of the JsepIceCandidate.
|
||||
// TODO(deadbeef): Make this use an std::unique_ptr<>, so ownership logic is
|
||||
// more clear.
|
||||
virtual void add(JsepIceCandidate* candidate) {
|
||||
candidates_.push_back(candidate);
|
||||
}
|
||||
virtual const IceCandidateInterface* at(size_t index) const {
|
||||
return candidates_[index];
|
||||
}
|
||||
virtual void add(JsepIceCandidate* candidate);
|
||||
const IceCandidateInterface* at(size_t index) const override;
|
||||
// Removes the candidate that has a matching address and protocol.
|
||||
//
|
||||
// Returns the number of candidates that were removed.
|
||||
|
@ -19,17 +19,18 @@ namespace webrtc {
|
||||
|
||||
const double kDefaultBitratePriority = 1.0;
|
||||
|
||||
RtcpFeedback::RtcpFeedback() {}
|
||||
RtcpFeedback::RtcpFeedback() = default;
|
||||
RtcpFeedback::RtcpFeedback(RtcpFeedbackType type) : type(type) {}
|
||||
RtcpFeedback::RtcpFeedback(RtcpFeedbackType type,
|
||||
RtcpFeedbackMessageType message_type)
|
||||
: type(type), message_type(message_type) {}
|
||||
RtcpFeedback::~RtcpFeedback() {}
|
||||
RtcpFeedback::RtcpFeedback(const RtcpFeedback& rhs) = default;
|
||||
RtcpFeedback::~RtcpFeedback() = default;
|
||||
|
||||
RtpCodecCapability::RtpCodecCapability() {}
|
||||
RtpCodecCapability::~RtpCodecCapability() {}
|
||||
RtpCodecCapability::RtpCodecCapability() = default;
|
||||
RtpCodecCapability::~RtpCodecCapability() = default;
|
||||
|
||||
RtpHeaderExtensionCapability::RtpHeaderExtensionCapability() {}
|
||||
RtpHeaderExtensionCapability::RtpHeaderExtensionCapability() = default;
|
||||
RtpHeaderExtensionCapability::RtpHeaderExtensionCapability(
|
||||
const std::string& uri)
|
||||
: uri(uri) {}
|
||||
@ -37,39 +38,46 @@ RtpHeaderExtensionCapability::RtpHeaderExtensionCapability(
|
||||
const std::string& uri,
|
||||
int preferred_id)
|
||||
: uri(uri), preferred_id(preferred_id) {}
|
||||
RtpHeaderExtensionCapability::~RtpHeaderExtensionCapability() {}
|
||||
RtpHeaderExtensionCapability::~RtpHeaderExtensionCapability() = default;
|
||||
|
||||
RtpExtension::RtpExtension() {}
|
||||
RtpExtension::RtpExtension() = default;
|
||||
RtpExtension::RtpExtension(const std::string& uri, int id) : uri(uri), id(id) {}
|
||||
RtpExtension::RtpExtension(const std::string& uri, int id, bool encrypt)
|
||||
: uri(uri), id(id), encrypt(encrypt) {}
|
||||
RtpExtension::~RtpExtension() {}
|
||||
RtpExtension::~RtpExtension() = default;
|
||||
|
||||
RtpFecParameters::RtpFecParameters() {}
|
||||
RtpFecParameters::RtpFecParameters() = default;
|
||||
RtpFecParameters::RtpFecParameters(FecMechanism mechanism)
|
||||
: mechanism(mechanism) {}
|
||||
RtpFecParameters::RtpFecParameters(FecMechanism mechanism, uint32_t ssrc)
|
||||
: ssrc(ssrc), mechanism(mechanism) {}
|
||||
RtpFecParameters::~RtpFecParameters() {}
|
||||
RtpFecParameters::RtpFecParameters(const RtpFecParameters& rhs) = default;
|
||||
RtpFecParameters::~RtpFecParameters() = default;
|
||||
|
||||
RtpRtxParameters::RtpRtxParameters() {}
|
||||
RtpRtxParameters::RtpRtxParameters() = default;
|
||||
RtpRtxParameters::RtpRtxParameters(uint32_t ssrc) : ssrc(ssrc) {}
|
||||
RtpRtxParameters::~RtpRtxParameters() {}
|
||||
RtpRtxParameters::RtpRtxParameters(const RtpRtxParameters& rhs) = default;
|
||||
RtpRtxParameters::~RtpRtxParameters() = default;
|
||||
|
||||
RtpEncodingParameters::RtpEncodingParameters() {}
|
||||
RtpEncodingParameters::~RtpEncodingParameters() {}
|
||||
RtpEncodingParameters::RtpEncodingParameters() = default;
|
||||
RtpEncodingParameters::RtpEncodingParameters(const RtpEncodingParameters& rhs) =
|
||||
default;
|
||||
RtpEncodingParameters::~RtpEncodingParameters() = default;
|
||||
|
||||
RtpCodecParameters::RtpCodecParameters() {}
|
||||
RtpCodecParameters::~RtpCodecParameters() {}
|
||||
RtpCodecParameters::RtpCodecParameters() = default;
|
||||
RtpCodecParameters::RtpCodecParameters(const RtpCodecParameters& rhs) = default;
|
||||
RtpCodecParameters::~RtpCodecParameters() = default;
|
||||
|
||||
RtpCapabilities::RtpCapabilities() {}
|
||||
RtpCapabilities::~RtpCapabilities() {}
|
||||
RtpCapabilities::RtpCapabilities() = default;
|
||||
RtpCapabilities::~RtpCapabilities() = default;
|
||||
|
||||
RtcpParameters::RtcpParameters() {}
|
||||
RtcpParameters::~RtcpParameters() {}
|
||||
RtcpParameters::RtcpParameters() = default;
|
||||
RtcpParameters::RtcpParameters(const RtcpParameters& rhs) = default;
|
||||
RtcpParameters::~RtcpParameters() = default;
|
||||
|
||||
RtpParameters::RtpParameters() {}
|
||||
RtpParameters::~RtpParameters() {}
|
||||
RtpParameters::RtpParameters() = default;
|
||||
RtpParameters::RtpParameters(const RtpParameters& rhs) = default;
|
||||
RtpParameters::~RtpParameters() = default;
|
||||
|
||||
std::string RtpExtension::ToString() const {
|
||||
char buf[256];
|
||||
|
@ -100,6 +100,7 @@ struct RtcpFeedback {
|
||||
RtcpFeedback();
|
||||
explicit RtcpFeedback(RtcpFeedbackType type);
|
||||
RtcpFeedback(RtcpFeedbackType type, RtcpFeedbackMessageType message_type);
|
||||
RtcpFeedback(const RtcpFeedback&);
|
||||
~RtcpFeedback();
|
||||
|
||||
bool operator==(const RtcpFeedback& o) const {
|
||||
@ -321,6 +322,7 @@ struct RtpFecParameters {
|
||||
RtpFecParameters();
|
||||
explicit RtpFecParameters(FecMechanism mechanism);
|
||||
RtpFecParameters(FecMechanism mechanism, uint32_t ssrc);
|
||||
RtpFecParameters(const RtpFecParameters&);
|
||||
~RtpFecParameters();
|
||||
|
||||
bool operator==(const RtpFecParameters& o) const {
|
||||
@ -337,6 +339,7 @@ struct RtpRtxParameters {
|
||||
// Constructors for convenience.
|
||||
RtpRtxParameters();
|
||||
explicit RtpRtxParameters(uint32_t ssrc);
|
||||
RtpRtxParameters(const RtpRtxParameters&);
|
||||
~RtpRtxParameters();
|
||||
|
||||
bool operator==(const RtpRtxParameters& o) const { return ssrc == o.ssrc; }
|
||||
@ -345,6 +348,7 @@ struct RtpRtxParameters {
|
||||
|
||||
struct RtpEncodingParameters {
|
||||
RtpEncodingParameters();
|
||||
RtpEncodingParameters(const RtpEncodingParameters&);
|
||||
~RtpEncodingParameters();
|
||||
|
||||
// If unset, a value is chosen by the implementation.
|
||||
@ -460,6 +464,7 @@ struct RtpEncodingParameters {
|
||||
|
||||
struct RtpCodecParameters {
|
||||
RtpCodecParameters();
|
||||
RtpCodecParameters(const RtpCodecParameters&);
|
||||
~RtpCodecParameters();
|
||||
|
||||
// Build MIME "type/subtype" string from |name| and |kind|.
|
||||
@ -545,6 +550,7 @@ struct RtpCapabilities {
|
||||
|
||||
struct RtcpParameters final {
|
||||
RtcpParameters();
|
||||
RtcpParameters(const RtcpParameters&);
|
||||
~RtcpParameters();
|
||||
|
||||
// The SSRC to be used in the "SSRC of packet sender" field. If not set, one
|
||||
@ -579,6 +585,7 @@ struct RtcpParameters final {
|
||||
|
||||
struct RtpParameters {
|
||||
RtpParameters();
|
||||
RtpParameters(const RtpParameters&);
|
||||
~RtpParameters();
|
||||
|
||||
// Used when calling getParameters/setParameters with a PeerConnection
|
||||
|
@ -14,6 +14,8 @@ namespace webrtc {
|
||||
|
||||
RtpTransceiverInit::RtpTransceiverInit() = default;
|
||||
|
||||
RtpTransceiverInit::RtpTransceiverInit(const RtpTransceiverInit& rhs) = default;
|
||||
|
||||
RtpTransceiverInit::~RtpTransceiverInit() = default;
|
||||
|
||||
absl::optional<RtpTransceiverDirection>
|
||||
|
@ -35,6 +35,7 @@ enum class RtpTransceiverDirection {
|
||||
// https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiverinit
|
||||
struct RtpTransceiverInit final {
|
||||
RtpTransceiverInit();
|
||||
RtpTransceiverInit(const RtpTransceiverInit&);
|
||||
~RtpTransceiverInit();
|
||||
// Direction of the RtpTransceiver. See RtpTransceiverInterface::direction().
|
||||
RtpTransceiverDirection direction = RtpTransceiverDirection::kSendRecv;
|
||||
|
@ -53,39 +53,4 @@ bool JsepIceCandidate::ToString(std::string* out) const {
|
||||
return !out->empty();
|
||||
}
|
||||
|
||||
JsepCandidateCollection::~JsepCandidateCollection() {
|
||||
for (std::vector<JsepIceCandidate*>::iterator it = candidates_.begin();
|
||||
it != candidates_.end(); ++it) {
|
||||
delete *it;
|
||||
}
|
||||
}
|
||||
|
||||
bool JsepCandidateCollection::HasCandidate(
|
||||
const IceCandidateInterface* candidate) const {
|
||||
bool ret = false;
|
||||
for (std::vector<JsepIceCandidate*>::const_iterator it = candidates_.begin();
|
||||
it != candidates_.end(); ++it) {
|
||||
if ((*it)->sdp_mid() == candidate->sdp_mid() &&
|
||||
(*it)->sdp_mline_index() == candidate->sdp_mline_index() &&
|
||||
(*it)->candidate().IsEquivalent(candidate->candidate())) {
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
size_t JsepCandidateCollection::remove(const cricket::Candidate& candidate) {
|
||||
auto iter = std::find_if(candidates_.begin(), candidates_.end(),
|
||||
[candidate](JsepIceCandidate* c) {
|
||||
return candidate.MatchesForRemoval(c->candidate());
|
||||
});
|
||||
if (iter != candidates_.end()) {
|
||||
delete *iter;
|
||||
candidates_.erase(iter);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -22,7 +22,7 @@ namespace webrtc {
|
||||
class MediaStreamObserver : public ObserverInterface {
|
||||
public:
|
||||
explicit MediaStreamObserver(MediaStreamInterface* stream);
|
||||
~MediaStreamObserver();
|
||||
~MediaStreamObserver() override;
|
||||
|
||||
const MediaStreamInterface* stream() const { return stream_; }
|
||||
|
||||
|
@ -584,11 +584,6 @@ rtc_static_library("peerconnection_jni") {
|
||||
"src/jni/pc/turncustomizer.h",
|
||||
]
|
||||
|
||||
if (is_clang) {
|
||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
|
||||
deps = [
|
||||
":base_jni",
|
||||
":generated_external_classes_jni",
|
||||
@ -1256,11 +1251,6 @@ rtc_static_library("native_api_peerconnection") {
|
||||
"native_api/peerconnection/peerconnectionfactory.h",
|
||||
]
|
||||
|
||||
if (is_clang) {
|
||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
|
||||
deps = [
|
||||
":base_jni",
|
||||
":peerconnection_jni",
|
||||
|
@ -29,7 +29,7 @@ namespace {
|
||||
class DataChannelObserverJni : public DataChannelObserver {
|
||||
public:
|
||||
DataChannelObserverJni(JNIEnv* jni, const JavaRef<jobject>& j_observer);
|
||||
virtual ~DataChannelObserverJni() {}
|
||||
~DataChannelObserverJni() override {}
|
||||
|
||||
void OnBufferedAmountChange(uint64_t previous_amount) override;
|
||||
void OnStateChange() override;
|
||||
|
@ -44,7 +44,7 @@ class MediaConstraintsJni : public MediaConstraintsInterface {
|
||||
optional_(PopulateConstraintsFromJavaPairList(
|
||||
env,
|
||||
Java_MediaConstraints_getOptional(env, j_constraints))) {}
|
||||
virtual ~MediaConstraintsJni() = default;
|
||||
~MediaConstraintsJni() override = default;
|
||||
|
||||
// MediaConstraintsInterface.
|
||||
const Constraints& GetMandatory() const override { return mandatory_; }
|
||||
|
@ -26,7 +26,7 @@ class JavaMediaStream : public sigslot::has_slots<> {
|
||||
explicit JavaMediaStream(
|
||||
JNIEnv* env,
|
||||
rtc::scoped_refptr<MediaStreamInterface> media_stream);
|
||||
~JavaMediaStream();
|
||||
~JavaMediaStream() override;
|
||||
|
||||
const ScopedJavaGlobalRef<jobject>& j_media_stream() {
|
||||
return j_media_stream_;
|
||||
|
@ -20,6 +20,18 @@ PeerConnectionFactoryInterface* factoryFromJava(jlong j_p) {
|
||||
return reinterpret_cast<OwnedFactoryAndThreads*>(j_p)->factory();
|
||||
}
|
||||
|
||||
OwnedFactoryAndThreads::OwnedFactoryAndThreads(
|
||||
std::unique_ptr<Thread> network_thread,
|
||||
std::unique_ptr<Thread> worker_thread,
|
||||
std::unique_ptr<Thread> signaling_thread,
|
||||
rtc::NetworkMonitorFactory* network_monitor_factory,
|
||||
PeerConnectionFactoryInterface* factory)
|
||||
: network_thread_(std::move(network_thread)),
|
||||
worker_thread_(std::move(worker_thread)),
|
||||
signaling_thread_(std::move(signaling_thread)),
|
||||
network_monitor_factory_(network_monitor_factory),
|
||||
factory_(factory) {}
|
||||
|
||||
OwnedFactoryAndThreads::~OwnedFactoryAndThreads() {
|
||||
factory_->Release();
|
||||
if (network_monitor_factory_ != nullptr) {
|
||||
|
@ -37,12 +37,7 @@ class OwnedFactoryAndThreads {
|
||||
std::unique_ptr<Thread> worker_thread,
|
||||
std::unique_ptr<Thread> signaling_thread,
|
||||
rtc::NetworkMonitorFactory* network_monitor_factory,
|
||||
PeerConnectionFactoryInterface* factory)
|
||||
: network_thread_(std::move(network_thread)),
|
||||
worker_thread_(std::move(worker_thread)),
|
||||
signaling_thread_(std::move(signaling_thread)),
|
||||
network_monitor_factory_(network_monitor_factory),
|
||||
factory_(factory) {}
|
||||
PeerConnectionFactoryInterface* factory);
|
||||
|
||||
~OwnedFactoryAndThreads();
|
||||
|
||||
|
@ -373,6 +373,13 @@ PeerConnectionObserverJni::NativeToJavaMediaStreamArray(
|
||||
});
|
||||
}
|
||||
|
||||
OwnedPeerConnection::OwnedPeerConnection(
|
||||
rtc::scoped_refptr<PeerConnectionInterface> peer_connection,
|
||||
std::unique_ptr<PeerConnectionObserver> observer)
|
||||
: OwnedPeerConnection(peer_connection,
|
||||
std::move(observer),
|
||||
nullptr /* constraints */) {}
|
||||
|
||||
OwnedPeerConnection::OwnedPeerConnection(
|
||||
rtc::scoped_refptr<PeerConnectionInterface> peer_connection,
|
||||
std::unique_ptr<PeerConnectionObserver> observer,
|
||||
|
@ -40,7 +40,7 @@ rtc::KeyType GetRtcConfigKeyType(JNIEnv* env,
|
||||
class PeerConnectionObserverJni : public PeerConnectionObserver {
|
||||
public:
|
||||
PeerConnectionObserverJni(JNIEnv* jni, const JavaRef<jobject>& j_observer);
|
||||
virtual ~PeerConnectionObserverJni();
|
||||
~PeerConnectionObserverJni() override;
|
||||
|
||||
// Implementation of PeerConnectionObserver interface, which propagates
|
||||
// the callbacks to the Java observer.
|
||||
@ -101,10 +101,7 @@ class OwnedPeerConnection {
|
||||
public:
|
||||
OwnedPeerConnection(
|
||||
rtc::scoped_refptr<PeerConnectionInterface> peer_connection,
|
||||
std::unique_ptr<PeerConnectionObserver> observer)
|
||||
: OwnedPeerConnection(peer_connection,
|
||||
std::move(observer),
|
||||
nullptr /* constraints */) {}
|
||||
std::unique_ptr<PeerConnectionObserver> observer);
|
||||
// Deprecated. PC constraints are deprecated.
|
||||
OwnedPeerConnection(
|
||||
rtc::scoped_refptr<PeerConnectionInterface> peer_connection,
|
||||
|
@ -102,7 +102,7 @@ ScopedJavaLocalRef<jobject> MemberToJava(
|
||||
ScopedJavaLocalRef<jobject> NativeToJavaRtcStats(JNIEnv* env,
|
||||
const RTCStats& stats) {
|
||||
JavaMapBuilder builder(env);
|
||||
for (const auto& member : stats.Members()) {
|
||||
for (auto* const member : stats.Members()) {
|
||||
if (!member->is_defined())
|
||||
continue;
|
||||
builder.put(NativeToJavaString(env, member->name()),
|
||||
@ -131,6 +131,8 @@ RTCStatsCollectorCallbackWrapper::RTCStatsCollectorCallbackWrapper(
|
||||
const JavaRef<jobject>& j_callback)
|
||||
: j_callback_global_(jni, j_callback) {}
|
||||
|
||||
RTCStatsCollectorCallbackWrapper::~RTCStatsCollectorCallbackWrapper() = default;
|
||||
|
||||
void RTCStatsCollectorCallbackWrapper::OnStatsDelivered(
|
||||
const rtc::scoped_refptr<const RTCStatsReport>& report) {
|
||||
JNIEnv* jni = AttachCurrentThreadIfNeeded();
|
||||
|
@ -26,6 +26,7 @@ class RTCStatsCollectorCallbackWrapper : public RTCStatsCollectorCallback {
|
||||
public:
|
||||
RTCStatsCollectorCallbackWrapper(JNIEnv* jni,
|
||||
const JavaRef<jobject>& j_callback);
|
||||
~RTCStatsCollectorCallbackWrapper() override;
|
||||
|
||||
void OnStatsDelivered(
|
||||
const rtc::scoped_refptr<const RTCStatsReport>& report) override;
|
||||
|
@ -27,6 +27,8 @@ CreateSdpObserverJni::CreateSdpObserverJni(
|
||||
: j_observer_global_(env, j_observer),
|
||||
constraints_(std::move(constraints)) {}
|
||||
|
||||
CreateSdpObserverJni::~CreateSdpObserverJni() = default;
|
||||
|
||||
void CreateSdpObserverJni::OnSuccess(SessionDescriptionInterface* desc) {
|
||||
JNIEnv* env = AttachCurrentThreadIfNeeded();
|
||||
Java_SdpObserver_onCreateSuccess(env, j_observer_global_,
|
||||
@ -49,6 +51,8 @@ SetSdpObserverJni::SetSdpObserverJni(
|
||||
: j_observer_global_(env, j_observer),
|
||||
constraints_(std::move(constraints)) {}
|
||||
|
||||
SetSdpObserverJni::~SetSdpObserverJni() = default;
|
||||
|
||||
void SetSdpObserverJni::OnSuccess() {
|
||||
JNIEnv* env = AttachCurrentThreadIfNeeded();
|
||||
Java_SdpObserver_onSetSuccess(env, j_observer_global_);
|
||||
|
@ -26,6 +26,7 @@ class CreateSdpObserverJni : public CreateSessionDescriptionObserver {
|
||||
CreateSdpObserverJni(JNIEnv* env,
|
||||
const JavaRef<jobject>& j_observer,
|
||||
std::unique_ptr<MediaConstraintsInterface> constraints);
|
||||
~CreateSdpObserverJni() override;
|
||||
|
||||
MediaConstraintsInterface* constraints() { return constraints_.get(); }
|
||||
|
||||
@ -42,6 +43,7 @@ class SetSdpObserverJni : public SetSessionDescriptionObserver {
|
||||
SetSdpObserverJni(JNIEnv* env,
|
||||
const JavaRef<jobject>& j_observer,
|
||||
std::unique_ptr<MediaConstraintsInterface> constraints);
|
||||
~SetSdpObserverJni() override;
|
||||
|
||||
MediaConstraintsInterface* constraints() { return constraints_.get(); }
|
||||
|
||||
|
@ -58,6 +58,8 @@ StatsObserverJni::StatsObserverJni(JNIEnv* jni,
|
||||
const JavaRef<jobject>& j_observer)
|
||||
: j_observer_global_(jni, j_observer) {}
|
||||
|
||||
StatsObserverJni::~StatsObserverJni() = default;
|
||||
|
||||
void StatsObserverJni::OnComplete(const StatsReports& reports) {
|
||||
JNIEnv* env = AttachCurrentThreadIfNeeded();
|
||||
ScopedJavaLocalRef<jobjectArray> j_reports =
|
||||
|
@ -22,6 +22,7 @@ namespace jni {
|
||||
class StatsObserverJni : public StatsObserver {
|
||||
public:
|
||||
StatsObserverJni(JNIEnv* jni, const JavaRef<jobject>& j_observer);
|
||||
~StatsObserverJni() override;
|
||||
|
||||
void OnComplete(const StatsReports& reports) override;
|
||||
|
||||
|
Reference in New Issue
Block a user