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

Unified Diff: webrtc/modules/rtp_rtcp/source/dtmf_queue.cc

Issue 1877253002: Replaced CriticalSectionWrapper with rtc::CriticalSection in rtp_rtcp module (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: git cl format dtmf_queue.cc Created 4 years, 8 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
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/dtmf_queue.h ('k') | webrtc/modules/rtp_rtcp/source/fec_receiver_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/dtmf_queue.cc
diff --git a/webrtc/modules/rtp_rtcp/source/dtmf_queue.cc b/webrtc/modules/rtp_rtcp/source/dtmf_queue.cc
index ab21b8704a53785c8e7560fb7796b2aa400de940..81e8b5926e2f6af288fa8bc6df548fd915424544 100644
--- a/webrtc/modules/rtp_rtcp/source/dtmf_queue.cc
+++ b/webrtc/modules/rtp_rtcp/source/dtmf_queue.cc
@@ -13,20 +13,16 @@
#include <string.h>
namespace webrtc {
-DTMFqueue::DTMFqueue()
- : dtmf_critsect_(CriticalSectionWrapper::CreateCriticalSection()),
- next_empty_index_(0) {
+DTMFqueue::DTMFqueue() : next_empty_index_(0) {
memset(dtmf_key_, 0, sizeof(dtmf_key_));
memset(dtmf_length, 0, sizeof(dtmf_length));
memset(dtmf_level_, 0, sizeof(dtmf_level_));
}
-DTMFqueue::~DTMFqueue() {
- delete dtmf_critsect_;
-}
+DTMFqueue::~DTMFqueue() {}
int32_t DTMFqueue::AddDTMF(uint8_t key, uint16_t len, uint8_t level) {
- CriticalSectionScoped lock(dtmf_critsect_);
+ rtc::CritScope lock(&dtmf_critsect_);
if (next_empty_index_ >= DTMF_OUTBAND_MAX) {
return -1;
@@ -40,7 +36,7 @@ int32_t DTMFqueue::AddDTMF(uint8_t key, uint16_t len, uint8_t level) {
}
int8_t DTMFqueue::NextDTMF(uint8_t* dtmf_key, uint16_t* len, uint8_t* level) {
- CriticalSectionScoped lock(dtmf_critsect_);
+ rtc::CritScope lock(&dtmf_critsect_);
if (next_empty_index_ == 0)
return -1;
@@ -60,12 +56,12 @@ int8_t DTMFqueue::NextDTMF(uint8_t* dtmf_key, uint16_t* len, uint8_t* level) {
}
bool DTMFqueue::PendingDTMF() {
- CriticalSectionScoped lock(dtmf_critsect_);
+ rtc::CritScope lock(&dtmf_critsect_);
return next_empty_index_ > 0;
}
void DTMFqueue::ResetDTMF() {
- CriticalSectionScoped lock(dtmf_critsect_);
+ rtc::CritScope lock(&dtmf_critsect_);
next_empty_index_ = 0;
}
} // namespace webrtc
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/dtmf_queue.h ('k') | webrtc/modules/rtp_rtcp/source/fec_receiver_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698