From d8de1154c9dbf73d44a71d09827660c1fe13e2d6 Mon Sep 17 00:00:00 2001 From: pbos Date: Mon, 1 Feb 2016 09:00:51 -0800 Subject: [PATCH] Remove mutable from rtc::CriticalSections. A couple of mutables were added after last removal of mutables, so removing those. rtc::CriticalSection is const-lockable. BUG= R=tommi@webrtc.org Review URL: https://codereview.webrtc.org/1652983002 Cr-Commit-Position: refs/heads/master@{#11447} --- webrtc/video/call_stats.h | 2 +- webrtc/video/encoder_state_feedback.h | 2 +- webrtc/video/payload_router.h | 2 +- webrtc/video/video_capture_input.h | 2 +- webrtc/video/vie_channel.h | 4 ++-- webrtc/video/vie_encoder.h | 2 +- webrtc/video/vie_remb.h | 2 +- webrtc/voice_engine/channel.h | 14 +++++++------- webrtc/voice_engine/channel_manager.h | 2 +- webrtc/voice_engine/dtmf_inband.h | 2 +- webrtc/voice_engine/level_indicator.h | 2 +- webrtc/voice_engine/shared_data.h | 2 +- webrtc/voice_engine/statistics.h | 2 +- .../test/auto_test/fakes/conference_transport.h | 4 ++-- .../fixtures/after_initialization_fixture.h | 2 +- 15 files changed, 23 insertions(+), 23 deletions(-) diff --git a/webrtc/video/call_stats.h b/webrtc/video/call_stats.h index 7bd74c6147..8a09b7eed7 100644 --- a/webrtc/video/call_stats.h +++ b/webrtc/video/call_stats.h @@ -60,7 +60,7 @@ class CallStats : public Module { private: Clock* const clock_; // Protecting all members. - mutable rtc::CriticalSection crit_; + rtc::CriticalSection crit_; // Observer receiving statistics updates. rtc::scoped_ptr rtcp_rtt_stats_; // The last time 'Process' resulted in statistic update. diff --git a/webrtc/video/encoder_state_feedback.h b/webrtc/video/encoder_state_feedback.h index 0e2f95b0b4..d0161daf7b 100644 --- a/webrtc/video/encoder_state_feedback.h +++ b/webrtc/video/encoder_state_feedback.h @@ -55,7 +55,7 @@ class EncoderStateFeedback { private: typedef std::map SsrcEncoderMap; - mutable rtc::CriticalSection crit_; + rtc::CriticalSection crit_; // Instance registered at the class requesting new key frames. rtc::scoped_ptr observer_; diff --git a/webrtc/video/payload_router.h b/webrtc/video/payload_router.h index 7a95b1eca1..ea02a5cd15 100644 --- a/webrtc/video/payload_router.h +++ b/webrtc/video/payload_router.h @@ -69,7 +69,7 @@ class PayloadRouter { private: // TODO(mflodman): When the new video API has launched, remove crit_ and // assume rtp_modules_ will never change during a call. - mutable rtc::CriticalSection crit_; + rtc::CriticalSection crit_; // Active sending RTP modules, in layer order. std::vector rtp_modules_ GUARDED_BY(crit_); diff --git a/webrtc/video/video_capture_input.h b/webrtc/video/video_capture_input.h index e8c927de01..1c27cb0b7b 100644 --- a/webrtc/video/video_capture_input.h +++ b/webrtc/video/video_capture_input.h @@ -63,7 +63,7 @@ class VideoCaptureInput : public webrtc::VideoCaptureInput { static bool EncoderThreadFunction(void* obj); bool EncoderProcess(); - mutable rtc::CriticalSection crit_; + rtc::CriticalSection crit_; ProcessThread* const module_process_thread_; VideoCaptureCallback* const frame_callback_; diff --git a/webrtc/video/vie_channel.h b/webrtc/video/vie_channel.h index 7737d6acbf..9f5e1ff90d 100644 --- a/webrtc/video/vie_channel.h +++ b/webrtc/video/vie_channel.h @@ -332,7 +332,7 @@ class ViEChannel : public VCMFrameTypeCallback, // Note: this should be implemented with a RW-lock to allow simultaneous // calls into the callback. However that doesn't seem to be needed for the // current type of callbacks covered by this class. - mutable rtc::CriticalSection critsect_; + rtc::CriticalSection critsect_; T* callback_ GUARDED_BY(critsect_); private: @@ -403,7 +403,7 @@ class ViEChannel : public VCMFrameTypeCallback, ProcessThread* const module_process_thread_; // Used for all registered callbacks except rendering. - mutable rtc::CriticalSection crit_; + rtc::CriticalSection crit_; // Owned modules/classes. rtc::scoped_refptr send_payload_router_; diff --git a/webrtc/video/vie_encoder.h b/webrtc/video/vie_encoder.h index 22c778cef7..e36cb30adc 100644 --- a/webrtc/video/vie_encoder.h +++ b/webrtc/video/vie_encoder.h @@ -158,7 +158,7 @@ class ViEEncoder : public RtcpIntraFrameObserver, const rtc::scoped_ptr vcm_; rtc::scoped_refptr send_payload_router_; - mutable rtc::CriticalSection data_cs_; + rtc::CriticalSection data_cs_; rtc::scoped_ptr bitrate_observer_; SendStatisticsProxy* const stats_proxy_; diff --git a/webrtc/video/vie_remb.h b/webrtc/video/vie_remb.h index c6bb4086c2..1508209995 100644 --- a/webrtc/video/vie_remb.h +++ b/webrtc/video/vie_remb.h @@ -58,7 +58,7 @@ class VieRemb : public RemoteBitrateObserver { typedef std::list RtpModules; Clock* const clock_; - mutable rtc::CriticalSection list_crit_; + rtc::CriticalSection list_crit_; // The last time a REMB was sent. int64_t last_remb_time_; diff --git a/webrtc/voice_engine/channel.h b/webrtc/voice_engine/channel.h index 889214b0aa..60c751e0d5 100644 --- a/webrtc/voice_engine/channel.h +++ b/webrtc/voice_engine/channel.h @@ -152,7 +152,7 @@ class ChannelState { } private: - mutable rtc::CriticalSection lock_; + rtc::CriticalSection lock_; State state_; }; @@ -483,9 +483,9 @@ class Channel int32_t GetPlayoutFrequency(); int64_t GetRTT(bool allow_associate_channel) const; - mutable rtc::CriticalSection _fileCritSect; - mutable rtc::CriticalSection _callbackCritSect; - mutable rtc::CriticalSection volume_settings_critsect_; + rtc::CriticalSection _fileCritSect; + rtc::CriticalSection _callbackCritSect; + rtc::CriticalSection volume_settings_critsect_; uint32_t _instanceId; int32_t _channelId; @@ -533,7 +533,7 @@ class Channel uint16_t send_sequence_number_; uint8_t restored_packet_[kVoiceEngineMaxIpPacketSizeBytes]; - mutable rtc::CriticalSection ts_stats_lock_; + rtc::CriticalSection ts_stats_lock_; rtc::scoped_ptr rtp_ts_wraparound_handler_; // The rtp timestamp of the first played out audio frame. @@ -574,7 +574,7 @@ class Channel // VoENetwork AudioFrame::SpeechType _outputSpeechType; // VoEVideoSync - mutable rtc::CriticalSection video_sync_lock_; + rtc::CriticalSection video_sync_lock_; uint32_t _average_jitter_buffer_delay_us GUARDED_BY(video_sync_lock_); uint32_t _previousTimestamp; uint16_t _recPacketDelayMs GUARDED_BY(video_sync_lock_); @@ -587,7 +587,7 @@ class Channel rtc::scoped_ptr rtcp_observer_; rtc::scoped_ptr network_predictor_; // An associated send channel. - mutable rtc::CriticalSection assoc_send_channel_lock_; + rtc::CriticalSection assoc_send_channel_lock_; ChannelOwner associate_send_channel_ GUARDED_BY(assoc_send_channel_lock_); bool pacing_enabled_; diff --git a/webrtc/voice_engine/channel_manager.h b/webrtc/voice_engine/channel_manager.h index a46d71dc44..7c86959097 100644 --- a/webrtc/voice_engine/channel_manager.h +++ b/webrtc/voice_engine/channel_manager.h @@ -123,7 +123,7 @@ class ChannelManager { Atomic32 last_channel_id_; - mutable rtc::CriticalSection lock_; + rtc::CriticalSection lock_; std::vector channels_; const Config& config_; diff --git a/webrtc/voice_engine/dtmf_inband.h b/webrtc/voice_engine/dtmf_inband.h index c2e2b2bcc8..6000d99214 100644 --- a/webrtc/voice_engine/dtmf_inband.h +++ b/webrtc/voice_engine/dtmf_inband.h @@ -67,7 +67,7 @@ private: int16_t length); private: - mutable rtc::CriticalSection _critSect; + rtc::CriticalSection _critSect; int32_t _id; uint16_t _outputFrequencyHz; // {8000, 16000, 32000} int16_t _oldOutputLow[2]; // Data needed for oscillator model diff --git a/webrtc/voice_engine/level_indicator.h b/webrtc/voice_engine/level_indicator.h index 0f146ce36c..95ca7c133c 100644 --- a/webrtc/voice_engine/level_indicator.h +++ b/webrtc/voice_engine/level_indicator.h @@ -40,7 +40,7 @@ public: private: enum { kUpdateFrequency = 10}; - mutable rtc::CriticalSection _critSect; + rtc::CriticalSection _critSect; int16_t _absMax; int16_t _count; diff --git a/webrtc/voice_engine/shared_data.h b/webrtc/voice_engine/shared_data.h index d9551cf1d3..1d96103a98 100644 --- a/webrtc/voice_engine/shared_data.h +++ b/webrtc/voice_engine/shared_data.h @@ -63,7 +63,7 @@ public: protected: const uint32_t _instanceId; - mutable rtc::CriticalSection _apiCritPtr; + rtc::CriticalSection _apiCritPtr; ChannelManager _channelManager; Statistics _engineStatistics; AudioDeviceModule* _audioDevicePtr; diff --git a/webrtc/voice_engine/statistics.h b/webrtc/voice_engine/statistics.h index e853e6854e..785fe14ed7 100644 --- a/webrtc/voice_engine/statistics.h +++ b/webrtc/voice_engine/statistics.h @@ -39,7 +39,7 @@ class Statistics int32_t LastError() const; private: - mutable rtc::CriticalSection lock_; + rtc::CriticalSection lock_; const uint32_t _instanceId; mutable int32_t _lastError; bool _isInitialized; diff --git a/webrtc/voice_engine/test/auto_test/fakes/conference_transport.h b/webrtc/voice_engine/test/auto_test/fakes/conference_transport.h index 6b780e3b81..cce6148f7e 100644 --- a/webrtc/voice_engine/test/auto_test/fakes/conference_transport.h +++ b/webrtc/voice_engine/test/auto_test/fakes/conference_transport.h @@ -128,8 +128,8 @@ class ConferenceTransport: public webrtc::Transport { void SendPacket(const Packet& packet); bool DispatchPackets(); - mutable rtc::CriticalSection pq_crit_; - mutable rtc::CriticalSection stream_crit_; + rtc::CriticalSection pq_crit_; + rtc::CriticalSection stream_crit_; const rtc::scoped_ptr packet_event_; rtc::PlatformThread thread_; diff --git a/webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h b/webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h index 843be848e6..46b7abf097 100644 --- a/webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h +++ b/webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h @@ -142,7 +142,7 @@ class LoopBackTransport : public webrtc::Transport { return true; } - mutable rtc::CriticalSection crit_; + rtc::CriticalSection crit_; const rtc::scoped_ptr packet_event_; rtc::PlatformThread thread_; std::deque packet_queue_ GUARDED_BY(crit_);