| Index: webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc
|
| diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc
|
| index ab6be5aed6aa0759f26977173e452732d8605314..a8cd84d8c83f1dd6a8cdbfb2352faa85d12e6e95 100644
|
| --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc
|
| +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc
|
| @@ -21,7 +21,6 @@
|
| #include "webrtc/base/checks.h"
|
| #include "webrtc/base/format_macros.h"
|
| #include "webrtc/base/platform_thread.h"
|
| -#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
|
|
| namespace webrtc {
|
| namespace testing {
|
| @@ -58,27 +57,27 @@ Logging* Logging::GetInstance() {
|
| }
|
|
|
| void Logging::SetGlobalContext(uint32_t name) {
|
| - CriticalSectionScoped cs(crit_sect_.get());
|
| + rtc::CritScope cs(&crit_sect_);
|
| thread_map_[rtc::CurrentThreadId()].global_state.tag = ToString(name);
|
| }
|
|
|
| void Logging::SetGlobalContext(const std::string& name) {
|
| - CriticalSectionScoped cs(crit_sect_.get());
|
| + rtc::CritScope cs(&crit_sect_);
|
| thread_map_[rtc::CurrentThreadId()].global_state.tag = name;
|
| }
|
|
|
| void Logging::SetGlobalContext(const char* name) {
|
| - CriticalSectionScoped cs(crit_sect_.get());
|
| + rtc::CritScope cs(&crit_sect_);
|
| thread_map_[rtc::CurrentThreadId()].global_state.tag = name;
|
| }
|
|
|
| void Logging::SetGlobalEnable(bool enabled) {
|
| - CriticalSectionScoped cs(crit_sect_.get());
|
| + rtc::CritScope cs(&crit_sect_);
|
| thread_map_[rtc::CurrentThreadId()].global_state.enabled = enabled;
|
| }
|
|
|
| void Logging::Log(const char format[], ...) {
|
| - CriticalSectionScoped cs(crit_sect_.get());
|
| + rtc::CritScope cs(&crit_sect_);
|
| ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId());
|
| RTC_DCHECK(it != thread_map_.end());
|
| const State& state = it->second.stack.top();
|
| @@ -115,7 +114,7 @@ void Logging::Plot(int figure,
|
| double value,
|
| uint32_t ssrc,
|
| const std::string& alg_name) {
|
| - CriticalSectionScoped cs(crit_sect_.get());
|
| + rtc::CritScope cs(&crit_sect_);
|
| ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId());
|
| RTC_DCHECK(it != thread_map_.end());
|
| const State& state = it->second.stack.top();
|
| @@ -129,7 +128,7 @@ void Logging::PlotBar(int figure,
|
| const std::string& name,
|
| double value,
|
| int flow_id) {
|
| - CriticalSectionScoped cs(crit_sect_.get());
|
| + rtc::CritScope cs(&crit_sect_);
|
| ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId());
|
| RTC_DCHECK(it != thread_map_.end());
|
| const State& state = it->second.stack.top();
|
| @@ -142,7 +141,7 @@ void Logging::PlotBaselineBar(int figure,
|
| const std::string& name,
|
| double value,
|
| int flow_id) {
|
| - CriticalSectionScoped cs(crit_sect_.get());
|
| + rtc::CritScope cs(&crit_sect_);
|
| ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId());
|
| RTC_DCHECK(it != thread_map_.end());
|
| const State& state = it->second.stack.top();
|
| @@ -158,7 +157,7 @@ void Logging::PlotErrorBar(int figure,
|
| double yhigh,
|
| const std::string& error_title,
|
| int flow_id) {
|
| - CriticalSectionScoped cs(crit_sect_.get());
|
| + rtc::CritScope cs(&crit_sect_);
|
| ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId());
|
| RTC_DCHECK(it != thread_map_.end());
|
| const State& state = it->second.stack.top();
|
| @@ -177,7 +176,7 @@ void Logging::PlotLimitErrorBar(int figure,
|
| double ymax,
|
| const std::string& limit_title,
|
| int flow_id) {
|
| - CriticalSectionScoped cs(crit_sect_.get());
|
| + rtc::CritScope cs(&crit_sect_);
|
| ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId());
|
| RTC_DCHECK(it != thread_map_.end());
|
| const State& state = it->second.stack.top();
|
| @@ -192,7 +191,7 @@ void Logging::PlotLabel(int figure,
|
| const std::string& title,
|
| const std::string& y_label,
|
| int num_flows) {
|
| - CriticalSectionScoped cs(crit_sect_.get());
|
| + rtc::CritScope cs(&crit_sect_);
|
| ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId());
|
| RTC_DCHECK(it != thread_map_.end());
|
| const State& state = it->second.stack.top();
|
| @@ -203,8 +202,7 @@ void Logging::PlotLabel(int figure,
|
| }
|
|
|
| Logging::Logging()
|
| - : crit_sect_(CriticalSectionWrapper::CreateCriticalSection()),
|
| - thread_map_() {
|
| + : thread_map_() {
|
| }
|
|
|
| Logging::State::State() : tag(""), timestamp_ms(0), enabled(true) {}
|
| @@ -228,7 +226,7 @@ void Logging::State::MergePrevious(const State& previous) {
|
|
|
| void Logging::PushState(const std::string& append_to_tag, int64_t timestamp_ms,
|
| bool enabled) {
|
| - CriticalSectionScoped cs(crit_sect_.get());
|
| + rtc::CritScope cs(&crit_sect_);
|
| State new_state(append_to_tag, timestamp_ms, enabled);
|
| ThreadState* thread_state = &thread_map_[rtc::CurrentThreadId()];
|
| std::stack<State>* stack = &thread_state->stack;
|
| @@ -241,7 +239,7 @@ void Logging::PushState(const std::string& append_to_tag, int64_t timestamp_ms,
|
| }
|
|
|
| void Logging::PopState() {
|
| - CriticalSectionScoped cs(crit_sect_.get());
|
| + rtc::CritScope cs(&crit_sect_);
|
| ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId());
|
| RTC_DCHECK(it != thread_map_.end());
|
| std::stack<State>* stack = &it->second.stack;
|
|
|