Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: webrtc/pc/srtpfilter.h

Issue 2938013003: Delete SignalSrtpError. (Closed)
Patch Set: Delete left-over declaration of set_signal_silent_time. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/pc/srtpfilter.h
diff --git a/webrtc/pc/srtpfilter.h b/webrtc/pc/srtpfilter.h
index 3df787646c740eb819f93986e697de0daabf1237..18a2f6774f20eda7e6954820fd96c4023b733186 100644
--- a/webrtc/pc/srtpfilter.h
+++ b/webrtc/pc/srtpfilter.h
@@ -20,7 +20,6 @@
#include "webrtc/base/basictypes.h"
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/criticalsection.h"
-#include "webrtc/base/sigslotrepeater.h"
#include "webrtc/base/sslstreamadapter.h"
#include "webrtc/base/thread_checker.h"
#include "webrtc/media/base/cryptoparams.h"
@@ -33,7 +32,6 @@ struct srtp_ctx_t_;
namespace cricket {
class SrtpSession;
-class SrtpStat;
void ShutdownSrtp();
@@ -127,13 +125,8 @@ class SrtpFilter {
// been set.
bool IsExternalAuthActive() const;
- // Update the silent threshold (in ms) for signaling errors.
- void set_signal_silent_time(int signal_silent_time_in_ms);
-
bool ResetParams();
- sigslot::repeater3<uint32_t, Mode, Error> SignalSrtpError;
-
protected:
bool ExpectOffer(ContentSource source);
bool StoreParams(const std::vector<CryptoParams>& params,
@@ -176,7 +169,6 @@ class SrtpFilter {
ST_RECEIVEDPRANSWER
};
State state_ = ST_INIT;
- int signal_silent_time_in_ms_ = 0;
bool external_auth_enabled_ = false;
std::vector<CryptoParams> offer_params_;
std::unique_ptr<SrtpSession> send_session_;
@@ -233,15 +225,9 @@ class SrtpSession {
// been set.
bool IsExternalAuthActive() const;
- // Update the silent threshold (in ms) for signaling errors.
- void set_signal_silent_time(int signal_silent_time_in_ms);
-
// Calls srtp_shutdown if it's initialized.
static void Terminate();
- sigslot::repeater3<uint32_t, SrtpFilter::Mode, SrtpFilter::Error>
- SignalSrtpError;
-
private:
bool SetKey(int type, int cs, const uint8_t* key, size_t len);
// Returns send stream current packet index from srtp db.
@@ -255,7 +241,6 @@ class SrtpSession {
srtp_ctx_t_* session_ = nullptr;
int rtp_auth_tag_len_ = 0;
int rtcp_auth_tag_len_ = 0;
- std::unique_ptr<SrtpStat> srtp_stat_;
static bool inited_;
static rtc::GlobalLockPod lock_;
int last_send_seq_num_ = -1;
@@ -264,78 +249,6 @@ class SrtpSession {
RTC_DISALLOW_COPY_AND_ASSIGN(SrtpSession);
};
-// Class that collects failures of SRTP.
-class SrtpStat {
- public:
- SrtpStat();
-
- // Report RTP protection results to the handler.
- void AddProtectRtpResult(uint32_t ssrc, int result);
- // Report RTP unprotection results to the handler.
- void AddUnprotectRtpResult(uint32_t ssrc, int result);
- // Report RTCP protection results to the handler.
- void AddProtectRtcpResult(int result);
- // Report RTCP unprotection results to the handler.
- void AddUnprotectRtcpResult(int result);
-
- // Get silent time (in ms) for SRTP statistics handler.
- int signal_silent_time() const { return signal_silent_time_; }
- // Set silent time (in ms) for SRTP statistics handler.
- void set_signal_silent_time(int signal_silent_time) {
- signal_silent_time_ = signal_silent_time;
- }
-
- // Sigslot for reporting errors.
- sigslot::signal3<uint32_t, SrtpFilter::Mode, SrtpFilter::Error>
- SignalSrtpError;
-
- private:
- // For each different ssrc and error, we collect statistics separately.
- struct FailureKey {
- FailureKey()
- : ssrc(0),
- mode(SrtpFilter::PROTECT),
- error(SrtpFilter::ERROR_NONE) {
- }
- FailureKey(uint32_t in_ssrc,
- SrtpFilter::Mode in_mode,
- SrtpFilter::Error in_error)
- : ssrc(in_ssrc), mode(in_mode), error(in_error) {}
- bool operator <(const FailureKey& key) const {
- return
- (ssrc < key.ssrc) ||
- (ssrc == key.ssrc && mode < key.mode) ||
- (ssrc == key.ssrc && mode == key.mode && error < key.error);
- }
- uint32_t ssrc;
- SrtpFilter::Mode mode;
- SrtpFilter::Error error;
- };
- // For tracing conditions for signaling, currently we only use
- // last_signal_time. Wrap this as a struct so that later on, if we need any
- // other improvements, it will be easier.
- struct FailureStat {
- FailureStat()
- : last_signal_time(0) {
- }
- explicit FailureStat(uint32_t in_last_signal_time)
- : last_signal_time(in_last_signal_time) {}
- void Reset() {
- last_signal_time = 0;
- }
- int64_t last_signal_time;
- };
-
- // Inspect SRTP result and signal error if needed.
- void HandleSrtpResult(const FailureKey& key);
-
- std::map<FailureKey, FailureStat> failures_;
- // Threshold in ms to silent the signaling errors.
- int signal_silent_time_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(SrtpStat);
-};
-
} // namespace cricket
#endif // WEBRTC_PC_SRTPFILTER_H_

Powered by Google App Engine
This is Rietveld 408576698