Swap use of CriticalSectionWrapper with rtc::CriticalSection in voice_engine/
Also remove mischievous tab character!
This is a part of getting rid of CriticalSectionWrapper and makes the code slightly simpler.
BUG=
Review URL: https://codereview.webrtc.org/1607353002
Cr-Commit-Position: refs/heads/master@{#11346}
diff --git a/webrtc/voice_engine/monitor_module.cc b/webrtc/voice_engine/monitor_module.cc
index 5ea7357..2d8f4d4 100644
--- a/webrtc/voice_engine/monitor_module.cc
+++ b/webrtc/voice_engine/monitor_module.cc
@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
#include "webrtc/system_wrappers/include/tick_util.h"
#include "webrtc/voice_engine/monitor_module.h"
@@ -18,20 +17,18 @@
MonitorModule::MonitorModule() :
_observerPtr(NULL),
- _callbackCritSect(*CriticalSectionWrapper::CreateCriticalSection()),
_lastProcessTime(TickTime::MillisecondTimestamp())
{
}
MonitorModule::~MonitorModule()
{
- delete &_callbackCritSect;
}
int32_t
MonitorModule::RegisterObserver(MonitorObserver& observer)
{
- CriticalSectionScoped lock(&_callbackCritSect);
+ rtc::CritScope lock(&_callbackCritSect);
if (_observerPtr)
{
return -1;
@@ -43,7 +40,7 @@
int32_t
MonitorModule::DeRegisterObserver()
{
- CriticalSectionScoped lock(&_callbackCritSect);
+ rtc::CritScope lock(&_callbackCritSect);
if (!_observerPtr)
{
return 0;
@@ -64,9 +61,9 @@
MonitorModule::Process()
{
_lastProcessTime = TickTime::MillisecondTimestamp();
+ rtc::CritScope lock(&_callbackCritSect);
if (_observerPtr)
{
- CriticalSectionScoped lock(&_callbackCritSect);
_observerPtr->OnPeriodicProcess();
}
return 0;