Switch CriticalSectionWrapper->rtc::CriticalSection in modules/audio_coding.

This is a part of cleaning up CriticalSectionWrapper in general.

BUG=
R=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1610073003 .

Cr-Commit-Position: refs/heads/master@{#11319}
This commit is contained in:
Tommi
2016-01-20 13:39:36 +01:00
parent 84df580d52
commit 9090e0b147
12 changed files with 118 additions and 132 deletions

View File

@ -14,6 +14,7 @@
#include "webrtc/modules/audio_coding/codecs/isac/main/include/audio_encoder_isac.h"
#include "webrtc/base/checks.h"
#include "webrtc/common_types.h"
namespace webrtc {

View File

@ -12,8 +12,7 @@
namespace webrtc {
LockedIsacBandwidthInfo::LockedIsacBandwidthInfo()
: lock_(CriticalSectionWrapper::CreateCriticalSection()) {
LockedIsacBandwidthInfo::LockedIsacBandwidthInfo() {
bwinfo_.in_use = 0;
}

View File

@ -11,10 +11,10 @@
#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_LOCKED_BANDWIDTH_INFO_H_
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_LOCKED_BANDWIDTH_INFO_H_
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread_annotations.h"
#include "webrtc/modules/audio_coding/codecs/isac/bandwidth_info.h"
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
namespace webrtc {
@ -26,17 +26,17 @@ class LockedIsacBandwidthInfo final {
~LockedIsacBandwidthInfo();
IsacBandwidthInfo Get() const {
CriticalSectionScoped cs(lock_.get());
rtc::CritScope lock(&lock_);
return bwinfo_;
}
void Set(const IsacBandwidthInfo& bwinfo) {
CriticalSectionScoped cs(lock_.get());
rtc::CritScope lock(&lock_);
bwinfo_ = bwinfo;
}
private:
const rtc::scoped_ptr<CriticalSectionWrapper> lock_;
mutable rtc::CriticalSection lock_;
IsacBandwidthInfo bwinfo_ GUARDED_BY(lock_);
};