Add thread annotations to Call API. Also constified a lot of pointers and reordered members to make protected members more grouped together. R=kjellander@webrtc.org, stefan@webrtc.org BUG=2770 Review URL: https://webrtc-codereview.appspot.com/15399004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5998 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/video/call_perf_tests.cc b/webrtc/video/call_perf_tests.cc index 83ea1d0..6b8ff96 100644 --- a/webrtc/video/call_perf_tests.cc +++ b/webrtc/video/call_perf_tests.cc
@@ -22,6 +22,7 @@ #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" +#include "webrtc/system_wrappers/interface/thread_annotations.h" #include "webrtc/test/direct_transport.h" #include "webrtc/test/encoder_settings.h" #include "webrtc/test/fake_audio_device.h" @@ -93,7 +94,7 @@ public: explicit SyncRtcpObserver(const FakeNetworkPipe::Config& config) : test::RtpRtcpObserver(kLongTimeoutMs, config), - critical_section_(CriticalSectionWrapper::CreateCriticalSection()) {} + crit_(CriticalSectionWrapper::CreateCriticalSection()) {} virtual Action OnSendRtcp(const uint8_t* packet, size_t length) OVERRIDE { RTCPUtility::RTCPParserV2 parser(packet, length, true); @@ -115,7 +116,7 @@ } int64_t RtpTimestampToNtp(uint32_t timestamp) const { - CriticalSectionScoped cs(critical_section_.get()); + CriticalSectionScoped lock(crit_.get()); int64_t timestamp_in_ms = -1; if (ntp_rtp_pairs_.size() == 2) { // TODO(stefan): We can't EXPECT_TRUE on this call due to a bug in the @@ -129,7 +130,7 @@ private: void StoreNtpRtpPair(synchronization::RtcpMeasurement ntp_rtp_pair) { - CriticalSectionScoped cs(critical_section_.get()); + CriticalSectionScoped lock(crit_.get()); for (synchronization::RtcpList::iterator it = ntp_rtp_pairs_.begin(); it != ntp_rtp_pairs_.end(); ++it) { @@ -147,8 +148,8 @@ ntp_rtp_pairs_.push_front(ntp_rtp_pair); } - scoped_ptr<CriticalSectionWrapper> critical_section_; - synchronization::RtcpList ntp_rtp_pairs_; + const scoped_ptr<CriticalSectionWrapper> crit_; + synchronization::RtcpList ntp_rtp_pairs_ GUARDED_BY(crit_); }; class VideoRtcpAndSyncObserver : public SyncRtcpObserver, public VideoRenderer { @@ -213,7 +214,7 @@ } private: - Clock* clock_; + Clock* const clock_; int voe_channel_; VoEVideoSync* voe_sync_; SyncRtcpObserver* audio_observer_;