Remove mutable from rtc::CriticalSection members.

rtc::CriticalSection is now lockable from const methods and no longer
need to remain mutable.

BUG=
R=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1613643004

Cr-Commit-Position: refs/heads/master@{#11367}
diff --git a/webrtc/modules/audio_coding/acm2/acm_receiver.h b/webrtc/modules/audio_coding/acm2/acm_receiver.h
index 826cb45..d1ca504 100644
--- a/webrtc/modules/audio_coding/acm2/acm_receiver.h
+++ b/webrtc/modules/audio_coding/acm2/acm_receiver.h
@@ -281,7 +281,7 @@
 
   uint32_t NowInTimestamp(int decoder_sampling_rate) const;
 
-  mutable rtc::CriticalSection crit_sect_;
+  rtc::CriticalSection crit_sect_;
   int id_;  // TODO(henrik.lundin) Make const.
   const Decoder* last_audio_decoder_ GUARDED_BY(crit_sect_);
   AudioFrame::VADActivity previous_audio_activity_ GUARDED_BY(crit_sect_);
diff --git a/webrtc/modules/audio_coding/acm2/audio_coding_module_impl.h b/webrtc/modules/audio_coding/acm2/audio_coding_module_impl.h
index 2a3bc61..6750a91 100644
--- a/webrtc/modules/audio_coding/acm2/audio_coding_module_impl.h
+++ b/webrtc/modules/audio_coding/acm2/audio_coding_module_impl.h
@@ -240,7 +240,7 @@
   // to |index|.
   int UpdateUponReceivingCodec(int index);
 
-  mutable rtc::CriticalSection acm_crit_sect_;
+  rtc::CriticalSection acm_crit_sect_;
   rtc::Buffer encode_buffer_ GUARDED_BY(acm_crit_sect_);
   int id_;  // TODO(henrik.lundin) Make const.
   uint32_t expected_codec_ts_ GUARDED_BY(acm_crit_sect_);
@@ -274,7 +274,7 @@
   uint32_t last_timestamp_ GUARDED_BY(acm_crit_sect_);
   uint32_t last_rtp_timestamp_ GUARDED_BY(acm_crit_sect_);
 
-  mutable rtc::CriticalSection callback_crit_sect_;
+  rtc::CriticalSection callback_crit_sect_;
   AudioPacketizationCallback* packetization_callback_
       GUARDED_BY(callback_crit_sect_);
   ACMVADCallback* vad_callback_ GUARDED_BY(callback_crit_sect_);
diff --git a/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc b/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc
index c738d0f..384db86 100644
--- a/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc
+++ b/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc
@@ -147,7 +147,7 @@
   int last_payload_type_ GUARDED_BY(crit_sect_);
   uint32_t last_timestamp_ GUARDED_BY(crit_sect_);
   std::vector<uint8_t> last_payload_vec_ GUARDED_BY(crit_sect_);
-  mutable rtc::CriticalSection crit_sect_;
+  rtc::CriticalSection crit_sect_;
 };
 
 class AudioCodingModuleTestOldApi : public ::testing::Test {
@@ -579,7 +579,7 @@
   int send_count_;
   int insert_packet_count_;
   int pull_audio_count_ GUARDED_BY(crit_sect_);
-  mutable rtc::CriticalSection crit_sect_;
+  rtc::CriticalSection crit_sect_;
   int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_);
   rtc::scoped_ptr<SimulatedClock> fake_clock_;
 };
@@ -842,7 +842,7 @@
   rtc::PlatformThread receive_thread_;
   rtc::PlatformThread codec_registration_thread_;
   const rtc::scoped_ptr<EventWrapper> test_complete_;
-  mutable rtc::CriticalSection crit_sect_;
+  rtc::CriticalSection crit_sect_;
   bool codec_registered_ GUARDED_BY(crit_sect_);
   int receive_packet_count_ GUARDED_BY(crit_sect_);
   int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_);
diff --git a/webrtc/modules/audio_coding/codecs/isac/locked_bandwidth_info.h b/webrtc/modules/audio_coding/codecs/isac/locked_bandwidth_info.h
index 9996cbd..002af8c 100644
--- a/webrtc/modules/audio_coding/codecs/isac/locked_bandwidth_info.h
+++ b/webrtc/modules/audio_coding/codecs/isac/locked_bandwidth_info.h
@@ -36,7 +36,7 @@
   }
 
  private:
