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

Unified Diff: webrtc/voice_engine/channel_manager.cc

Issue 1607353002: Swap use of CriticalSectionWrapper with rtc::CriticalSection in voice_engine/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix bug in monitor_module.cc Created 4 years, 11 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/voice_engine/channel_manager.h ('k') | webrtc/voice_engine/dtmf_inband.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/channel_manager.cc
diff --git a/webrtc/voice_engine/channel_manager.cc b/webrtc/voice_engine/channel_manager.cc
index 8452c8b63dbb5a259eebe2f210215c079c69266f..eac2e50919df49cad53fb3d5224d2e8446100376 100644
--- a/webrtc/voice_engine/channel_manager.cc
+++ b/webrtc/voice_engine/channel_manager.cc
@@ -48,7 +48,6 @@ ChannelOwner::ChannelRef::ChannelRef(class Channel* channel)
ChannelManager::ChannelManager(uint32_t instance_id, const Config& config)
: instance_id_(instance_id),
last_channel_id_(-1),
- lock_(CriticalSectionWrapper::CreateCriticalSection()),
config_(config),
event_log_(RtcEventLog::Create()) {}
@@ -66,7 +65,7 @@ ChannelOwner ChannelManager::CreateChannelInternal(const Config& config) {
event_log_.get(), config);
ChannelOwner channel_owner(channel);
- CriticalSectionScoped crit(lock_.get());
+ rtc::CritScope crit(&lock_);
channels_.push_back(channel_owner);
@@ -74,7 +73,7 @@ ChannelOwner ChannelManager::CreateChannelInternal(const Config& config) {
}
ChannelOwner ChannelManager::GetChannel(int32_t channel_id) {
- CriticalSectionScoped crit(lock_.get());
+ rtc::CritScope crit(&lock_);
for (size_t i = 0; i < channels_.size(); ++i) {
if (channels_[i].channel()->ChannelId() == channel_id)
@@ -84,7 +83,7 @@ ChannelOwner ChannelManager::GetChannel(int32_t channel_id) {
}
void ChannelManager::GetAllChannels(std::vector<ChannelOwner>* channels) {
- CriticalSectionScoped crit(lock_.get());
+ rtc::CritScope crit(&lock_);
*channels = channels_;
}
@@ -95,7 +94,7 @@ void ChannelManager::DestroyChannel(int32_t channel_id) {
// Channels while holding a lock, but rather when the method returns.
ChannelOwner reference(NULL);
{
- CriticalSectionScoped crit(lock_.get());
+ rtc::CritScope crit(&lock_);
std::vector<ChannelOwner>::iterator to_delete = channels_.end();
for (auto it = channels_.begin(); it != channels_.end(); ++it) {
Channel* channel = it->channel();
@@ -119,14 +118,14 @@ void ChannelManager::DestroyAllChannels() {
// lock, but rather when the method returns.
std::vector<ChannelOwner> references;
{
- CriticalSectionScoped crit(lock_.get());
+ rtc::CritScope crit(&lock_);
references = channels_;
channels_.clear();
}
}
size_t ChannelManager::NumOfChannels() const {
- CriticalSectionScoped crit(lock_.get());
+ rtc::CritScope crit(&lock_);
return channels_.size();
}
« no previous file with comments | « webrtc/voice_engine/channel_manager.h ('k') | webrtc/voice_engine/dtmf_inband.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698