-  mutable rtc::CriticalSection lock_;
+  rtc::CriticalSection lock_;
   IsacBandwidthInfo bwinfo_ GUARDED_BY(lock_);
 };
 
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.h b/webrtc/modules/audio_coding/neteq/neteq_impl.h
index 817b697..02adcd3 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.h
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.h
@@ -338,7 +338,7 @@
   // Creates DecisionLogic object with the mode given by |playout_mode_|.
   virtual void CreateDecisionLogic() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
 
-  mutable rtc::CriticalSection crit_sect_;
+  rtc::CriticalSection crit_sect_;
   const rtc::scoped_ptr<BufferLevelFilter> buffer_level_filter_
       GUARDED_BY(crit_sect_);
   const rtc::scoped_ptr<DecoderDatabase> decoder_database_
diff --git a/webrtc/modules/audio_coding/test/Channel.h b/webrtc/modules/audio_coding/test/Channel.h
index 3dcd499..5910fad 100644
--- a/webrtc/modules/audio_coding/test/Channel.h
+++ b/webrtc/modules/audio_coding/test/Channel.h
@@ -100,7 +100,7 @@
   // 60msec * 32 sample(max)/msec * 2 description (maybe) * 2 bytes/sample
   uint8_t _payloadData[60 * 32 * 2 * 2];
 
-  mutable rtc::CriticalSection _channelCritSect;
+  rtc::CriticalSection _channelCritSect;
   FILE* _bitStreamFile;
   bool _saveBitStream;
   int16_t _lastPayloadType;
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.h b/webrtc/modules/audio_processing/audio_processing_impl.h
index fbb9b6e..5da3996 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.h
+++ b/webrtc/modules/audio_processing/audio_processing_impl.h
@@ -239,15 +239,15 @@
       EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
 
   // Critical section.
-  mutable rtc::CriticalSection crit_debug_;
+  rtc::CriticalSection crit_debug_;
 
   // Debug dump state.
   ApmDebugDumpState debug_dump_;
 #endif
 
   // Critical sections.
-  mutable rtc::CriticalSection crit_render_ ACQUIRED_BEFORE(crit_capture_);
-  mutable rtc::CriticalSection crit_capture_;
+  rtc::CriticalSection crit_render_ ACQUIRED_BEFORE(crit_capture_);
+  rtc::CriticalSection crit_capture_;
 
   // Structs containing the pointers to the submodules.
   rtc::scoped_ptr<ApmPublicSubmodules> public_submodules_;
diff --git a/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc b/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc
index e1e6a31..3d2c71f 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc
@@ -298,7 +298,7 @@
   }
 
  private:
-  mutable rtc::CriticalSection crit_;
+  rtc::CriticalSection crit_;
   int render_count GUARDED_BY(crit_) = 0;
   int capture_count GUARDED_BY(crit_) = 0;
 };
diff --git a/webrtc/modules/audio_processing/audio_processing_performance_unittest.cc b/webrtc/modules/audio_processing/audio_processing_performance_unittest.cc
index 0c8c060..285f600 100644
--- a/webrtc/modules/audio_processing/audio_processing_performance_unittest.cc
+++ b/webrtc/modules/audio_processing/audio_processing_performance_unittest.cc
@@ -202,7 +202,7 @@
   }
 
  private:
-  mutable rtc::CriticalSection crit_;
+  rtc::CriticalSection crit_;
   int render_count_ GUARDED_BY(crit_) = 0;
   int capture_count_ GUARDED_BY(crit_) = 0;
 };
@@ -221,7 +221,7 @@
   }
 
  private:
-  mutable rtc::CriticalSection crit_;
+  rtc::CriticalSection crit_;
   bool flag_ GUARDED_BY(crit_) = false;
 };
 
diff --git a/webrtc/modules/bitrate_controller/bitrate_controller_impl.h b/webrtc/modules/bitrate_controller/bitrate_controller_impl.h
index d7888cc..74f3c14 100644
--- a/webrtc/modules/bitrate_controller/bitrate_controller_impl.h
+++ b/webrtc/modules/bitrate_controller/bitrate_controller_impl.h
@@ -74,7 +74,7 @@
   BitrateObserver* observer_;
   int64_t last_bitrate_update_ms_;
 
-  mutable rtc::CriticalSection critsect_;
+  rtc::CriticalSection critsect_;
   SendSideBandwidthEstimation bandwidth_estimation_ GUARDED_BY(critsect_);
   uint32_t reserved_bitrate_bps_ GUARDED_BY(critsect_);
 
diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_frame_buffer_pool.h b/webrtc/modules/video_coding/codecs/vp9/vp9_frame_buffer_pool.h
index 97ed41a..8551689 100644
--- a/webrtc/modules/video_coding/codecs/vp9/vp9_frame_buffer_pool.h
+++ b/webrtc/modules/video_coding/codecs/vp9/vp9_frame_buffer_pool.h
@@ -9,8 +9,8 @@
  *
  */
 
-#ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_FRAME_BUFFER_POOL_H_
-#define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_FRAME_BUFFER_POOL_H_
+#ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_VP9_FRAME_BUFFER_POOL_H_
+#define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_VP9_FRAME_BUFFER_POOL_H_
 
 #include <vector>
 
@@ -103,7 +103,7 @@
 
  private:
   // Protects |allocated_buffers_|.
-  mutable rtc::CriticalSection buffers_lock_;
+  rtc::CriticalSection buffers_lock_;
   // All buffers, in use or ready to be recycled.
   std::vector<rtc::scoped_refptr<Vp9FrameBuffer>> allocated_buffers_
       GUARDED_BY(buffers_lock_);
@@ -114,4 +114,4 @@
 
 }  // namespace webrtc
 
-#endif  // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_FRAME_BUFFER_POOL_H_
+#endif  // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_VP9_FRAME_BUFFER_POOL_H_
diff --git a/webrtc/modules/video_coding/generic_encoder.h b/webrtc/modules/video_coding/generic_encoder.h
index f739edb..da7297f 100644
--- a/webrtc/modules/video_coding/generic_encoder.h
+++ b/webrtc/modules/video_coding/generic_encoder.h
@@ -138,7 +138,7 @@
   VideoEncoderRateObserver* const rate_observer_;
   VCMEncodedFrameCallback* const vcm_encoded_frame_callback_;
   const bool internal_source_;
-  mutable rtc::CriticalSection params_lock_;
+  rtc::CriticalSection params_lock_;
   EncoderParameters encoder_params_ GUARDED_BY(params_lock_);
   VideoRotation rotation_;
   bool is_screenshare_;
diff --git a/webrtc/modules/video_coding/video_coding_impl.h b/webrtc/modules/video_coding/video_coding_impl.h
index 1ed96e1..7373325 100644
--- a/webrtc/modules/video_coding/video_coding_impl.h
+++ b/webrtc/modules/video_coding/video_coding_impl.h
@@ -104,7 +104,7 @@
   Clock* const clock_;
 
   rtc::scoped_ptr<CriticalSectionWrapper> process_crit_sect_;
-  mutable rtc::CriticalSection encoder_crit_;
+  rtc::CriticalSection encoder_crit_;
   VCMGenericEncoder* _encoder;
   VCMEncodedFrameCallback _encodedFrameCallback GUARDED_BY(encoder_crit_);
   media_optimization::MediaOptimization _mediaOpt;
diff --git a/webrtc/modules/video_processing/video_processing_impl.h b/webrtc/modules/video_processing/video_processing_impl.h
index edbaba1..1d9a377 100644
--- a/webrtc/modules/video_processing/video_processing_impl.h
+++ b/webrtc/modules/video_processing/video_processing_impl.h
@@ -44,7 +44,7 @@
   VideoContentMetrics* GetContentMetrics() const override;
 
  private:
-  mutable rtc::CriticalSection mutex_;
+  rtc::CriticalSection mutex_;
   VPMDeflickering deflickering_ GUARDED_BY(mutex_);
   VPMBrightnessDetection brightness_detection_;
   VPMFramePreprocessor frame_pre_processor_;