Update thread annotiation macros to use RTC_ prefix

BUG=webrtc:8198

Review-Url: https://codereview.webrtc.org/3012853002
Cr-Original-Commit-Position: refs/heads/master@{#19760}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: a37de39216cccecb1448725b7dbd00bb69c52360
diff --git a/api/statstypes.h b/api/statstypes.h
index 378b014..6391ff5 100644
--- a/api/statstypes.h
+++ b/api/statstypes.h
@@ -335,7 +335,7 @@
 
    private:
     rtc::ThreadChecker thread_checker_;
-    mutable int ref_count_ ACCESS_ON(thread_checker_) = 0;
+    mutable int ref_count_ RTC_ACCESS_ON(thread_checker_) = 0;
 
     const Type type_;
     // TODO(tommi): Use C++ 11 union and make value_ const.
diff --git a/audio/audio_receive_stream.h b/audio/audio_receive_stream.h
index dc7992f..0615dc1 100644
--- a/audio/audio_receive_stream.h
+++ b/audio/audio_receive_stream.h
@@ -90,7 +90,7 @@
   rtc::scoped_refptr<webrtc::AudioState> audio_state_;
   std::unique_ptr<voe::ChannelProxy> channel_proxy_;
 
-  bool playing_ ACCESS_ON(worker_thread_checker_) = false;
+  bool playing_ RTC_ACCESS_ON(worker_thread_checker_) = false;
 
   std::unique_ptr<RtpStreamReceiverInterface> rtp_stream_receiver_;
 
diff --git a/audio/audio_send_stream.h b/audio/audio_send_stream.h
index f46608d..cf36c13 100644
--- a/audio/audio_send_stream.h
+++ b/audio/audio_send_stream.h
@@ -115,7 +115,7 @@
 
   rtc::CriticalSection packet_loss_tracker_cs_;
   TransportFeedbackPacketLossTracker packet_loss_tracker_
-      GUARDED_BY(&packet_loss_tracker_cs_);
+      RTC_GUARDED_BY(&packet_loss_tracker_cs_);
 
   RtpRtcp* rtp_rtcp_module_;
   rtc::Optional<RtpState> const suspended_rtp_state_;
diff --git a/audio/audio_state.h b/audio/audio_state.h
index c8ce44b..893c1f9 100644
--- a/audio/audio_state.h
+++ b/audio/audio_state.h
@@ -55,7 +55,7 @@
   // The critical section isn't strictly needed in this case, but xSAN bots may
   // trigger on unprotected cross-thread access.
   rtc::CriticalSection crit_sect_;
-  bool typing_noise_detected_ GUARDED_BY(crit_sect_) = false;
+  bool typing_noise_detected_ RTC_GUARDED_BY(crit_sect_) = false;
 
   // Reference count; implementation copied from rtc::RefCountedObject.
   mutable volatile int ref_count_ = 0;
diff --git a/call/bitrate_allocator.h b/call/bitrate_allocator.h
index b36d38e..b9bbc93 100644
--- a/call/bitrate_allocator.h
+++ b/call/bitrate_allocator.h
@@ -153,20 +153,20 @@
                                     uint32_t sum_min_bitrates);
 
   rtc::SequencedTaskChecker sequenced_checker_;
-  LimitObserver* const limit_observer_ GUARDED_BY(&sequenced_checker_);
+  LimitObserver* const limit_observer_ RTC_GUARDED_BY(&sequenced_checker_);
   // Stored in a list to keep track of the insertion order.
-  ObserverConfigs bitrate_observer_configs_ GUARDED_BY(&sequenced_checker_);
-  uint32_t last_bitrate_bps_ GUARDED_BY(&sequenced_checker_);
-  uint32_t last_non_zero_bitrate_bps_ GUARDED_BY(&sequenced_checker_);
-  uint8_t last_fraction_loss_ GUARDED_BY(&sequenced_checker_);
-  int64_t last_rtt_ GUARDED_BY(&sequenced_checker_);
-  int64_t last_bwe_period_ms_ GUARDED_BY(&sequenced_checker_);
+  ObserverConfigs bitrate_observer_configs_ RTC_GUARDED_BY(&sequenced_checker_);
+  uint32_t last_bitrate_bps_ RTC_GUARDED_BY(&sequenced_checker_);
+  uint32_t last_non_zero_bitrate_bps_ RTC_GUARDED_BY(&sequenced_checker_);
+  uint8_t last_fraction_loss_ RTC_GUARDED_BY(&sequenced_checker_);
+  int64_t last_rtt_ RTC_GUARDED_BY(&sequenced_checker_);
+  int64_t last_bwe_period_ms_ RTC_GUARDED_BY(&sequenced_checker_);
   // Number of mute events based on too low BWE, not network up/down.
-  int num_pause_events_ GUARDED_BY(&sequenced_checker_);
-  Clock* const clock_ GUARDED_BY(&sequenced_checker_);
-  int64_t last_bwe_log_time_ GUARDED_BY(&sequenced_checker_);
-  uint32_t total_requested_padding_bitrate_ GUARDED_BY(&sequenced_checker_);
-  uint32_t total_requested_min_bitrate_ GUARDED_BY(&sequenced_checker_);
+  int num_pause_events_ RTC_GUARDED_BY(&sequenced_checker_);
+  Clock* const clock_ RTC_GUARDED_BY(&sequenced_checker_);
+  int64_t last_bwe_log_time_ RTC_GUARDED_BY(&sequenced_checker_);
+  uint32_t total_requested_padding_bitrate_ RTC_GUARDED_BY(&sequenced_checker_);
+  uint32_t total_requested_min_bitrate_ RTC_GUARDED_BY(&sequenced_checker_);
 };
 }  // namespace webrtc
 #endif  // WEBRTC_CALL_BITRATE_ALLOCATOR_H_
diff --git a/call/bitrate_estimator_tests.cc b/call/bitrate_estimator_tests.cc
index 5d4acbb..49f149b 100644
--- a/call/bitrate_estimator_tests.cc
+++ b/call/bitrate_estimator_tests.cc
@@ -83,8 +83,8 @@
    private:
     typedef std::list<std::string> Strings;
     rtc::CriticalSection crit_sect_;
-    Strings received_log_lines_ GUARDED_BY(crit_sect_);
-    Strings expected_log_lines_ GUARDED_BY(crit_sect_);
+    Strings received_log_lines_ RTC_GUARDED_BY(crit_sect_);
+    Strings expected_log_lines_ RTC_GUARDED_BY(crit_sect_);
     rtc::Event done_;
   };
 
diff --git a/call/call.cc b/call/call.cc
index e8b51f9..b7cd059 100644
--- a/call/call.cc
+++ b/call/call.cc
@@ -236,11 +236,11 @@
                             size_t length,
                             const PacketTime& packet_time);
   void ConfigureSync(const std::string& sync_group)
-      EXCLUSIVE_LOCKS_REQUIRED(receive_crit_);
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(receive_crit_);
 
   void NotifyBweOfReceivedPacket(const RtpPacketReceived& packet,
                                  MediaType media_type)
-      SHARED_LOCKS_REQUIRED(receive_crit_);
+      RTC_SHARED_LOCKS_REQUIRED(receive_crit_);
 
   rtc::Optional<RtpPacketReceived> ParseRtpPacket(
       const uint8_t* packet,
@@ -248,7 +248,7 @@
       const PacketTime* packet_time) const;
 
   void UpdateSendHistograms(int64_t first_sent_packet_ms)
-      EXCLUSIVE_LOCKS_REQUIRED(&bitrate_crit_);
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(&bitrate_crit_);
   void UpdateReceiveHistograms();
   void UpdateHistograms();
   void UpdateAggregateNetworkState();
@@ -274,12 +274,12 @@
   // Audio, Video, and FlexFEC receive streams are owned by the client that
   // creates them.
   std::set<AudioReceiveStream*> audio_receive_streams_
-      GUARDED_BY(receive_crit_);
+      RTC_GUARDED_BY(receive_crit_);
   std::set<VideoReceiveStream*> video_receive_streams_
-      GUARDED_BY(receive_crit_);
+      RTC_GUARDED_BY(receive_crit_);
 
   std::map<std::string, AudioReceiveStream*> sync_stream_mapping_
-      GUARDED_BY(receive_crit_);
+      RTC_GUARDED_BY(receive_crit_);
 
   // TODO(nisse): Should eventually be injected at creation,
   // with a single object in the bundled case.
@@ -308,19 +308,21 @@
     bool use_send_side_bwe = false;
   };
   std::map<uint32_t, ReceiveRtpConfig> receive_rtp_config_
-      GUARDED_BY(receive_crit_);
+      RTC_GUARDED_BY(receive_crit_);
 
   std::unique_ptr<RWLockWrapper> send_crit_;
   // Audio and Video send streams are owned by the client that creates them.
-  std::map<uint32_t, AudioSendStream*> audio_send_ssrcs_ GUARDED_BY(send_crit_);
-  std::map<uint32_t, VideoSendStream*> video_send_ssrcs_ GUARDED_BY(send_crit_);
-  std::set<VideoSendStream*> video_send_streams_ GUARDED_BY(send_crit_);
+  std::map<uint32_t, AudioSendStream*> audio_send_ssrcs_
+      RTC_GUARDED_BY(send_crit_);
+  std::map<uint32_t, VideoSendStream*> video_send_ssrcs_
+      RTC_GUARDED_BY(send_crit_);
+  std::set<VideoSendStream*> video_send_streams_ RTC_GUARDED_BY(send_crit_);
 
   using RtpStateMap = std::map<uint32_t, RtpState>;
   RtpStateMap suspended_audio_send_ssrcs_
-      GUARDED_BY(configuration_sequence_checker_);
+      RTC_GUARDED_BY(configuration_sequence_checker_);
   RtpStateMap suspended_video_send_ssrcs_
-      GUARDED_BY(configuration_sequence_checker_);
+      RTC_GUARDED_BY(configuration_sequence_checker_);
 
   webrtc::RtcEventLog* event_log_;
 
@@ -340,10 +342,11 @@
   // TODO(holmer): Remove this lock once BitrateController no longer calls
   // OnNetworkChanged from multiple threads.
   rtc::CriticalSection bitrate_crit_;
-  uint32_t min_allocated_send_bitrate_bps_ GUARDED_BY(&bitrate_crit_);
-  uint32_t configured_max_padding_bitrate_bps_ GUARDED_BY(&bitrate_crit_);
-  AvgCounter estimated_send_bitrate_kbps_counter_ GUARDED_BY(&bitrate_crit_);
-  AvgCounter pacer_bitrate_kbps_counter_ GUARDED_BY(&bitrate_crit_);
+  uint32_t min_allocated_send_bitrate_bps_ RTC_GUARDED_BY(&bitrate_crit_);
+  uint32_t configured_max_padding_bitrate_bps_ RTC_GUARDED_BY(&bitrate_crit_);
+  AvgCounter estimated_send_bitrate_kbps_counter_
+      RTC_GUARDED_BY(&bitrate_crit_);
+  AvgCounter pacer_bitrate_kbps_counter_ RTC_GUARDED_BY(&bitrate_crit_);
 
   std::map<std::string, rtc::NetworkRoute> network_routes_;
 
diff --git a/call/call_perf_tests.cc b/call/call_perf_tests.cc
index 29dd0e4..46611a1 100644
--- a/call/call_perf_tests.cc
+++ b/call/call_perf_tests.cc
@@ -131,7 +131,7 @@
   const int64_t creation_time_ms_;
   int64_t first_time_in_sync_;
   rtc::CriticalSection crit_;
-  VideoReceiveStream* receive_stream_ GUARDED_BY(crit_);
+  VideoReceiveStream* receive_stream_ RTC_GUARDED_BY(crit_);
   std::vector<int> sync_offset_ms_list_;
 };
 
@@ -463,7 +463,7 @@
     bool rtp_start_timestamp_set_;
     uint32_t rtp_start_timestamp_;
     typedef std::map<uint32_t, uint32_t> FrameCaptureTimeList;
-    FrameCaptureTimeList capture_time_list_ GUARDED_BY(&crit_);
+    FrameCaptureTimeList capture_time_list_ RTC_GUARDED_BY(&crit_);
     std::vector<int> time_offset_ms_list_;
   } test(net_config, threshold_ms, start_time_ms, run_time_ms);
 
diff --git a/call/rtp_stream_receiver_controller.h b/call/rtp_stream_receiver_controller.h
index 4583b9d..feec5e4 100644
--- a/call/rtp_stream_receiver_controller.h
+++ b/call/rtp_stream_receiver_controller.h
@@ -64,7 +64,7 @@
   // by a single, but possibly distinct, thread. But applications not
   // using Call may have use threads differently.
   rtc::CriticalSection lock_;
-  RtpDemuxer demuxer_ GUARDED_BY(&lock_);
+  RtpDemuxer demuxer_ RTC_GUARDED_BY(&lock_);
 };
 
 }  // namespace webrtc
diff --git a/common_video/include/bitrate_adjuster.h b/common_video/include/bitrate_adjuster.h
index 1b70ebd..d04486c 100644
--- a/common_video/include/bitrate_adjuster.h
+++ b/common_video/include/bitrate_adjuster.h
@@ -59,29 +59,30 @@
   bool IsWithinTolerance(uint32_t bitrate_bps, uint32_t target_bitrate_bps);
 
   // Returns smallest possible adjusted value.
-  uint32_t GetMinAdjustedBitrateBps() const EXCLUSIVE_LOCKS_REQUIRED(crit_);
+  uint32_t GetMinAdjustedBitrateBps() const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
   // Returns largest possible adjusted value.
-  uint32_t GetMaxAdjustedBitrateBps() const EXCLUSIVE_LOCKS_REQUIRED(crit_);
+  uint32_t GetMaxAdjustedBitrateBps() const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
 
   void Reset();
-  void UpdateBitrate(uint32_t current_time_ms) EXCLUSIVE_LOCKS_REQUIRED(crit_);
+  void UpdateBitrate(uint32_t current_time_ms)
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
 
   rtc::CriticalSection crit_;
   Clock* const clock_;
   const float min_adjusted_bitrate_pct_;
   const float max_adjusted_bitrate_pct_;
   // The bitrate we want.
-  volatile uint32_t target_bitrate_bps_ GUARDED_BY(crit_);
+  volatile uint32_t target_bitrate_bps_ RTC_GUARDED_BY(crit_);
   // The bitrate we use to get what we want.
-  volatile uint32_t adjusted_bitrate_bps_ GUARDED_BY(crit_);
+  volatile uint32_t adjusted_bitrate_bps_ RTC_GUARDED_BY(crit_);
   // The target bitrate that the adjusted bitrate was computed from.
-  volatile uint32_t last_adjusted_target_bitrate_bps_ GUARDED_BY(crit_);
+  volatile uint32_t last_adjusted_target_bitrate_bps_ RTC_GUARDED_BY(crit_);
   // Used to estimate bitrate.
-  RateStatistics bitrate_tracker_ GUARDED_BY(crit_);
+  RateStatistics bitrate_tracker_ RTC_GUARDED_BY(crit_);
   // The last time we tried to adjust the bitrate.
-  uint32_t last_bitrate_update_time_ms_ GUARDED_BY(crit_);
+  uint32_t last_bitrate_update_time_ms_ RTC_GUARDED_BY(crit_);
   // The number of frames since the last time we tried to adjust the bitrate.
-  uint32_t frames_since_last_update_ GUARDED_BY(crit_);
+  uint32_t frames_since_last_update_ RTC_GUARDED_BY(crit_);
 };
 
 }  // namespace webrtc
diff --git a/logging/rtc_event_log/rtc_event_log.cc b/logging/rtc_event_log/rtc_event_log.cc
index d1cad89..7c295aa 100644
--- a/logging/rtc_event_log/rtc_event_log.cc
+++ b/logging/rtc_event_log/rtc_event_log.cc
@@ -168,15 +168,16 @@
 
   // History containing all past configuration events.
   std::vector<std::unique_ptr<rtclog::Event>> config_history_
-      ACCESS_ON(task_queue_);
+      RTC_ACCESS_ON(task_queue_);
 
   // History containing the most recent (non-configuration) events (~10s).
-  std::deque<std::unique_ptr<rtclog::Event>> history_ ACCESS_ON(task_queue_);
+  std::deque<std::unique_ptr<rtclog::Event>> history_
+      RTC_ACCESS_ON(task_queue_);
 
-  std::unique_ptr<FileWrapper> file_ ACCESS_ON(task_queue_);
+  std::unique_ptr<FileWrapper> file_ RTC_ACCESS_ON(task_queue_);
 
-  size_t max_size_bytes_ ACCESS_ON(task_queue_);
-  size_t written_bytes_ ACCESS_ON(task_queue_);
+  size_t max_size_bytes_ RTC_ACCESS_ON(task_queue_);
+  size_t written_bytes_ RTC_ACCESS_ON(task_queue_);
 
   // Keep this last to ensure it destructs first, or else tasks living on the
   // queue might access other members after they've been torn down.
diff --git a/media/base/adaptedvideotracksource.h b/media/base/adaptedvideotracksource.h
index 9d51c69..7189996 100644
--- a/media/base/adaptedvideotracksource.h
+++ b/media/base/adaptedvideotracksource.h
@@ -74,7 +74,7 @@
   cricket::VideoAdapter video_adapter_;
 
   rtc::CriticalSection stats_crit_;
-  rtc::Optional<Stats> stats_ GUARDED_BY(stats_crit_);
+  rtc::Optional<Stats> stats_ RTC_GUARDED_BY(stats_crit_);
 
   VideoBroadcaster broadcaster_;
 };
diff --git a/media/base/videoadapter.h b/media/base/videoadapter.h
index 61de4b5..aa786af 100644
--- a/media/base/videoadapter.h
+++ b/media/base/videoadapter.h
@@ -75,15 +75,17 @@
   // Resolution must be divisible by this factor.
   const int required_resolution_alignment_;
   // The target timestamp for the next frame based on requested format.
-  rtc::Optional<int64_t> next_frame_timestamp_ns_ GUARDED_BY(critical_section_);
+  rtc::Optional<int64_t> next_frame_timestamp_ns_
+      RTC_GUARDED_BY(critical_section_);
 
   // Max number of pixels requested via calls to OnOutputFormatRequest,
   // OnResolutionRequest respectively.
   // The adapted output format is the minimum of these.
-  rtc::Optional<VideoFormat> requested_format_ GUARDED_BY(critical_section_);
-  int resolution_request_target_pixel_count_ GUARDED_BY(critical_section_);
-  int resolution_request_max_pixel_count_ GUARDED_BY(critical_section_);
-  int max_framerate_request_ GUARDED_BY(critical_section_);
+  rtc::Optional<VideoFormat> requested_format_
+      RTC_GUARDED_BY(critical_section_);
+  int resolution_request_target_pixel_count_ RTC_GUARDED_BY(critical_section_);
+  int resolution_request_max_pixel_count_ RTC_GUARDED_BY(critical_section_);
+  int max_framerate_request_ RTC_GUARDED_BY(critical_section_);
 
   // The critical section to protect the above variables.
   rtc::CriticalSection critical_section_;
diff --git a/media/base/videobroadcaster.h b/media/base/videobroadcaster.h
index 312ec7b..32fefdd 100644
--- a/media/base/videobroadcaster.h
+++ b/media/base/videobroadcaster.h
@@ -51,15 +51,15 @@
   void OnFrame(const webrtc::VideoFrame& frame) override;
 
  protected:
-  void UpdateWants() EXCLUSIVE_LOCKS_REQUIRED(sinks_and_wants_lock_);
+  void UpdateWants() RTC_EXCLUSIVE_LOCKS_REQUIRED(sinks_and_wants_lock_);
   const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& GetBlackFrameBuffer(
-      int width, int height)
-      EXCLUSIVE_LOCKS_REQUIRED(sinks_and_wants_lock_);
+      int width,
+      int height) RTC_EXCLUSIVE_LOCKS_REQUIRED(sinks_and_wants_lock_);
 
   ThreadChecker thread_checker_;
   rtc::CriticalSection sinks_and_wants_lock_;
 
-  VideoSinkWants current_wants_ GUARDED_BY(sinks_and_wants_lock_);
+  VideoSinkWants current_wants_ RTC_GUARDED_BY(sinks_and_wants_lock_);
   rtc::scoped_refptr<webrtc::VideoFrameBuffer> black_frame_buffer_;
 };
 
diff --git a/media/base/videocapturer.h b/media/base/videocapturer.h
index a65d40e..10c5df9 100644
--- a/media/base/videocapturer.h
+++ b/media/base/videocapturer.h
@@ -271,9 +271,9 @@
 
   rtc::CriticalSection frame_stats_crit_;
   // The captured frame size before potential adapation.
-  bool input_size_valid_ GUARDED_BY(frame_stats_crit_) = false;
-  int input_width_ GUARDED_BY(frame_stats_crit_);
-  int input_height_ GUARDED_BY(frame_stats_crit_);
+  bool input_size_valid_ RTC_GUARDED_BY(frame_stats_crit_) = false;
+  int input_width_ RTC_GUARDED_BY(frame_stats_crit_);
+  int input_height_ RTC_GUARDED_BY(frame_stats_crit_);
 
   // Whether capturer should apply rotation to the frame before
   // passing it on to the registered sinks.
diff --git a/media/engine/fakewebrtcvideoengine.h b/media/engine/fakewebrtcvideoengine.h
index 604728c..e9afc76 100644
--- a/media/engine/fakewebrtcvideoengine.h
+++ b/media/engine/fakewebrtcvideoengine.h
@@ -172,8 +172,8 @@
  private:
   rtc::CriticalSection crit_;
   rtc::Event init_encode_event_;
-  int num_frames_encoded_ GUARDED_BY(crit_);
-  webrtc::VideoCodec codec_settings_ GUARDED_BY(crit_);
+  int num_frames_encoded_ RTC_GUARDED_BY(crit_);
+  webrtc::VideoCodec codec_settings_ RTC_GUARDED_BY(crit_);
 };
 
 // Fake class for mocking out WebRtcVideoEncoderFactory.
@@ -250,8 +250,8 @@
   rtc::CriticalSection crit_;
   rtc::Event created_video_encoder_event_;
   std::vector<cricket::VideoCodec> codecs_;
-  std::vector<FakeWebRtcVideoEncoder*> encoders_ GUARDED_BY(crit_);
-  int num_created_encoders_ GUARDED_BY(crit_);
+  std::vector<FakeWebRtcVideoEncoder*> encoders_ RTC_GUARDED_BY(crit_);
+  int num_created_encoders_ RTC_GUARDED_BY(crit_);
   bool encoders_have_internal_sources_;
 };
 
diff --git a/media/engine/webrtcvideoengine.h b/media/engine/webrtcvideoengine.h
index 7710c04..81a85c8 100644
--- a/media/engine/webrtcvideoengine.h
+++ b/media/engine/webrtcvideoengine.h
@@ -241,11 +241,11 @@
       webrtc::FlexfecReceiveStream::Config* flexfec_config,
       const StreamParams& sp) const;
   bool ValidateSendSsrcAvailability(const StreamParams& sp) const
-      EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
   bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const
-      EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
   void DeleteReceiveStream(WebRtcVideoReceiveStream* stream)
-      EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
 
   static std::string CodecSettingsVectorToString(
       const std::vector<VideoCodecSettings>& codecs);
@@ -326,38 +326,38 @@
     void UpdateSendState();
 
     webrtc::VideoSendStream::DegradationPreference GetDegradationPreference()
-        const EXCLUSIVE_LOCKS_REQUIRED(&thread_checker_);
+        const RTC_EXCLUSIVE_LOCKS_REQUIRED(&thread_checker_);
 
     rtc::ThreadChecker thread_checker_;
     rtc::AsyncInvoker invoker_;
     rtc::Thread* worker_thread_;
-    const std::vector<uint32_t> ssrcs_ ACCESS_ON(&thread_checker_);
-    const std::vector<SsrcGroup> ssrc_groups_ ACCESS_ON(&thread_checker_);
+    const std::vector<uint32_t> ssrcs_ RTC_ACCESS_ON(&thread_checker_);
+    const std::vector<SsrcGroup> ssrc_groups_ RTC_ACCESS_ON(&thread_checker_);
     webrtc::Call* const call_;
     const bool enable_cpu_overuse_detection_;
     rtc::VideoSourceInterface<webrtc::VideoFrame>* source_
-        ACCESS_ON(&thread_checker_);
+        RTC_ACCESS_ON(&thread_checker_);
     std::unique_ptr<EncoderFactoryAdapter> encoder_factory_
-        ACCESS_ON(&thread_checker_);
+        RTC_ACCESS_ON(&thread_checker_);
 
-    webrtc::VideoSendStream* stream_ ACCESS_ON(&thread_checker_);
+    webrtc::VideoSendStream* stream_ RTC_ACCESS_ON(&thread_checker_);
     rtc::VideoSinkInterface<webrtc::VideoFrame>* encoder_sink_
-        ACCESS_ON(&thread_checker_);
+        RTC_ACCESS_ON(&thread_checker_);
     // Contains settings that are the same for all streams in the MediaChannel,
     // such as codecs, header extensions, and the global bitrate limit for the
     // entire channel.
-    VideoSendStreamParameters parameters_ ACCESS_ON(&thread_checker_);
+    VideoSendStreamParameters parameters_ RTC_ACCESS_ON(&thread_checker_);
     // Contains settings that are unique for each stream, such as max_bitrate.
     // Does *not* contain codecs, however.
     // TODO(skvlad): Move ssrcs_ and ssrc_groups_ into rtp_parameters_.
     // TODO(skvlad): Combine parameters_ and rtp_parameters_ once we have only
     // one stream per MediaChannel.
-    webrtc::RtpParameters rtp_parameters_ ACCESS_ON(&thread_checker_);
+    webrtc::RtpParameters rtp_parameters_ RTC_ACCESS_ON(&thread_checker_);
     std::unique_ptr<webrtc::VideoEncoder> allocated_encoder_
-        ACCESS_ON(&thread_checker_);
-    VideoCodec allocated_codec_ ACCESS_ON(&thread_checker_);
+        RTC_ACCESS_ON(&thread_checker_);
+    VideoCodec allocated_codec_ RTC_ACCESS_ON(&thread_checker_);
 
-    bool sending_ ACCESS_ON(&thread_checker_);
+    bool sending_ RTC_ACCESS_ON(&thread_checker_);
   };
 
   // Wrapper for the receiver part, contains configs etc. that are needed to
@@ -437,15 +437,16 @@
     std::vector<AllocatedDecoder> allocated_decoders_;
 
     rtc::CriticalSection sink_lock_;
-    rtc::VideoSinkInterface<webrtc::VideoFrame>* sink_ GUARDED_BY(sink_lock_);
+    rtc::VideoSinkInterface<webrtc::VideoFrame>* sink_
+        RTC_GUARDED_BY(sink_lock_);
     // Expands remote RTP timestamps to int64_t to be able to estimate how long
     // the stream has been running.
     rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_
-        GUARDED_BY(sink_lock_);
-    int64_t first_frame_timestamp_ GUARDED_BY(sink_lock_);
+        RTC_GUARDED_BY(sink_lock_);
+    int64_t first_frame_timestamp_ RTC_GUARDED_BY(sink_lock_);
     // Start NTP time is estimated as current remote NTP time (estimated from
     // RTCP) minus the elapsed time, as soon as remote NTP time is available.
-    int64_t estimated_remote_start_ntp_time_ms_ GUARDED_BY(sink_lock_);
+    int64_t estimated_remote_start_ntp_time_ms_ RTC_GUARDED_BY(sink_lock_);
   };
 
   void Construct(webrtc::Call* call, WebRtcVideoEngine* engine);
@@ -487,11 +488,11 @@
   rtc::CriticalSection stream_crit_;
   // Using primary-ssrc (first ssrc) as key.
   std::map<uint32_t, WebRtcVideoSendStream*> send_streams_
-      GUARDED_BY(stream_crit_);
+      RTC_GUARDED_BY(stream_crit_);
   std::map<uint32_t, WebRtcVideoReceiveStream*> receive_streams_
-      GUARDED_BY(stream_crit_);
-  std::set<uint32_t> send_ssrcs_ GUARDED_BY(stream_crit_);
-  std::set<uint32_t> receive_ssrcs_ GUARDED_BY(stream_crit_);
+      RTC_GUARDED_BY(stream_crit_);
+  std::set<uint32_t> send_ssrcs_ RTC_GUARDED_BY(stream_crit_);
+  std::set<uint32_t> receive_ssrcs_ RTC_GUARDED_BY(stream_crit_);
 
   rtc::Optional<VideoCodecSettings> send_codec_;
   rtc::Optional<std::vector<webrtc::RtpExtension>> send_rtp_extensions_;
diff --git a/pc/mediamonitor.h b/pc/mediamonitor.h
index 5f2a1e2..b4efefb 100644
--- a/pc/mediamonitor.h
+++ b/pc/mediamonitor.h
@@ -61,7 +61,7 @@
     media_info_.Clear();
     media_channel_->GetStats(&media_info_);
   }
-  virtual void Update() EXCLUSIVE_LOCKS_REQUIRED(crit_) {
+  virtual void Update() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_) {
     MI stats(media_info_);
     crit_.Leave();
     SignalUpdate(media_channel_, stats);
diff --git a/pc/videotrack.h b/pc/videotrack.h
index 6e20e97..d0f0618 100644
--- a/pc/videotrack.h
+++ b/pc/videotrack.h
@@ -55,7 +55,7 @@
   rtc::Thread* const worker_thread_;
   rtc::ThreadChecker signaling_thread_checker_;
   rtc::scoped_refptr<VideoTrackSourceInterface> video_source_;
-  ContentHint content_hint_ GUARDED_BY(signaling_thread_checker_);
+  ContentHint content_hint_ RTC_GUARDED_BY(signaling_thread_checker_);
 };
 
 }  // namespace webrtc
diff --git a/rtc_base/task_queue_win.cc b/rtc_base/task_queue_win.cc
index 00a8c79..6ff64c0 100644
--- a/rtc_base/task_queue_win.cc
+++ b/rtc_base/task_queue_win.cc
@@ -236,7 +236,8 @@
   TaskQueue* const queue_;
   WorkerThread thread_;
   rtc::CriticalSection pending_lock_;
-  std::queue<std::unique_ptr<QueuedTask>> pending_ GUARDED_BY(pending_lock_);
+  std::queue<std::unique_ptr<QueuedTask>> pending_
+      RTC_GUARDED_BY(pending_lock_);
   HANDLE in_queue_;
 };
 
diff --git a/rtc_tools/network_tester/packet_sender.h b/rtc_tools/network_tester/packet_sender.h
index d47543d..78c3ab8 100644
--- a/rtc_tools/network_tester/packet_sender.h
+++ b/rtc_tools/network_tester/packet_sender.h
@@ -49,10 +49,10 @@
 
  private:
   rtc::SequencedTaskChecker worker_queue_checker_;
-  size_t packet_size_ ACCESS_ON(worker_queue_checker_);
-  int64_t send_interval_ms_ ACCESS_ON(worker_queue_checker_);
-  int64_t sequence_number_ ACCESS_ON(worker_queue_checker_);
-  bool sending_ ACCESS_ON(worker_queue_checker_);
+  size_t packet_size_ RTC_ACCESS_ON(worker_queue_checker_);
+  int64_t send_interval_ms_ RTC_ACCESS_ON(worker_queue_checker_);
+  int64_t sequence_number_ RTC_ACCESS_ON(worker_queue_checker_);
+  bool sending_ RTC_ACCESS_ON(worker_queue_checker_);
   const std::string config_file_path_;
   TestController* const test_controller_;
   rtc::TaskQueue worker_queue_;
diff --git a/rtc_tools/network_tester/test_controller.h b/rtc_tools/network_tester/test_controller.h
index 14ee0c4..870ca47 100644
--- a/rtc_tools/network_tester/test_controller.h
+++ b/rtc_tools/network_tester/test_controller.h
@@ -67,7 +67,7 @@
   const std::string config_file_path_;
   PacketLogger packet_logger_;
   rtc::CriticalSection local_test_done_lock_;
-  bool local_test_done_ GUARDED_BY(local_test_done_lock_);
+  bool local_test_done_ RTC_GUARDED_BY(local_test_done_lock_);
   bool remote_test_done_;
   std::array<char, kEthernetMtu> send_data_;
   std::unique_ptr<cricket::UdpTransport> udp_transport_;
diff --git a/system_wrappers/include/rw_lock_wrapper.h b/system_wrappers/include/rw_lock_wrapper.h
index 855ecff..62e75b4 100644
--- a/system_wrappers/include/rw_lock_wrapper.h
+++ b/system_wrappers/include/rw_lock_wrapper.h
@@ -19,45 +19,41 @@
 
 namespace webrtc {
 
-class LOCKABLE RWLockWrapper {
+class RTC_LOCKABLE RWLockWrapper {
  public:
   static RWLockWrapper* CreateRWLock();
   virtual ~RWLockWrapper() {}
 
-  virtual void AcquireLockExclusive() EXCLUSIVE_LOCK_FUNCTION() = 0;
-  virtual void ReleaseLockExclusive() UNLOCK_FUNCTION() = 0;
+  virtual void AcquireLockExclusive() RTC_EXCLUSIVE_LOCK_FUNCTION() = 0;
+  virtual void ReleaseLockExclusive() RTC_UNLOCK_FUNCTION() = 0;
 
-  virtual void AcquireLockShared() SHARED_LOCK_FUNCTION() = 0;
-  virtual void ReleaseLockShared() UNLOCK_FUNCTION() = 0;
+  virtual void AcquireLockShared() RTC_SHARED_LOCK_FUNCTION() = 0;
+  virtual void ReleaseLockShared() RTC_UNLOCK_FUNCTION() = 0;
 };
 
 // RAII extensions of the RW lock. Prevents Acquire/Release missmatches and
 // provides more compact locking syntax.
-class SCOPED_LOCKABLE ReadLockScoped {
+class RTC_SCOPED_LOCKABLE ReadLockScoped {
  public:
-  ReadLockScoped(RWLockWrapper& rw_lock) SHARED_LOCK_FUNCTION(rw_lock)
+  ReadLockScoped(RWLockWrapper& rw_lock) RTC_SHARED_LOCK_FUNCTION(rw_lock)
       : rw_lock_(rw_lock) {
     rw_lock_.AcquireLockShared();
   }
 
-  ~ReadLockScoped() UNLOCK_FUNCTION() {
-    rw_lock_.ReleaseLockShared();
-  }
+  ~ReadLockScoped() RTC_UNLOCK_FUNCTION() { rw_lock_.ReleaseLockShared(); }
 
  private:
   RWLockWrapper& rw_lock_;
 };
 
-class SCOPED_LOCKABLE WriteLockScoped {
+class RTC_SCOPED_LOCKABLE WriteLockScoped {
  public:
-  WriteLockScoped(RWLockWrapper& rw_lock) EXCLUSIVE_LOCK_FUNCTION(rw_lock)
+  WriteLockScoped(RWLockWrapper& rw_lock) RTC_EXCLUSIVE_LOCK_FUNCTION(rw_lock)
       : rw_lock_(rw_lock) {
     rw_lock_.AcquireLockExclusive();
   }
 
-  ~WriteLockScoped() UNLOCK_FUNCTION() {
-    rw_lock_.ReleaseLockExclusive();
-  }
+  ~WriteLockScoped() RTC_UNLOCK_FUNCTION() { rw_lock_.ReleaseLockExclusive(); }
 
  private:
   RWLockWrapper& rw_lock_;
diff --git a/system_wrappers/source/metrics_default.cc b/system_wrappers/source/metrics_default.cc
index f9a6f6a..6e5715e 100644
--- a/system_wrappers/source/metrics_default.cc
+++ b/system_wrappers/source/metrics_default.cc
@@ -93,7 +93,7 @@
   rtc::CriticalSection crit_;
   const int min_;
   const int max_;
-  SampleInfo info_ GUARDED_BY(crit_);
+  SampleInfo info_ RTC_GUARDED_BY(crit_);
 
   RTC_DISALLOW_COPY_AND_ASSIGN(RtcHistogram);
 };
@@ -165,7 +165,8 @@
 
  private:
   rtc::CriticalSection crit_;
-  std::map<std::string, std::unique_ptr<RtcHistogram>> map_ GUARDED_BY(crit_);
+  std::map<std::string, std::unique_ptr<RtcHistogram>> map_
+      RTC_GUARDED_BY(crit_);
 
   RTC_DISALLOW_COPY_AND_ASSIGN(RtcHistogramMap);
 };
diff --git a/system_wrappers/source/trace_impl.h b/system_wrappers/source/trace_impl.h
index 90e4a3a..0e36aff 100644
--- a/system_wrappers/source/trace_impl.h
+++ b/system_wrappers/source/trace_impl.h
@@ -81,7 +81,7 @@
 
   bool UpdateFileName(
       char file_name_with_counter_utf8[FileWrapper::kMaxFileNameSize],
-      const uint32_t new_count) const EXCLUSIVE_LOCKS_REQUIRED(crit_);
+      const uint32_t new_count) const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
 
   bool CreateFileName(
     const char file_name_utf8[FileWrapper::kMaxFileNameSize],
@@ -89,14 +89,14 @@
     const uint32_t new_count) const;
 
   void WriteToFile(const char* msg, uint16_t length)
-      EXCLUSIVE_LOCKS_REQUIRED(crit_);
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
 
-  TraceCallback* callback_ GUARDED_BY(crit_);
-  uint32_t row_count_text_ GUARDED_BY(crit_);
-  uint32_t file_count_text_ GUARDED_BY(crit_);
+  TraceCallback* callback_ RTC_GUARDED_BY(crit_);
+  uint32_t row_count_text_ RTC_GUARDED_BY(crit_);
+  uint32_t file_count_text_ RTC_GUARDED_BY(crit_);
 
-  const std::unique_ptr<FileWrapper> trace_file_ GUARDED_BY(crit_);
-  std::string trace_file_path_ GUARDED_BY(crit_);
+  const std::unique_ptr<FileWrapper> trace_file_ RTC_GUARDED_BY(crit_);
+  std::string trace_file_path_ RTC_GUARDED_BY(crit_);
   rtc::CriticalSection crit_;
 };
 
diff --git a/test/direct_transport.h b/test/direct_transport.h
index 11b086d..c60157d 100644
--- a/test/direct_transport.h
+++ b/test/direct_transport.h
@@ -70,7 +70,7 @@
 
   SingleThreadedTaskQueueForTesting* const task_queue_;
   SingleThreadedTaskQueueForTesting::TaskId next_scheduled_task_
-      GUARDED_BY(&sequence_checker_);
+      RTC_GUARDED_BY(&sequence_checker_);
 
   FakeNetworkPipe fake_network_;
 
diff --git a/test/fake_audio_device.h b/test/fake_audio_device.h
index db56c74..939d16a 100644
--- a/test/fake_audio_device.h
+++ b/test/fake_audio_device.h
@@ -121,19 +121,19 @@
   static bool Run(void* obj);
   void ProcessAudio();
 
-  const std::unique_ptr<Capturer> capturer_ GUARDED_BY(lock_);
-  const std::unique_ptr<Renderer> renderer_ GUARDED_BY(lock_);
+  const std::unique_ptr<Capturer> capturer_ RTC_GUARDED_BY(lock_);
+  const std::unique_ptr<Renderer> renderer_ RTC_GUARDED_BY(lock_);
   const float speed_;
 
   rtc::CriticalSection lock_;
-  AudioTransport* audio_callback_ GUARDED_BY(lock_);
-  bool rendering_ GUARDED_BY(lock_);
-  bool capturing_ GUARDED_BY(lock_);
+  AudioTransport* audio_callback_ RTC_GUARDED_BY(lock_);
+  bool rendering_ RTC_GUARDED_BY(lock_);
+  bool capturing_ RTC_GUARDED_BY(lock_);
   rtc::Event done_rendering_;
   rtc::Event done_capturing_;
 
-  std::vector<int16_t> playout_buffer_ GUARDED_BY(lock_);
-  rtc::BufferT<int16_t> recording_buffer_ GUARDED_BY(lock_);
+  std::vector<int16_t> playout_buffer_ RTC_GUARDED_BY(lock_);
+  rtc::BufferT<int16_t> recording_buffer_ RTC_GUARDED_BY(lock_);
 
   std::unique_ptr<EventTimerWrapper> tick_;
   rtc::PlatformThread thread_;
diff --git a/test/fake_encoder.h b/test/fake_encoder.h
index 96218e5..c8912a1 100644
--- a/test/fake_encoder.h
+++ b/test/fake_encoder.h
@@ -51,12 +51,12 @@
 
  protected:
   Clock* const clock_;
-  VideoCodec config_ GUARDED_BY(crit_sect_);
-  EncodedImageCallback* callback_ GUARDED_BY(crit_sect_);
-  BitrateAllocation target_bitrate_ GUARDED_BY(crit_sect_);
-  int configured_input_framerate_ GUARDED_BY(crit_sect_);
-  int max_target_bitrate_kbps_ GUARDED_BY(crit_sect_);
-  bool pending_keyframe_ GUARDED_BY(crit_sect_);
+  VideoCodec config_ RTC_GUARDED_BY(crit_sect_);
+  EncodedImageCallback* callback_ RTC_GUARDED_BY(crit_sect_);
+  BitrateAllocation target_bitrate_ RTC_GUARDED_BY(crit_sect_);
+  int configured_input_framerate_ RTC_GUARDED_BY(crit_sect_);
+  int max_target_bitrate_kbps_ RTC_GUARDED_BY(crit_sect_);
+  bool pending_keyframe_ RTC_GUARDED_BY(crit_sect_);
   rtc::CriticalSection crit_sect_;
 
   uint8_t encoded_buffer_[100000];
@@ -79,8 +79,8 @@
                         const RTPFragmentationHeader* fragments) override;
 
  private:
-  EncodedImageCallback* callback_ GUARDED_BY(local_crit_sect_);
-  int idr_counter_ GUARDED_BY(local_crit_sect_);
+  EncodedImageCallback* callback_ RTC_GUARDED_BY(local_crit_sect_);
+  int idr_counter_ RTC_GUARDED_BY(local_crit_sect_);
   rtc::CriticalSection local_crit_sect_;
 };
 
@@ -95,7 +95,7 @@
                  const std::vector<FrameType>* frame_types) override;
 
  private:
-  int delay_ms_ ACCESS_ON(sequence_checker_);
+  int delay_ms_ RTC_ACCESS_ON(sequence_checker_);
   rtc::SequencedTaskChecker sequence_checker_;
 };
 
@@ -125,9 +125,9 @@
  protected:
   class EncodeTask;
 
-  int current_queue_ ACCESS_ON(sequence_checker_);
-  std::unique_ptr<rtc::TaskQueue> queue1_ ACCESS_ON(sequence_checker_);
-  std::unique_ptr<rtc::TaskQueue> queue2_ ACCESS_ON(sequence_checker_);
+  int current_queue_ RTC_ACCESS_ON(sequence_checker_);
+  std::unique_ptr<rtc::TaskQueue> queue1_ RTC_ACCESS_ON(sequence_checker_);
+  std::unique_ptr<rtc::TaskQueue> queue2_ RTC_ACCESS_ON(sequence_checker_);
   rtc::SequencedTaskChecker sequence_checker_;
 };
 
diff --git a/test/frame_generator.cc b/test/frame_generator.cc
index 1956cdb..eff2ec2 100644
--- a/test/frame_generator.cc
+++ b/test/frame_generator.cc
@@ -108,10 +108,10 @@
   };
 
   rtc::CriticalSection crit_;
-  int width_ GUARDED_BY(&crit_);
-  int height_ GUARDED_BY(&crit_);
-  std::vector<std::unique_ptr<Square>> squares_ GUARDED_BY(&crit_);
-  std::unique_ptr<VideoFrame> frame_ GUARDED_BY(&crit_);
+  int width_ RTC_GUARDED_BY(&crit_);
+  int height_ RTC_GUARDED_BY(&crit_);
+  std::vector<std::unique_ptr<Square>> squares_ RTC_GUARDED_BY(&crit_);
+  std::unique_ptr<VideoFrame> frame_ RTC_GUARDED_BY(&crit_);
 };
 
 class YuvFileGenerator : public FrameGenerator {
diff --git a/test/frame_generator.h b/test/frame_generator.h
index dfe35b8..d42f226 100644
--- a/test/frame_generator.h
+++ b/test/frame_generator.h
@@ -42,8 +42,8 @@
   void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override;
 
   rtc::CriticalSection crit_;
-  rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(crit_);
-  rtc::VideoSinkWants sink_wants_ GUARDED_BY(crit_);
+  rtc::VideoSinkInterface<VideoFrame>* sink_ RTC_GUARDED_BY(crit_);
+  rtc::VideoSinkWants sink_wants_ RTC_GUARDED_BY(crit_);
 };
 
 class FrameGenerator {
diff --git a/test/frame_generator_capturer.h b/test/frame_generator_capturer.h
index 4425121..8f3232c 100644
--- a/test/frame_generator_capturer.h
+++ b/test/frame_generator_capturer.h
@@ -87,14 +87,14 @@
 
   Clock* const clock_;
   bool sending_;
-  rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(&lock_);
-  SinkWantsObserver* sink_wants_observer_ GUARDED_BY(&lock_);
+  rtc::VideoSinkInterface<VideoFrame>* sink_ RTC_GUARDED_BY(&lock_);
+  SinkWantsObserver* sink_wants_observer_ RTC_GUARDED_BY(&lock_);
 
   rtc::CriticalSection lock_;
   std::unique_ptr<FrameGenerator> frame_generator_;
 
-  int target_fps_ GUARDED_BY(&lock_);
-  rtc::Optional<int> wanted_fps_ GUARDED_BY(&lock_);
+  int target_fps_ RTC_GUARDED_BY(&lock_);
+  rtc::Optional<int> wanted_fps_ RTC_GUARDED_BY(&lock_);
   VideoRotation fake_rotation_ = kVideoRotation_0;
 
   int64_t first_frame_capture_time_;
diff --git a/test/single_threaded_task_queue.h b/test/single_threaded_task_queue.h
index ecb22b3..c078bdd 100644
--- a/test/single_threaded_task_queue.h
+++ b/test/single_threaded_task_queue.h
@@ -71,10 +71,10 @@
   void RunLoop();
 
   rtc::CriticalSection cs_;
-  std::list<std::unique_ptr<QueuedTask>> tasks_ GUARDED_BY(cs_);
+  std::list<std::unique_ptr<QueuedTask>> tasks_ RTC_GUARDED_BY(cs_);
   rtc::ThreadChecker owner_thread_checker_;
   rtc::PlatformThread thread_;
-  bool running_ GUARDED_BY(cs_);
+  bool running_ RTC_GUARDED_BY(cs_);
 
   TaskId next_task_id_;
 
diff --git a/test/vcm_capturer.h b/test/vcm_capturer.h
index fdb594b..2b4323c 100644
--- a/test/vcm_capturer.h
+++ b/test/vcm_capturer.h
@@ -49,8 +49,8 @@
   void Destroy();
 
   rtc::CriticalSection crit_;
-  bool started_ GUARDED_BY(crit_);
-  rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(crit_);
+  bool started_ RTC_GUARDED_BY(crit_);
+  rtc::VideoSinkInterface<VideoFrame>* sink_ RTC_GUARDED_BY(crit_);
   rtc::scoped_refptr<VideoCaptureModule> vcm_;
   VideoCaptureCapability capability_;
 };
diff --git a/video/call_stats.h b/video/call_stats.h
index a9b4280..efa98ad 100644
--- a/video/call_stats.h
+++ b/video/call_stats.h
@@ -70,9 +70,9 @@
   // The last RTT in the statistics update (zero if there is no valid estimate).
   int64_t max_rtt_ms_;
   int64_t avg_rtt_ms_;
-  int64_t sum_avg_rtt_ms_ GUARDED_BY(crit_);
-  int64_t num_avg_rtt_ GUARDED_BY(crit_);
-  int64_t time_of_first_rtt_ms_ GUARDED_BY(crit_);
+  int64_t sum_avg_rtt_ms_ RTC_GUARDED_BY(crit_);
+  int64_t num_avg_rtt_ RTC_GUARDED_BY(crit_);
+  int64_t time_of_first_rtt_ms_ RTC_GUARDED_BY(crit_);
 
   // All Rtt reports within valid time interval, oldest first.
   std::list<RttTime> reports_;
diff --git a/video/encoder_rtcp_feedback.h b/video/encoder_rtcp_feedback.h
index 2f24e31..0e5b13b 100644
--- a/video/encoder_rtcp_feedback.h
+++ b/video/encoder_rtcp_feedback.h
@@ -37,7 +37,7 @@
   VideoStreamEncoder* const video_stream_encoder_;
 
   rtc::CriticalSection crit_;
-  std::vector<int64_t> time_last_intra_request_ms_ GUARDED_BY(crit_);
+  std::vector<int64_t> time_last_intra_request_ms_ RTC_GUARDED_BY(crit_);
 };
 
 }  // namespace webrtc
diff --git a/video/end_to_end_tests.cc b/video/end_to_end_tests.cc
index 644319c..ffd52fd 100644
--- a/video/end_to_end_tests.cc
+++ b/video/end_to_end_tests.cc
@@ -540,7 +540,7 @@
     std::set<uint16_t> retransmitted_packets_;
     uint64_t sent_rtp_packets_;
     int packets_left_to_drop_;
-    int nacks_left_ GUARDED_BY(&crit_);
+    int nacks_left_ RTC_GUARDED_BY(&crit_);
   } test;
 
   RunBaseTest(&test);
@@ -710,11 +710,11 @@
     rtc::CriticalSection crit_;
     std::unique_ptr<VideoEncoder> encoder_;
     std::unique_ptr<VideoDecoder> decoder_;
-    std::set<uint32_t> dropped_sequence_numbers_ GUARDED_BY(crit_);
+    std::set<uint32_t> dropped_sequence_numbers_ RTC_GUARDED_BY(crit_);
     // Several packets can have the same timestamp.
-    std::multiset<uint32_t> dropped_timestamps_ GUARDED_BY(crit_);
+    std::multiset<uint32_t> dropped_timestamps_ RTC_GUARDED_BY(crit_);
     Random random_;
-    int num_packets_sent_ GUARDED_BY(crit_);
+    int num_packets_sent_ RTC_GUARDED_BY(crit_);
   } test;
 
   RunBaseTest(&test);
@@ -887,12 +887,12 @@
   }
 
   rtc::CriticalSection crit_;
-  std::set<uint32_t> dropped_sequence_numbers_ GUARDED_BY(crit_);
+  std::set<uint32_t> dropped_sequence_numbers_ RTC_GUARDED_BY(crit_);
   // Several packets can have the same timestamp.
-  std::multiset<uint32_t> dropped_timestamps_ GUARDED_BY(crit_);
+  std::multiset<uint32_t> dropped_timestamps_ RTC_GUARDED_BY(crit_);
   const bool enable_nack_;
   const bool expect_flexfec_rtcp_;
-  bool received_flexfec_rtcp_ GUARDED_BY(crit_);
+  bool received_flexfec_rtcp_ RTC_GUARDED_BY(crit_);
   Random random_;
   int num_packets_sent_;
 };
@@ -1069,7 +1069,7 @@
     } state_;
 
     rtc::CriticalSection crit_;
-    uint16_t ulpfec_sequence_number_ GUARDED_BY(&crit_);
+    uint16_t ulpfec_sequence_number_ RTC_GUARDED_BY(&crit_);
     bool has_last_sequence_number_;
     uint16_t last_sequence_number_;
     std::unique_ptr<webrtc::VideoEncoder> encoder_;
@@ -1224,8 +1224,8 @@
     std::unique_ptr<VideoEncoder> encoder_;
     const std::string payload_name_;
     int marker_bits_observed_;
-    uint32_t retransmitted_timestamp_ GUARDED_BY(&crit_);
-    std::vector<uint32_t> rendered_timestamps_ GUARDED_BY(&crit_);
+    uint32_t retransmitted_timestamp_ RTC_GUARDED_BY(&crit_);
+    std::vector<uint32_t> rendered_timestamps_ RTC_GUARDED_BY(&crit_);
   } test(enable_rtx, enable_red);
 
   RunBaseTest(&test);
@@ -1319,9 +1319,9 @@
     rtc::CriticalSection crit_;
     int rtp_history_ms_;
     bool nack_enabled_;
-    uint32_t highest_dropped_timestamp_ GUARDED_BY(&crit_);
-    int frames_to_drop_ GUARDED_BY(&crit_);
-    bool received_pli_ GUARDED_BY(&crit_);
+    uint32_t highest_dropped_timestamp_ RTC_GUARDED_BY(&crit_);
+    int frames_to_drop_ RTC_GUARDED_BY(&crit_);
+    bool received_pli_ RTC_GUARDED_BY(&crit_);
   } test(rtp_history_ms);
 
   RunBaseTest(&test);
@@ -1479,8 +1479,8 @@
     rtc::CriticalSection crit_;
     // Must be protected since RTCP can be sent by both the process thread
     // and the pacer thread.
-    int sent_rtp_ GUARDED_BY(&crit_);
-    int sent_rtcp_ GUARDED_BY(&crit_);
+    int sent_rtp_ RTC_GUARDED_BY(&crit_);
+    int sent_rtcp_ RTC_GUARDED_BY(&crit_);
   } test(rtcp_mode);
 
   RunBaseTest(&test);
@@ -2075,8 +2075,8 @@
     const size_t num_video_streams_;
     const size_t num_audio_streams_;
     rtc::CriticalSection crit_;
-    int media_sent_ GUARDED_BY(crit_);
-    int padding_sent_ GUARDED_BY(crit_);
+    int media_sent_ RTC_GUARDED_BY(crit_);
+    int padding_sent_ RTC_GUARDED_BY(crit_);
   } test(1, 0);
   RunBaseTest(&test);
 }
@@ -2623,7 +2623,7 @@
       return SEND_PACKET;
     }
 
-    void VerifyStats() EXCLUSIVE_LOCKS_REQUIRED(&crit_) {
+    void VerifyStats() RTC_EXCLUSIVE_LOCKS_REQUIRED(&crit_) {
       if (!dropped_rtp_packet_requested_)
         return;
       int send_stream_nack_packets = 0;
@@ -2680,8 +2680,8 @@
     test::FakeVideoRenderer fake_renderer_;
     rtc::CriticalSection crit_;
     uint64_t sent_rtp_packets_;
-    uint16_t dropped_rtp_packet_ GUARDED_BY(&crit_);
-    bool dropped_rtp_packet_requested_ GUARDED_BY(&crit_);
+    uint16_t dropped_rtp_packet_ RTC_GUARDED_BY(&crit_);
+    bool dropped_rtp_packet_requested_ RTC_GUARDED_BY(&crit_);
     std::vector<VideoReceiveStream*> receive_streams_;
     VideoSendStream* send_stream_;
     int64_t start_runtime_ms_;
@@ -2803,7 +2803,7 @@
     Call* sender_call_;
     Call* receiver_call_;
     int64_t start_runtime_ms_;
-    int num_frames_received_ GUARDED_BY(&crit_);
+    int num_frames_received_ RTC_GUARDED_BY(&crit_);
   } test(use_rtx, use_red, screenshare);
 
   metrics::Reset();
@@ -2973,7 +2973,7 @@
     }
 
     rtc::CriticalSection crit_;
-    int num_frames_received_ GUARDED_BY(&crit_);
+    int num_frames_received_ RTC_GUARDED_BY(&crit_);
   } test;
 
   metrics::Reset();
@@ -3277,7 +3277,7 @@
     test::SingleThreadedTaskQueueForTesting* const task_queue_;
     rtc::CriticalSection crit_;
     VideoSendStream* send_stream_;
-    uint32_t bitrate_kbps_ GUARDED_BY(crit_);
+    uint32_t bitrate_kbps_ RTC_GUARDED_BY(crit_);
   } test(&task_queue_);
 
   RunBaseTest(&test);
@@ -3762,9 +3762,9 @@
   const bool enable_rrtr_;
   const bool enable_target_bitrate_;
   int sent_rtcp_sr_;
-  int sent_rtcp_rr_ GUARDED_BY(&crit_);
-  int sent_rtcp_rrtr_ GUARDED_BY(&crit_);
-  bool sent_rtcp_target_bitrate_ GUARDED_BY(&crit_);
+  int sent_rtcp_rr_ RTC_GUARDED_BY(&crit_);
+  int sent_rtcp_rrtr_ RTC_GUARDED_BY(&crit_);
+  bool sent_rtcp_target_bitrate_ RTC_GUARDED_BY(&crit_);
   int sent_rtcp_dlrr_;
 };
 
@@ -3994,7 +3994,7 @@
     void ValidateTimestampGap(uint32_t ssrc,
                               uint32_t timestamp,
                               bool only_padding)
-        EXCLUSIVE_LOCKS_REQUIRED(crit_) {
+        RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_) {
       static const int32_t kMaxTimestampGap = kDefaultTimeoutMs * 90;
       auto timestamp_it = last_observed_timestamp_.find(ssrc);
       if (timestamp_it == last_observed_timestamp_.end()) {
@@ -4083,8 +4083,8 @@
     std::map<uint32_t, bool> ssrc_is_rtx_;
 
     rtc::CriticalSection crit_;
-    size_t ssrcs_to_observe_ GUARDED_BY(crit_);
-    std::map<uint32_t, bool> ssrc_observed_ GUARDED_BY(crit_);
+    size_t ssrcs_to_observe_ RTC_GUARDED_BY(crit_);
+    std::map<uint32_t, bool> ssrc_observed_ RTC_GUARDED_BY(crit_);
   } observer(use_rtx);
 
   std::unique_ptr<test::PacketTransport> send_transport;
@@ -4276,9 +4276,10 @@
       return SEND_PACKET;
     }
 
-    rtc::Optional<uint16_t> last_observed_sequence_number_ GUARDED_BY(crit_);
-    rtc::Optional<uint32_t> last_observed_timestamp_ GUARDED_BY(crit_);
-    size_t num_flexfec_packets_sent_ GUARDED_BY(crit_);
+    rtc::Optional<uint16_t> last_observed_sequence_number_
+        RTC_GUARDED_BY(crit_);
+    rtc::Optional<uint32_t> last_observed_timestamp_ RTC_GUARDED_BY(crit_);
+    size_t num_flexfec_packets_sent_ RTC_GUARDED_BY(crit_);
     rtc::CriticalSection crit_;
   } observer;
 
@@ -4595,12 +4596,12 @@
     rtc::Event packet_event_;
     Call* sender_call_;
     Call* receiver_call_;
-    NetworkState sender_state_ GUARDED_BY(test_crit_);
-    int sender_rtp_ GUARDED_BY(test_crit_);
-    int sender_padding_ GUARDED_BY(test_crit_);
-    int sender_rtcp_ GUARDED_BY(test_crit_);
-    int receiver_rtcp_ GUARDED_BY(test_crit_);
-    int down_frames_ GUARDED_BY(test_crit_);
+    NetworkState sender_state_ RTC_GUARDED_BY(test_crit_);
+    int sender_rtp_ RTC_GUARDED_BY(test_crit_);
+    int sender_padding_ RTC_GUARDED_BY(test_crit_);
+    int sender_rtcp_ RTC_GUARDED_BY(test_crit_);
+    int receiver_rtcp_ RTC_GUARDED_BY(test_crit_);
+    int down_frames_ RTC_GUARDED_BY(test_crit_);
   } test(&task_queue_);
 
   RunBaseTest(&test);
@@ -5016,7 +5017,7 @@
     std::unique_ptr<VideoEncoder> encoder_;
     std::unique_ptr<VideoDecoder> decoder_;
     rtc::CriticalSection crit_;
-    int recorded_frames_ GUARDED_BY(crit_);
+    int recorded_frames_ RTC_GUARDED_BY(crit_);
   } test(this);
 
   RunBaseTest(&test);
diff --git a/video/overuse_frame_detector.h b/video/overuse_frame_detector.h
index a5eef51..a4f4588 100644
--- a/video/overuse_frame_detector.h
+++ b/video/overuse_frame_detector.h
@@ -133,27 +133,28 @@
 
   // Stats metrics.
   CpuOveruseMetricsObserver* const metrics_observer_;
-  rtc::Optional<CpuOveruseMetrics> metrics_ GUARDED_BY(task_checker_);
+  rtc::Optional<CpuOveruseMetrics> metrics_ RTC_GUARDED_BY(task_checker_);
 
-  int64_t num_process_times_ GUARDED_BY(task_checker_);
+  int64_t num_process_times_ RTC_GUARDED_BY(task_checker_);
 
-  int64_t last_capture_time_us_ GUARDED_BY(task_checker_);
-  int64_t last_processed_capture_time_us_ GUARDED_BY(task_checker_);
+  int64_t last_capture_time_us_ RTC_GUARDED_BY(task_checker_);
+  int64_t last_processed_capture_time_us_ RTC_GUARDED_BY(task_checker_);
 
   // Number of pixels of last captured frame.
-  int num_pixels_ GUARDED_BY(task_checker_);
-  int max_framerate_ GUARDED_BY(task_checker_);
-  int64_t last_overuse_time_ms_ GUARDED_BY(task_checker_);
-  int checks_above_threshold_ GUARDED_BY(task_checker_);
-  int num_overuse_detections_ GUARDED_BY(task_checker_);
-  int64_t last_rampup_time_ms_ GUARDED_BY(task_checker_);
-  bool in_quick_rampup_ GUARDED_BY(task_checker_);
-  int current_rampup_delay_ms_ GUARDED_BY(task_checker_);
+  int num_pixels_ RTC_GUARDED_BY(task_checker_);
+  int max_framerate_ RTC_GUARDED_BY(task_checker_);
+  int64_t last_overuse_time_ms_ RTC_GUARDED_BY(task_checker_);
+  int checks_above_threshold_ RTC_GUARDED_BY(task_checker_);
+  int num_overuse_detections_ RTC_GUARDED_BY(task_checker_);
+  int64_t last_rampup_time_ms_ RTC_GUARDED_BY(task_checker_);
+  bool in_quick_rampup_ RTC_GUARDED_BY(task_checker_);
+  int current_rampup_delay_ms_ RTC_GUARDED_BY(task_checker_);
 
   // TODO(asapersson): Can these be regular members (avoid separate heap
   // allocs)?
-  const std::unique_ptr<SendProcessingUsage> usage_ GUARDED_BY(task_checker_);
-  std::list<FrameTiming> frame_timing_ GUARDED_BY(task_checker_);
+  const std::unique_ptr<SendProcessingUsage> usage_
+      RTC_GUARDED_BY(task_checker_);
+  std::list<FrameTiming> frame_timing_ RTC_GUARDED_BY(task_checker_);
 
   RTC_DISALLOW_COPY_AND_ASSIGN(OveruseFrameDetector);
 };
diff --git a/video/payload_router.h b/video/payload_router.h
index bfd4b8e..082ba36 100644
--- a/video/payload_router.h
+++ b/video/payload_router.h
@@ -49,10 +49,10 @@
   void OnBitrateAllocationUpdated(const BitrateAllocation& bitrate);
 
  private:
-  void UpdateModuleSendingState() EXCLUSIVE_LOCKS_REQUIRED(crit_);
+  void UpdateModuleSendingState() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
 
   rtc::CriticalSection crit_;
-  bool active_ GUARDED_BY(crit_);
+  bool active_ RTC_GUARDED_BY(crit_);
 
   // Rtp modules are assumed to be sorted in simulcast index order. Not owned.
   const std::vector<RtpRtcp*> rtp_modules_;
diff --git a/video/picture_id_tests.cc b/video/picture_id_tests.cc
index 13574b8..0c83796 100644
--- a/video/picture_id_tests.cc
+++ b/video/picture_id_tests.cc
@@ -124,12 +124,12 @@
   }
 
   rtc::CriticalSection crit_;
-  std::map<uint32_t, uint32_t> last_observed_timestamp_ GUARDED_BY(crit_);
-  std::map<uint32_t, uint16_t> last_observed_picture_id_ GUARDED_BY(crit_);
-  std::map<uint32_t, size_t> num_packets_sent_ GUARDED_BY(crit_);
-  int max_expected_picture_id_gap_ GUARDED_BY(crit_);
-  size_t num_ssrcs_to_observe_ GUARDED_BY(crit_);
-  std::set<uint32_t> observed_ssrcs_ GUARDED_BY(crit_);
+  std::map<uint32_t, uint32_t> last_observed_timestamp_ RTC_GUARDED_BY(crit_);
+  std::map<uint32_t, uint16_t> last_observed_picture_id_ RTC_GUARDED_BY(crit_);
+  std::map<uint32_t, size_t> num_packets_sent_ RTC_GUARDED_BY(crit_);
+  int max_expected_picture_id_gap_ RTC_GUARDED_BY(crit_);
+  size_t num_ssrcs_to_observe_ RTC_GUARDED_BY(crit_);
+  std::set<uint32_t> observed_ssrcs_ RTC_GUARDED_BY(crit_);
 };
 
 class PictureIdTest : public test::CallTest {
diff --git a/video/receive_statistics_proxy.h b/video/receive_statistics_proxy.h
index 45424d9..262be64 100644
--- a/video/receive_statistics_proxy.h
+++ b/video/receive_statistics_proxy.h
@@ -126,12 +126,13 @@
     FrameCounts frame_counts;
   };
 
-  void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_);
+  void UpdateHistograms() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
 
-  void QualitySample() EXCLUSIVE_LOCKS_REQUIRED(crit_);
+  void QualitySample() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
 
   // Removes info about old frames and then updates the framerate.
-  void UpdateFramerate(int64_t now_ms) const EXCLUSIVE_LOCKS_REQUIRED(crit_);
+  void UpdateFramerate(int64_t now_ms) const
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
 
   Clock* const clock_;
   // Ownership of this object lies with the owner of the ReceiveStatisticsProxy
@@ -145,42 +146,42 @@
   const int64_t start_ms_;
 
   rtc::CriticalSection crit_;
-  int64_t last_sample_time_ GUARDED_BY(crit_);
-  QualityThreshold fps_threshold_ GUARDED_BY(crit_);
-  QualityThreshold qp_threshold_ GUARDED_BY(crit_);
-  QualityThreshold variance_threshold_ GUARDED_BY(crit_);
-  SampleCounter qp_sample_ GUARDED_BY(crit_);
-  int num_bad_states_ GUARDED_BY(crit_);
-  int num_certain_states_ GUARDED_BY(crit_);
-  mutable VideoReceiveStream::Stats stats_ GUARDED_BY(crit_);
-  RateStatistics decode_fps_estimator_ GUARDED_BY(crit_);
-  RateStatistics renders_fps_estimator_ GUARDED_BY(crit_);
-  rtc::RateTracker render_fps_tracker_ GUARDED_BY(crit_);
-  rtc::RateTracker render_pixel_tracker_ GUARDED_BY(crit_);
-  rtc::RateTracker total_byte_tracker_ GUARDED_BY(crit_);
-  SampleCounter sync_offset_counter_ GUARDED_BY(crit_);
-  SampleCounter decode_time_counter_ GUARDED_BY(crit_);
-  SampleCounter jitter_buffer_delay_counter_ GUARDED_BY(crit_);
-  SampleCounter target_delay_counter_ GUARDED_BY(crit_);
-  SampleCounter current_delay_counter_ GUARDED_BY(crit_);
-  SampleCounter delay_counter_ GUARDED_BY(crit_);
+  int64_t last_sample_time_ RTC_GUARDED_BY(crit_);
+  QualityThreshold fps_threshold_ RTC_GUARDED_BY(crit_);
+  QualityThreshold qp_threshold_ RTC_GUARDED_BY(crit_);
+  QualityThreshold variance_threshold_ RTC_GUARDED_BY(crit_);
+  SampleCounter qp_sample_ RTC_GUARDED_BY(crit_);
+  int num_bad_states_ RTC_GUARDED_BY(crit_);
+  int num_certain_states_ RTC_GUARDED_BY(crit_);
+  mutable VideoReceiveStream::Stats stats_ RTC_GUARDED_BY(crit_);
+  RateStatistics decode_fps_estimator_ RTC_GUARDED_BY(crit_);
+  RateStatistics renders_fps_estimator_ RTC_GUARDED_BY(crit_);
+  rtc::RateTracker render_fps_tracker_ RTC_GUARDED_BY(crit_);
+  rtc::RateTracker render_pixel_tracker_ RTC_GUARDED_BY(crit_);
+  rtc::RateTracker total_byte_tracker_ RTC_GUARDED_BY(crit_);
+  SampleCounter sync_offset_counter_ RTC_GUARDED_BY(crit_);
+  SampleCounter decode_time_counter_ RTC_GUARDED_BY(crit_);
+  SampleCounter jitter_buffer_delay_counter_ RTC_GUARDED_BY(crit_);
+  SampleCounter target_delay_counter_ RTC_GUARDED_BY(crit_);
+  SampleCounter current_delay_counter_ RTC_GUARDED_BY(crit_);
+  SampleCounter delay_counter_ RTC_GUARDED_BY(crit_);
   mutable rtc::MovingMaxCounter<int> interframe_delay_max_moving_
-      GUARDED_BY(crit_);
+      RTC_GUARDED_BY(crit_);
   std::map<VideoContentType, ContentSpecificStats> content_specific_stats_
-      GUARDED_BY(crit_);
-  MaxCounter freq_offset_counter_ GUARDED_BY(crit_);
-  int64_t first_report_block_time_ms_ GUARDED_BY(crit_);
-  ReportBlockStats report_block_stats_ GUARDED_BY(crit_);
+      RTC_GUARDED_BY(crit_);
+  MaxCounter freq_offset_counter_ RTC_GUARDED_BY(crit_);
+  int64_t first_report_block_time_ms_ RTC_GUARDED_BY(crit_);
+  ReportBlockStats report_block_stats_ RTC_GUARDED_BY(crit_);
   QpCounters qp_counters_;  // Only accessed on the decoding thread.
-  std::map<uint32_t, StreamDataCounters> rtx_stats_ GUARDED_BY(crit_);
-  int64_t avg_rtt_ms_ GUARDED_BY(crit_);
-  mutable std::map<int64_t, size_t> frame_window_ GUARDED_BY(&crit_);
-  VideoContentType last_content_type_ GUARDED_BY(&crit_);
-  rtc::Optional<int64_t> last_decoded_frame_time_ms_ GUARDED_BY(&crit_);
+  std::map<uint32_t, StreamDataCounters> rtx_stats_ RTC_GUARDED_BY(crit_);
+  int64_t avg_rtt_ms_ RTC_GUARDED_BY(crit_);
+  mutable std::map<int64_t, size_t> frame_window_ RTC_GUARDED_BY(&crit_);
+  VideoContentType last_content_type_ RTC_GUARDED_BY(&crit_);
+  rtc::Optional<int64_t> last_decoded_frame_time_ms_ RTC_GUARDED_BY(&crit_);
   // Mutable because calling Max() on MovingMaxCounter is not const. Yet it is
   // called from const GetStats().
   mutable rtc::MovingMaxCounter<TimingFrameInfo> timing_frame_info_counter_
-      GUARDED_BY(&crit_);
+      RTC_GUARDED_BY(&crit_);
 };
 
 }  // namespace webrtc
diff --git a/video/rtp_streams_synchronizer.h b/video/rtp_streams_synchronizer.h
index dfc0ddb..c8f2d2a 100644
--- a/video/rtp_streams_synchronizer.h
+++ b/video/rtp_streams_synchronizer.h
@@ -52,13 +52,13 @@
   Syncable* syncable_video_;
 
   rtc::CriticalSection crit_;
-  Syncable* syncable_audio_ GUARDED_BY(crit_);
-  std::unique_ptr<StreamSynchronization> sync_ GUARDED_BY(crit_);
-  StreamSynchronization::Measurements audio_measurement_ GUARDED_BY(crit_);
-  StreamSynchronization::Measurements video_measurement_ GUARDED_BY(crit_);
+  Syncable* syncable_audio_ RTC_GUARDED_BY(crit_);
+  std::unique_ptr<StreamSynchronization> sync_ RTC_GUARDED_BY(crit_);
+  StreamSynchronization::Measurements audio_measurement_ RTC_GUARDED_BY(crit_);
+  StreamSynchronization::Measurements video_measurement_ RTC_GUARDED_BY(crit_);
 
   rtc::ThreadChecker process_thread_checker_;
-  int64_t last_sync_time_ ACCESS_ON(&process_thread_checker_);
+  int64_t last_sync_time_ RTC_ACCESS_ON(&process_thread_checker_);
 };
 
 }  // namespace webrtc
diff --git a/video/rtp_video_stream_receiver.h b/video/rtp_video_stream_receiver.h
index f65280e..3c8b2aa 100644
--- a/video/rtp_video_stream_receiver.h
+++ b/video/rtp_video_stream_receiver.h
@@ -184,10 +184,10 @@
   std::unique_ptr<UlpfecReceiver> ulpfec_receiver_;
 
   rtc::SequencedTaskChecker worker_task_checker_;
-  bool receiving_ GUARDED_BY(worker_task_checker_);
-  uint8_t restored_packet_[IP_PACKET_SIZE] GUARDED_BY(worker_task_checker_);
-  bool restored_packet_in_use_ GUARDED_BY(worker_task_checker_);
-  int64_t last_packet_log_ms_ GUARDED_BY(worker_task_checker_);
+  bool receiving_ RTC_GUARDED_BY(worker_task_checker_);
+  uint8_t restored_packet_[IP_PACKET_SIZE] RTC_GUARDED_BY(worker_task_checker_);
+  bool restored_packet_in_use_ RTC_GUARDED_BY(worker_task_checker_);
+  int64_t last_packet_log_ms_ RTC_GUARDED_BY(worker_task_checker_);
 
   const std::unique_ptr<RtpRtcp> rtp_rtcp_;
 
@@ -200,7 +200,7 @@
   std::unique_ptr<video_coding::RtpFrameReferenceFinder> reference_finder_;
   rtc::CriticalSection last_seq_num_cs_;
   std::map<int64_t, uint16_t> last_seq_num_for_pic_id_
-      GUARDED_BY(last_seq_num_cs_);
+      RTC_GUARDED_BY(last_seq_num_cs_);
   video_coding::H264SpsPpsTracker tracker_;
   // TODO(johan): Remove pt_codec_params_ once
   // https://bugs.chromium.org/p/webrtc/issues/detail?id=6883 is resolved.
@@ -211,7 +211,7 @@
   bool has_received_frame_;
 
   std::vector<RtpPacketSinkInterface*> secondary_sinks_
-      GUARDED_BY(worker_task_checker_);
+      RTC_GUARDED_BY(worker_task_checker_);
 };
 
 }  // namespace webrtc
diff --git a/video/send_delay_stats.h b/video/send_delay_stats.h
index 5d8538e..230fa9d 100644
--- a/video/send_delay_stats.h
+++ b/video/send_delay_stats.h
@@ -64,22 +64,22 @@
 
   void UpdateHistograms();
   void RemoveOld(int64_t now, PacketMap* packets)
-      EXCLUSIVE_LOCKS_REQUIRED(crit_);
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
   AvgCounter* GetSendDelayCounter(uint32_t ssrc)
-      EXCLUSIVE_LOCKS_REQUIRED(crit_);
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
 
   Clock* const clock_;
   rtc::CriticalSection crit_;
 
-  PacketMap packets_ GUARDED_BY(crit_);
-  size_t num_old_packets_ GUARDED_BY(crit_);
-  size_t num_skipped_packets_ GUARDED_BY(crit_);
+  PacketMap packets_ RTC_GUARDED_BY(crit_);
+  size_t num_old_packets_ RTC_GUARDED_BY(crit_);
+  size_t num_skipped_packets_ RTC_GUARDED_BY(crit_);
 
-  std::set<uint32_t> ssrcs_ GUARDED_BY(crit_);
+  std::set<uint32_t> ssrcs_ RTC_GUARDED_BY(crit_);
 
   // Mapped by SSRC.
   std::map<uint32_t, std::unique_ptr<AvgCounter>> send_delay_counters_
-      GUARDED_BY(crit_);
+      RTC_GUARDED_BY(crit_);
 };
 
 }  // namespace webrtc
diff --git a/video/send_statistics_proxy.h b/video/send_statistics_proxy.h
index fead848..d6e91d7 100644
--- a/video/send_statistics_proxy.h
+++ b/video/send_statistics_proxy.h
@@ -162,30 +162,29 @@
     SampleCounter vp9;   // QP range: 0-255.
     SampleCounter h264;  // QP range: 0-51.
   };
-  void PurgeOldStats() EXCLUSIVE_LOCKS_REQUIRED(crit_);
+  void PurgeOldStats() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
   VideoSendStream::StreamStats* GetStatsEntry(uint32_t ssrc)
-      EXCLUSIVE_LOCKS_REQUIRED(crit_);
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
 
   void SetAdaptTimer(const VideoStreamEncoder::AdaptCounts& counts,
-                     StatsTimer* timer)
-      EXCLUSIVE_LOCKS_REQUIRED(crit_);
+                     StatsTimer* timer) RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
   void UpdateAdaptationStats(
       const VideoStreamEncoder::AdaptCounts& cpu_counts,
       const VideoStreamEncoder::AdaptCounts& quality_counts)
-      EXCLUSIVE_LOCKS_REQUIRED(crit_);
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
 
   Clock* const clock_;
   const std::string payload_name_;
   const VideoSendStream::Config::Rtp rtp_config_;
   rtc::CriticalSection crit_;
-  VideoEncoderConfig::ContentType content_type_ GUARDED_BY(crit_);
+  VideoEncoderConfig::ContentType content_type_ RTC_GUARDED_BY(crit_);
   const int64_t start_ms_;
-  VideoSendStream::Stats stats_ GUARDED_BY(crit_);
-  uint32_t last_sent_frame_timestamp_ GUARDED_BY(crit_);
-  std::map<uint32_t, StatsUpdateTimes> update_times_ GUARDED_BY(crit_);
-  rtc::ExpFilter encode_time_ GUARDED_BY(crit_);
-  int quality_downscales_ GUARDED_BY(crit_);
-  int cpu_downscales_ GUARDED_BY(crit_);
+  VideoSendStream::Stats stats_ RTC_GUARDED_BY(crit_);
+  uint32_t last_sent_frame_timestamp_ RTC_GUARDED_BY(crit_);
+  std::map<uint32_t, StatsUpdateTimes> update_times_ RTC_GUARDED_BY(crit_);
+  rtc::ExpFilter encode_time_ RTC_GUARDED_BY(crit_);
+  int quality_downscales_ RTC_GUARDED_BY(crit_);
+  int cpu_downscales_ RTC_GUARDED_BY(crit_);
 
   // Contains stats used for UMA histograms. These stats will be reset if
   // content type changes between real-time video and screenshare, since these
@@ -240,7 +239,7 @@
         qp_counters_;  // QP counters mapped by spatial idx.
   };
 
-  std::unique_ptr<UmaSamplesContainer> uma_container_ GUARDED_BY(crit_);
+  std::unique_ptr<UmaSamplesContainer> uma_container_ RTC_GUARDED_BY(crit_);
 };
 
 }  // namespace webrtc
diff --git a/video/video_quality_test.cc b/video/video_quality_test.cc
index 92d7968..11e0605 100644
--- a/video/video_quality_test.cc
+++ b/video/video_quality_test.cc
@@ -649,7 +649,7 @@
                           const VideoFrame& render,
                           bool dropped,
                           int64_t render_time_ms)
-      EXCLUSIVE_LOCKS_REQUIRED(crit_) {
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_) {
     int64_t reference_timestamp = wrap_handler_.Unwrap(reference.timestamp());
     int64_t send_time_ms = send_times_[reference_timestamp];
     send_times_.erase(reference_timestamp);
@@ -1032,7 +1032,8 @@
 
     VideoAnalyzer* const analyzer_;
     rtc::CriticalSection crit_;
-    rtc::VideoSinkInterface<VideoFrame>* send_stream_input_ GUARDED_BY(crit_);
+    rtc::VideoSinkInterface<VideoFrame>* send_stream_input_
+        RTC_GUARDED_BY(crit_);
     test::VideoCapturer* video_capturer_;
     Clock* clock_;
   };
@@ -1056,24 +1057,25 @@
   const int selected_tl_;
   PreEncodeProxy pre_encode_proxy_;
   OnEncodeTimingProxy encode_timing_proxy_;
-  std::vector<Sample> samples_ GUARDED_BY(comparison_lock_);
-  std::map<int64_t, int> samples_encode_time_ms_ GUARDED_BY(comparison_lock_);
-  test::Statistics sender_time_ GUARDED_BY(comparison_lock_);
-  test::Statistics receiver_time_ GUARDED_BY(comparison_lock_);
-  test::Statistics psnr_ GUARDED_BY(comparison_lock_);
-  test::Statistics ssim_ GUARDED_BY(comparison_lock_);
-  test::Statistics end_to_end_ GUARDED_BY(comparison_lock_);
-  test::Statistics rendered_delta_ GUARDED_BY(comparison_lock_);
-  test::Statistics encoded_frame_size_ GUARDED_BY(comparison_lock_);
-  test::Statistics encode_frame_rate_ GUARDED_BY(comparison_lock_);
-  test::Statistics encode_time_ms_ GUARDED_BY(comparison_lock_);
-  test::Statistics encode_usage_percent_ GUARDED_BY(comparison_lock_);
-  test::Statistics decode_time_ms_ GUARDED_BY(comparison_lock_);
-  test::Statistics decode_time_max_ms_ GUARDED_BY(comparison_lock_);
-  test::Statistics media_bitrate_bps_ GUARDED_BY(comparison_lock_);
-  test::Statistics fec_bitrate_bps_ GUARDED_BY(comparison_lock_);
-  test::Statistics send_bandwidth_bps_ GUARDED_BY(comparison_lock_);
-  test::Statistics memory_usage_ GUARDED_BY(comparison_lock_);
+  std::vector<Sample> samples_ RTC_GUARDED_BY(comparison_lock_);
+  std::map<int64_t, int> samples_encode_time_ms_
+      RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics sender_time_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics receiver_time_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics psnr_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics ssim_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics end_to_end_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics rendered_delta_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics encoded_frame_size_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics encode_frame_rate_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics encode_time_ms_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics encode_usage_percent_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics decode_time_ms_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics decode_time_max_ms_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics media_bitrate_bps_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics fec_bitrate_bps_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics send_bandwidth_bps_ RTC_GUARDED_BY(comparison_lock_);
+  test::Statistics memory_usage_ RTC_GUARDED_BY(comparison_lock_);
 
   struct FrameWithPsnr {
     double psnr;
@@ -1081,7 +1083,7 @@
   };
 
   // Rendered frame with worst PSNR is saved for further analysis.
-  rtc::Optional<FrameWithPsnr> worst_frame_ GUARDED_BY(comparison_lock_);
+  rtc::Optional<FrameWithPsnr> worst_frame_ RTC_GUARDED_BY(comparison_lock_);
 
   size_t last_fec_bytes_;
 
@@ -1097,19 +1099,19 @@
   int64_t first_sending_time_;
   int64_t last_sending_time_;
 
-  int64_t cpu_time_ GUARDED_BY(cpu_measurement_lock_);
-  int64_t wallclock_time_ GUARDED_BY(cpu_measurement_lock_);
+  int64_t cpu_time_ RTC_GUARDED_BY(cpu_measurement_lock_);
+  int64_t wallclock_time_ RTC_GUARDED_BY(cpu_measurement_lock_);
   rtc::CriticalSection cpu_measurement_lock_;
 
   rtc::CriticalSection crit_;
-  std::deque<VideoFrame> frames_ GUARDED_BY(crit_);
-  rtc::Optional<VideoFrame> last_rendered_frame_ GUARDED_BY(crit_);
-  rtc::TimestampWrapAroundHandler wrap_handler_ GUARDED_BY(crit_);
-  std::map<int64_t, int64_t> send_times_ GUARDED_BY(crit_);
-  std::map<int64_t, int64_t> recv_times_ GUARDED_BY(crit_);
-  std::map<int64_t, size_t> encoded_frame_sizes_ GUARDED_BY(crit_);
-  rtc::Optional<uint32_t> first_encoded_timestamp_ GUARDED_BY(crit_);
-  rtc::Optional<uint32_t> first_sent_timestamp_ GUARDED_BY(crit_);
+  std::deque<VideoFrame> frames_ RTC_GUARDED_BY(crit_);
+  rtc::Optional<VideoFrame> last_rendered_frame_ RTC_GUARDED_BY(crit_);
+  rtc::TimestampWrapAroundHandler wrap_handler_ RTC_GUARDED_BY(crit_);
+  std::map<int64_t, int64_t> send_times_ RTC_GUARDED_BY(crit_);
+  std::map<int64_t, int64_t> recv_times_ RTC_GUARDED_BY(crit_);
+  std::map<int64_t, size_t> encoded_frame_sizes_ RTC_GUARDED_BY(crit_);
+  rtc::Optional<uint32_t> first_encoded_timestamp_ RTC_GUARDED_BY(crit_);
+  rtc::Optional<uint32_t> first_sent_timestamp_ RTC_GUARDED_BY(crit_);
   const double avg_psnr_threshold_;
   const double avg_ssim_threshold_;
   bool is_quick_test_enabled_;
@@ -1118,7 +1120,7 @@
   std::vector<rtc::PlatformThread*> comparison_thread_pool_;
   rtc::PlatformThread stats_polling_thread_;
   rtc::Event comparison_available_event_;
-  std::deque<FrameComparison> comparisons_ GUARDED_BY(comparison_lock_);
+  std::deque<FrameComparison> comparisons_ RTC_GUARDED_BY(comparison_lock_);
   rtc::Event done_;
 
   std::unique_ptr<test::RtpFileWriter> rtp_file_writer_;
diff --git a/video/video_receive_stream.h b/video/video_receive_stream.h
index 833e189..32ce812 100644
--- a/video/video_receive_stream.h
+++ b/video/video_receive_stream.h
@@ -134,7 +134,7 @@
   RtpStreamsSynchronizer rtp_stream_sync_;
 
   rtc::CriticalSection ivf_writer_lock_;
-  std::unique_ptr<IvfFileWriter> ivf_writer_ GUARDED_BY(ivf_writer_lock_);
+  std::unique_ptr<IvfFileWriter> ivf_writer_ RTC_GUARDED_BY(ivf_writer_lock_);
 
   // Members for the new jitter buffer experiment.
   std::unique_ptr<VCMJitterEstimator> jitter_estimator_;
diff --git a/video/video_send_stream.cc b/video/video_send_stream.cc
index f2b8d4a..61884ca 100644
--- a/video/video_send_stream.cc
+++ b/video/video_send_stream.cc
@@ -293,7 +293,7 @@
 
   rtc::CriticalSection encoder_activity_crit_sect_;
   CheckEncoderActivityTask* check_encoder_activity_task_
-      GUARDED_BY(encoder_activity_crit_sect_);
+      RTC_GUARDED_BY(encoder_activity_crit_sect_);
 
   CallStats* const call_stats_;
   RtpTransportControllerSendInterface* const transport_;
@@ -303,8 +303,8 @@
   std::unique_ptr<FlexfecSender> flexfec_sender_;
 
   rtc::CriticalSection ivf_writers_crit_;
-  std::unique_ptr<IvfFileWriter> file_writers_[kMaxSimulcastStreams] GUARDED_BY(
-      ivf_writers_crit_);
+  std::unique_ptr<IvfFileWriter>
+      file_writers_[kMaxSimulcastStreams] RTC_GUARDED_BY(ivf_writers_crit_);
 
   int max_padding_bitrate_;
   int encoder_min_bitrate_bps_;
@@ -329,7 +329,8 @@
   rtc::WeakPtrFactory<VideoSendStreamImpl> weak_ptr_factory_;
 
   rtc::CriticalSection overhead_bytes_per_packet_crit_;
-  size_t overhead_bytes_per_packet_ GUARDED_BY(overhead_bytes_per_packet_crit_);
+  size_t overhead_bytes_per_packet_
+      RTC_GUARDED_BY(overhead_bytes_per_packet_crit_);
   size_t transport_overhead_bytes_per_packet_;
 };
 
diff --git a/video/video_send_stream_tests.cc b/video/video_send_stream_tests.cc
index ce7a0ee..422b983 100644
--- a/video/video_send_stream_tests.cc
+++ b/video/video_send_stream_tests.cc
@@ -1223,7 +1223,7 @@
     };
 
     virtual void SendRtcpFeedback(int remb_value)
-        EXCLUSIVE_LOCKS_REQUIRED(crit_) {
+        RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_) {
       FakeReceiveStatistics receive_stats(kVideoSendSsrcs[0],
                                           last_sequence_number_, rtp_count_, 0);
       RTCPSender rtcp_sender(false, clock_, &receive_stats, nullptr, nullptr,
@@ -1244,12 +1244,12 @@
     VideoSendStream* stream_;
 
     rtc::CriticalSection crit_;
-    TestState test_state_ GUARDED_BY(crit_);
-    int rtp_count_ GUARDED_BY(crit_);
-    int last_sequence_number_ GUARDED_BY(crit_);
-    int suspended_frame_count_ GUARDED_BY(crit_);
-    int low_remb_bps_ GUARDED_BY(crit_);
-    int high_remb_bps_ GUARDED_BY(crit_);
+    TestState test_state_ RTC_GUARDED_BY(crit_);
+    int rtp_count_ RTC_GUARDED_BY(crit_);
+    int last_sequence_number_ RTC_GUARDED_BY(crit_);
+    int suspended_frame_count_ RTC_GUARDED_BY(crit_);
+    int low_remb_bps_ RTC_GUARDED_BY(crit_);
+    int high_remb_bps_ RTC_GUARDED_BY(crit_);
   } test;
 
   RunBaseTest(&test);
@@ -1326,8 +1326,8 @@
     Clock* const clock_;
     std::unique_ptr<internal::TransportAdapter> transport_adapter_;
     rtc::CriticalSection crit_;
-    int64_t last_packet_time_ms_ GUARDED_BY(crit_);
-    test::FrameGeneratorCapturer* capturer_ GUARDED_BY(crit_);
+    int64_t last_packet_time_ms_ RTC_GUARDED_BY(crit_);
+    test::FrameGeneratorCapturer* capturer_ RTC_GUARDED_BY(crit_);
   } test;
 
   RunBaseTest(&test);
@@ -1395,8 +1395,8 @@
 
     rtc::CriticalSection crit_;
     Clock* const clock_;
-    size_t padding_length_ GUARDED_BY(crit_);
-    size_t total_length_ GUARDED_BY(crit_);
+    size_t padding_length_ RTC_GUARDED_BY(crit_);
+    size_t total_length_ RTC_GUARDED_BY(crit_);
     Call* call_;
   } test;
 
@@ -1634,7 +1634,7 @@
     test::SingleThreadedTaskQueueForTesting* const task_queue_;
     Call* call_;
     rtc::CriticalSection lock_;
-    int packets_sent_ GUARDED_BY(lock_);
+    int packets_sent_ RTC_GUARDED_BY(lock_);
     int transport_overhead_;
     const size_t kMaxRtpPacketSize = 1000;
   } test(&task_queue_);
@@ -1742,10 +1742,10 @@
   rtc::CriticalSection crit_;
   rtc::Event content_switch_event_;
   Call* call_;
-  VideoSendStream* send_stream_ GUARDED_BY(crit_);
+  VideoSendStream* send_stream_ RTC_GUARDED_BY(crit_);
   VideoSendStream::Config send_stream_config_;
   VideoEncoderConfig encoder_config_;
-  uint32_t packets_sent_ GUARDED_BY(crit_);
+  uint32_t packets_sent_ RTC_GUARDED_BY(crit_);
   bool running_without_padding_;
   T* const stream_resetter_;
 };
@@ -1833,9 +1833,9 @@
 
     rtc::CriticalSection crit_;
     rtc::Event init_encode_called_;
-    size_t number_of_initializations_ GUARDED_BY(&crit_);
-    int last_initialized_frame_width_ GUARDED_BY(&crit_);
-    int last_initialized_frame_height_ GUARDED_BY(&crit_);
+    size_t number_of_initializations_ RTC_GUARDED_BY(&crit_);
+    int last_initialized_frame_width_ RTC_GUARDED_BY(&crit_);
+    int last_initialized_frame_height_ RTC_GUARDED_BY(&crit_);
   };
 
   test::NullTransport transport;
@@ -1902,7 +1902,7 @@
    private:
     rtc::CriticalSection crit_;
     rtc::Event start_bitrate_changed_;
-    int start_bitrate_kbps_ GUARDED_BY(crit_);
+    int start_bitrate_kbps_ RTC_GUARDED_BY(crit_);
   };
 
   CreateSenderCall(Call::Config(event_log_.get()));
@@ -1992,7 +1992,7 @@
     rtc::CriticalSection crit_;
     rtc::Event encoder_init_;
     rtc::Event bitrate_changed_;
-    rtc::Optional<int> bitrate_kbps_ GUARDED_BY(crit_);
+    rtc::Optional<int> bitrate_kbps_ RTC_GUARDED_BY(crit_);
   };
 
   test::NullTransport transport;
@@ -2244,10 +2244,10 @@
     test::SingleThreadedTaskQueueForTesting* const task_queue_;
     rtc::CriticalSection crit_;
     VideoSendStream* stream_;
-    bool initialized_ GUARDED_BY(crit_);
-    bool callback_registered_ GUARDED_BY(crit_);
-    size_t num_releases_ GUARDED_BY(crit_);
-    bool released_ GUARDED_BY(crit_);
+    bool initialized_ RTC_GUARDED_BY(crit_);
+    bool callback_registered_ RTC_GUARDED_BY(crit_);
+    size_t num_releases_ RTC_GUARDED_BY(crit_);
+    bool released_ RTC_GUARDED_BY(crit_);
     VideoEncoderConfig encoder_config_;
   } test_encoder(&task_queue_);
 
@@ -2557,8 +2557,8 @@
     }
 
     rtc::CriticalSection crit_;
-    size_t rtp_packets_sent_ GUARDED_BY(&crit_);
-    size_t media_bytes_sent_ GUARDED_BY(&crit_);
+    size_t rtp_packets_sent_ RTC_GUARDED_BY(&crit_);
+    size_t media_bytes_sent_ RTC_GUARDED_BY(&crit_);
   } test;
 
   RunBaseTest(&test);
@@ -2792,7 +2792,7 @@
     rtc::Event init_encode_event_;
     rtc::Event bitrate_changed_event_;
     rtc::CriticalSection crit_;
-    uint32_t target_bitrate_ GUARDED_BY(&crit_);
+    uint32_t target_bitrate_ RTC_GUARDED_BY(&crit_);
 
     int num_initializations_;
     webrtc::Call* call_;
@@ -3457,8 +3457,8 @@
     test::SingleThreadedTaskQueueForTesting* const task_queue_;
     Call* call_;
     rtc::CriticalSection crit_;
-    uint32_t max_bitrate_bps_ GUARDED_BY(&crit_);
-    bool first_packet_sent_ GUARDED_BY(&crit_);
+    uint32_t max_bitrate_bps_ RTC_GUARDED_BY(&crit_);
+    bool first_packet_sent_ RTC_GUARDED_BY(&crit_);
     rtc::Event bitrate_changed_event_;
   } test(&task_queue_);
   RunBaseTest(&test);
diff --git a/video/video_stream_decoder.h b/video/video_stream_decoder.h
index 6ea722c..88cff97 100644
--- a/video/video_stream_decoder.h
+++ b/video/video_stream_decoder.h
@@ -97,7 +97,7 @@
   ReceiveStatisticsProxy* const receive_stats_callback_;
   rtc::VideoSinkInterface<VideoFrame>* const incoming_video_stream_;
 
-  int64_t last_rtt_ms_ GUARDED_BY(crit_);
+  int64_t last_rtt_ms_ RTC_GUARDED_BY(crit_);
 };
 
 }  // namespace webrtc
diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc
index 52dcbf0..ccd2854 100644
--- a/video/video_stream_encoder.cc
+++ b/video/video_stream_encoder.cc
@@ -342,7 +342,7 @@
 
  private:
   rtc::VideoSinkWants GetActiveSinkWantsInternal()
-      EXCLUSIVE_LOCKS_REQUIRED(&crit_) {
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(&crit_) {
     rtc::VideoSinkWants wants = sink_wants_;
     // Clear any constraints from the current sink wants that don't apply to
     // the used degradation_preference.
@@ -367,10 +367,10 @@
   rtc::CriticalSection crit_;
   rtc::SequencedTaskChecker main_checker_;
   VideoStreamEncoder* const video_stream_encoder_;
-  rtc::VideoSinkWants sink_wants_ GUARDED_BY(&crit_);
+  rtc::VideoSinkWants sink_wants_ RTC_GUARDED_BY(&crit_);
   VideoSendStream::DegradationPreference degradation_preference_
-      GUARDED_BY(&crit_);
-  rtc::VideoSourceInterface<VideoFrame>* source_ GUARDED_BY(&crit_);
+      RTC_GUARDED_BY(&crit_);
+  rtc::VideoSourceInterface<VideoFrame>* source_ RTC_GUARDED_BY(&crit_);
 
   RTC_DISALLOW_COPY_AND_ASSIGN(VideoSourceProxy);
 };
diff --git a/video/video_stream_encoder.h b/video/video_stream_encoder.h
index 8f6cb07..a0fa2df 100644
--- a/video/video_stream_encoder.h
+++ b/video/video_stream_encoder.h
@@ -217,10 +217,10 @@
     std::vector<int> resolution_counters_;
   };
 
-  AdaptCounter& GetAdaptCounter() RUN_ON(&encoder_queue_);
-  const AdaptCounter& GetConstAdaptCounter() RUN_ON(&encoder_queue_);
-  void UpdateAdaptationStats(AdaptReason reason) RUN_ON(&encoder_queue_);
-  AdaptCounts GetActiveCounts(AdaptReason reason) RUN_ON(&encoder_queue_);
+  AdaptCounter& GetAdaptCounter() RTC_RUN_ON(&encoder_queue_);
+  const AdaptCounter& GetConstAdaptCounter() RTC_RUN_ON(&encoder_queue_);
+  void UpdateAdaptationStats(AdaptReason reason) RTC_RUN_ON(&encoder_queue_);
+  AdaptCounts GetActiveCounts(AdaptReason reason) RTC_RUN_ON(&encoder_queue_);
 
   rtc::Event shutdown_event_;
 
@@ -233,10 +233,10 @@
   const VideoSendStream::Config::EncoderSettings settings_;
   const VideoCodecType codec_type_;
 
-  vcm::VideoSender video_sender_ ACCESS_ON(&encoder_queue_);
+  vcm::VideoSender video_sender_ RTC_ACCESS_ON(&encoder_queue_);
   std::unique_ptr<OveruseFrameDetector> overuse_detector_
-      ACCESS_ON(&encoder_queue_);
-  std::unique_ptr<QualityScaler> quality_scaler_ ACCESS_ON(&encoder_queue_);
+      RTC_ACCESS_ON(&encoder_queue_);
+  std::unique_ptr<QualityScaler> quality_scaler_ RTC_ACCESS_ON(&encoder_queue_);
 
   SendStatisticsProxy* const stats_proxy_;
   rtc::VideoSinkInterface<VideoFrame>* const pre_encode_callback_;
@@ -246,24 +246,24 @@
   // of VideoStreamEncoder are called on the same thread.
   rtc::ThreadChecker thread_checker_;
 
-  VideoEncoderConfig encoder_config_ ACCESS_ON(&encoder_queue_);
+  VideoEncoderConfig encoder_config_ RTC_ACCESS_ON(&encoder_queue_);
   std::unique_ptr<VideoBitrateAllocator> rate_allocator_
-      ACCESS_ON(&encoder_queue_);
+      RTC_ACCESS_ON(&encoder_queue_);
   // The maximum frame rate of the current codec configuration, as determined
   // at the last ReconfigureEncoder() call.
-  int max_framerate_ ACCESS_ON(&encoder_queue_);
+  int max_framerate_ RTC_ACCESS_ON(&encoder_queue_);
 
   // Set when ConfigureEncoder has been called in order to lazy reconfigure the
   // encoder on the next frame.
-  bool pending_encoder_reconfiguration_ ACCESS_ON(&encoder_queue_);
-  rtc::Optional<VideoFrameInfo> last_frame_info_ ACCESS_ON(&encoder_queue_);
-  int crop_width_ ACCESS_ON(&encoder_queue_);
-  int crop_height_ ACCESS_ON(&encoder_queue_);
-  uint32_t encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_);
-  size_t max_data_payload_length_ ACCESS_ON(&encoder_queue_);
-  bool nack_enabled_ ACCESS_ON(&encoder_queue_);
-  uint32_t last_observed_bitrate_bps_ ACCESS_ON(&encoder_queue_);
-  bool encoder_paused_and_dropped_frame_ ACCESS_ON(&encoder_queue_);
+  bool pending_encoder_reconfiguration_ RTC_ACCESS_ON(&encoder_queue_);
+  rtc::Optional<VideoFrameInfo> last_frame_info_ RTC_ACCESS_ON(&encoder_queue_);
+  int crop_width_ RTC_ACCESS_ON(&encoder_queue_);
+  int crop_height_ RTC_ACCESS_ON(&encoder_queue_);
+  uint32_t encoder_start_bitrate_bps_ RTC_ACCESS_ON(&encoder_queue_);
+  size_t max_data_payload_length_ RTC_ACCESS_ON(&encoder_queue_);
+  bool nack_enabled_ RTC_ACCESS_ON(&encoder_queue_);
+  uint32_t last_observed_bitrate_bps_ RTC_ACCESS_ON(&encoder_queue_);
+  bool encoder_paused_and_dropped_frame_ RTC_ACCESS_ON(&encoder_queue_);
   Clock* const clock_;
   // Counters used for deciding if the video resolution or framerate is
   // currently restricted, and if so, why, on a per degradation preference
@@ -271,10 +271,10 @@
   // TODO(sprang): Replace this with a state holding a relative overuse measure
   // instead, that can be translated into suitable down-scale or fps limit.
   std::map<const VideoSendStream::DegradationPreference, AdaptCounter>
-      adapt_counters_ ACCESS_ON(&encoder_queue_);
+      adapt_counters_ RTC_ACCESS_ON(&encoder_queue_);
   // Set depending on degradation preferences.
   VideoSendStream::DegradationPreference degradation_preference_
-      ACCESS_ON(&encoder_queue_);
+      RTC_ACCESS_ON(&encoder_queue_);
 
   struct AdaptationRequest {
     // The pixel count produced by the source at the time of the adaptation.
@@ -287,22 +287,25 @@
   // Stores a snapshot of the last adaptation request triggered by an AdaptUp
   // or AdaptDown signal.
   rtc::Optional<AdaptationRequest> last_adaptation_request_
-      ACCESS_ON(&encoder_queue_);
+      RTC_ACCESS_ON(&encoder_queue_);
 
   rtc::RaceChecker incoming_frame_race_checker_
-      GUARDED_BY(incoming_frame_race_checker_);
+      RTC_GUARDED_BY(incoming_frame_race_checker_);
   Atomic32 posted_frames_waiting_for_encode_;
   // Used to make sure incoming time stamp is increasing for every frame.
-  int64_t last_captured_timestamp_ GUARDED_BY(incoming_frame_race_checker_);
+  int64_t last_captured_timestamp_ RTC_GUARDED_BY(incoming_frame_race_checker_);
   // Delta used for translating between NTP and internal timestamps.
-  const int64_t delta_ntp_internal_ms_ GUARDED_BY(incoming_frame_race_checker_);
+  const int64_t delta_ntp_internal_ms_
+      RTC_GUARDED_BY(incoming_frame_race_checker_);
 
-  int64_t last_frame_log_ms_ GUARDED_BY(incoming_frame_race_checker_);
-  int captured_frame_count_ ACCESS_ON(&encoder_queue_);
-  int dropped_frame_count_ ACCESS_ON(&encoder_queue_);
+  int64_t last_frame_log_ms_ RTC_GUARDED_BY(incoming_frame_race_checker_);
+  int captured_frame_count_ RTC_ACCESS_ON(&encoder_queue_);
+  int dropped_frame_count_ RTC_ACCESS_ON(&encoder_queue_);
 
-  VideoBitrateAllocationObserver* bitrate_observer_ ACCESS_ON(&encoder_queue_);
-  rtc::Optional<int64_t> last_parameters_update_ms_ ACCESS_ON(&encoder_queue_);
+  VideoBitrateAllocationObserver* bitrate_observer_
+      RTC_ACCESS_ON(&encoder_queue_);
+  rtc::Optional<int64_t> last_parameters_update_ms_
+      RTC_ACCESS_ON(&encoder_queue_);
 
   // All public methods are proxied to |encoder_queue_|. It must must be
   // destroyed first to make sure no tasks are run that use other members.
diff --git a/video/video_stream_encoder_unittest.cc b/video/video_stream_encoder_unittest.cc
index 9e7fa77..488486c 100644
--- a/video/video_stream_encoder_unittest.cc
+++ b/video/video_stream_encoder_unittest.cc
@@ -89,7 +89,7 @@
 
  private:
   rtc::CriticalSection lock_;
-  int last_target_framerate_fps_ GUARDED_BY(lock_);
+  int last_target_framerate_fps_ RTC_GUARDED_BY(lock_);
 };
 
 class VideoStreamEncoderUnderTest : public VideoStreamEncoder {
@@ -218,8 +218,8 @@
     test::FrameForwarder::AddOrUpdateSink(sink, wants);
   }
   cricket::VideoAdapter adapter_;
-  bool adaptation_enabled_ GUARDED_BY(crit_);
-  rtc::VideoSinkWants last_wants_ GUARDED_BY(crit_);
+  bool adaptation_enabled_ RTC_GUARDED_BY(crit_);
+  rtc::VideoSinkWants last_wants_ RTC_GUARDED_BY(crit_);
 };
 
 class MockableSendStatisticsProxy : public SendStatisticsProxy {
@@ -248,7 +248,7 @@
 
  private:
   rtc::CriticalSection lock_;
-  rtc::Optional<VideoSendStream::Stats> mock_stats_ GUARDED_BY(lock_);
+  rtc::Optional<VideoSendStream::Stats> mock_stats_ RTC_GUARDED_BY(lock_);
 };
 
 class MockBitrateObserver : public VideoBitrateAllocationObserver {
@@ -551,16 +551,16 @@
     }
 
     rtc::CriticalSection local_crit_sect_;
-    bool block_next_encode_ GUARDED_BY(local_crit_sect_) = false;
+    bool block_next_encode_ RTC_GUARDED_BY(local_crit_sect_) = false;
     rtc::Event continue_encode_event_;
-    uint32_t timestamp_ GUARDED_BY(local_crit_sect_) = 0;
-    int64_t ntp_time_ms_ GUARDED_BY(local_crit_sect_) = 0;
-    int last_input_width_ GUARDED_BY(local_crit_sect_) = 0;
-    int last_input_height_ GUARDED_BY(local_crit_sect_) = 0;
-    bool quality_scaling_ GUARDED_BY(local_crit_sect_) = true;
+    uint32_t timestamp_ RTC_GUARDED_BY(local_crit_sect_) = 0;
+    int64_t ntp_time_ms_ RTC_GUARDED_BY(local_crit_sect_) = 0;
+    int last_input_width_ RTC_GUARDED_BY(local_crit_sect_) = 0;
+    int last_input_height_ RTC_GUARDED_BY(local_crit_sect_) = 0;
+    bool quality_scaling_ RTC_GUARDED_BY(local_crit_sect_) = true;
     std::vector<std::unique_ptr<TemporalLayers>> allocated_temporal_layers_
-        GUARDED_BY(local_crit_sect_);
-    bool force_init_encode_failed_ GUARDED_BY(local_crit_sect_) = false;
+        RTC_GUARDED_BY(local_crit_sect_);
+    bool force_init_encode_failed_ RTC_GUARDED_BY(local_crit_sect_) = false;
   };
 
   class TestSink : public VideoStreamEncoder::EncoderSink {
diff --git a/voice_engine/audio_level.h b/voice_engine/audio_level.h
index d69365a..33f8fe2 100644
--- a/voice_engine/audio_level.h
+++ b/voice_engine/audio_level.h
@@ -45,13 +45,13 @@
 
   rtc::CriticalSection crit_sect_;
 
-  int16_t abs_max_ GUARDED_BY(crit_sect_);
-  int16_t count_ GUARDED_BY(crit_sect_);
-  int8_t current_level_ GUARDED_BY(crit_sect_);
-  int16_t current_level_full_range_ GUARDED_BY(crit_sect_);
+  int16_t abs_max_ RTC_GUARDED_BY(crit_sect_);
+  int16_t count_ RTC_GUARDED_BY(crit_sect_);
+  int8_t current_level_ RTC_GUARDED_BY(crit_sect_);
+  int16_t current_level_full_range_ RTC_GUARDED_BY(crit_sect_);
 
-  double total_energy_ GUARDED_BY(crit_sect_) = 0.0;
-  double total_duration_ GUARDED_BY(crit_sect_) = 0.0;
+  double total_energy_ RTC_GUARDED_BY(crit_sect_) = 0.0;
+  double total_duration_ RTC_GUARDED_BY(crit_sect_) = 0.0;
 };
 
 }  // namespace voe
diff --git a/voice_engine/channel.cc b/voice_engine/channel.cc
index 0e83989..746db81 100644
--- a/voice_engine/channel.cc
+++ b/voice_engine/channel.cc
@@ -192,7 +192,7 @@
 
  private:
   rtc::CriticalSection crit_;
-  RtcEventLog* event_log_ GUARDED_BY(crit_);
+  RtcEventLog* event_log_ RTC_GUARDED_BY(crit_);
   RTC_DISALLOW_COPY_AND_ASSIGN(RtcEventLogProxy);
 };
 
@@ -220,7 +220,7 @@
 
  private:
   rtc::CriticalSection crit_;
-  RtcpRttStats* rtcp_rtt_stats_ GUARDED_BY(crit_);
+  RtcpRttStats* rtcp_rtt_stats_ RTC_GUARDED_BY(crit_);
   RTC_DISALLOW_COPY_AND_ASSIGN(RtcpRttStatsProxy);
 };
 
@@ -265,7 +265,7 @@
   rtc::ThreadChecker thread_checker_;
   rtc::ThreadChecker pacer_thread_;
   rtc::ThreadChecker network_thread_;
-  TransportFeedbackObserver* feedback_observer_ GUARDED_BY(&crit_);
+  TransportFeedbackObserver* feedback_observer_ RTC_GUARDED_BY(&crit_);
 };
 
 class TransportSequenceNumberProxy : public TransportSequenceNumberAllocator {
@@ -294,7 +294,7 @@
   rtc::CriticalSection crit_;
   rtc::ThreadChecker thread_checker_;
   rtc::ThreadChecker pacer_thread_;
-  TransportSequenceNumberAllocator* seq_num_allocator_ GUARDED_BY(&crit_);
+  TransportSequenceNumberAllocator* seq_num_allocator_ RTC_GUARDED_BY(&crit_);
 };
 
 class RtpPacketSenderProxy : public RtpPacketSender {
@@ -324,7 +324,7 @@
  private:
   rtc::ThreadChecker thread_checker_;
   rtc::CriticalSection crit_;
-  RtpPacketSender* rtp_packet_sender_ GUARDED_BY(&crit_);
+  RtpPacketSender* rtp_packet_sender_ RTC_GUARDED_BY(&crit_);
 };
 
 class VoERtcpObserver : public RtcpBandwidthObserver {
@@ -398,7 +398,7 @@
   // Maps remote side ssrc to extended highest sequence number received.
   std::map<uint32_t, uint32_t> extended_max_sequence_number_;
   rtc::CriticalSection crit_;
-  RtcpBandwidthObserver* bandwidth_observer_ GUARDED_BY(crit_);
+  RtcpBandwidthObserver* bandwidth_observer_ RTC_GUARDED_BY(crit_);
 };
 
 class Channel::ProcessAndEncodeAudioTask : public rtc::QueuedTask {
diff --git a/voice_engine/channel.h b/voice_engine/channel.h
index 89c2b43..e5209f5 100644
--- a/voice_engine/channel.h
+++ b/voice_engine/channel.h
@@ -440,7 +440,7 @@
                                 unsigned char id);
 
   void UpdateOverheadForEncoder()
-      EXCLUSIVE_LOCKS_REQUIRED(overhead_per_packet_lock_);
+      RTC_EXCLUSIVE_LOCKS_REQUIRED(overhead_per_packet_lock_);
 
   int GetRtpTimestampRateHz() const;
   int64_t GetRTT(bool allow_associate_channel) const;
@@ -482,16 +482,16 @@
   int _outputFilePlayerId;
   int _outputFileRecorderId;
   bool _outputFileRecording;
-  uint32_t _timeStamp ACCESS_ON(encoder_queue_);
+  uint32_t _timeStamp RTC_ACCESS_ON(encoder_queue_);
 
-  RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_);
+  RemoteNtpTimeEstimator ntp_estimator_ RTC_GUARDED_BY(ts_stats_lock_);
 
   // Timestamp of the audio pulled from NetEq.
   rtc::Optional<uint32_t> jitter_buffer_playout_timestamp_;
 
   rtc::CriticalSection video_sync_lock_;
-  uint32_t playout_timestamp_rtp_ GUARDED_BY(video_sync_lock_);
-  uint32_t playout_delay_ms_ GUARDED_BY(video_sync_lock_);
+  uint32_t playout_timestamp_rtp_ RTC_GUARDED_BY(video_sync_lock_);
+  uint32_t playout_delay_ms_ RTC_GUARDED_BY(video_sync_lock_);
   uint16_t send_sequence_number_;
 
   rtc::CriticalSection ts_stats_lock_;
@@ -501,7 +501,7 @@
   int64_t capture_start_rtp_time_stamp_;
   // The capture ntp time (in local timebase) of the first played out audio
   // frame.
-  int64_t capture_start_ntp_time_ms_ GUARDED_BY(ts_stats_lock_);
+  int64_t capture_start_ntp_time_ms_ RTC_GUARDED_BY(ts_stats_lock_);
 
   // uses
   Statistics* _engineStatisticsPtr;
@@ -511,18 +511,19 @@
   VoiceEngineObserver* _voiceEngineObserverPtr;  // owned by base
   rtc::CriticalSection* _callbackCritSectPtr;    // owned by base
   Transport* _transportPtr;  // WebRtc socket or external transport
-  RmsLevel rms_level_ ACCESS_ON(encoder_queue_);
-  bool input_mute_ GUARDED_BY(volume_settings_critsect_);
-  bool previous_frame_muted_ ACCESS_ON(encoder_queue_);
-  float _outputGain GUARDED_BY(volume_settings_critsect_);
+  RmsLevel rms_level_ RTC_ACCESS_ON(encoder_queue_);
+  bool input_mute_ RTC_GUARDED_BY(volume_settings_critsect_);
+  bool previous_frame_muted_ RTC_ACCESS_ON(encoder_queue_);
+  float _outputGain RTC_GUARDED_BY(volume_settings_critsect_);
   // VoEBase
   bool _mixFileWithMicrophone;
   // VoeRTP_RTCP
   // TODO(henrika): can today be accessed on the main thread and on the
   // task queue; hence potential race.
   bool _includeAudioLevelIndication;
-  size_t transport_overhead_per_packet_ GUARDED_BY(overhead_per_packet_lock_);
-  size_t rtp_overhead_per_packet_ GUARDED_BY(overhead_per_packet_lock_);
+  size_t transport_overhead_per_packet_
+      RTC_GUARDED_BY(overhead_per_packet_lock_);
+  size_t rtp_overhead_per_packet_ RTC_GUARDED_BY(overhead_per_packet_lock_);
   rtc::CriticalSection overhead_per_packet_lock_;
   // VoENetwork
   AudioFrame::SpeechType _outputSpeechType;
@@ -530,7 +531,7 @@
   std::unique_ptr<VoERtcpObserver> rtcp_observer_;
   // An associated send channel.
   rtc::CriticalSection assoc_send_channel_lock_;
-  ChannelOwner associate_send_channel_ GUARDED_BY(assoc_send_channel_lock_);
+  ChannelOwner associate_send_channel_ RTC_GUARDED_BY(assoc_send_channel_lock_);
 
   bool pacing_enabled_;
   PacketRouter* packet_router_ = nullptr;
@@ -550,7 +551,7 @@
 
   rtc::CriticalSection encoder_queue_lock_;
 
-  bool encoder_queue_is_active_ GUARDED_BY(encoder_queue_lock_) = false;
+  bool encoder_queue_is_active_ RTC_GUARDED_BY(encoder_queue_lock_) = false;
 
   rtc::TaskQueue* encoder_queue_ = nullptr;
 };
diff --git a/voice_engine/shared_data.h b/voice_engine/shared_data.h
index 971d7d7..7251c6a 100644
--- a/voice_engine/shared_data.h
+++ b/voice_engine/shared_data.h
@@ -71,7 +71,7 @@
  std::unique_ptr<ProcessThread> _moduleProcessThreadPtr;
  // |encoder_queue| is defined last to ensure all pending tasks are cancelled
  // and deleted before any other members.
- rtc::TaskQueue encoder_queue_ ACCESS_ON(construction_thread_);
+ rtc::TaskQueue encoder_queue_ RTC_ACCESS_ON(construction_thread_);
 
  SharedData();
  virtual ~SharedData();
diff --git a/voice_engine/test/auto_test/fakes/conference_transport.h b/voice_engine/test/auto_test/fakes/conference_transport.h
index 22711bd..a0acd9e 100644
--- a/voice_engine/test/auto_test/fakes/conference_transport.h
+++ b/voice_engine/test/auto_test/fakes/conference_transport.h
@@ -137,8 +137,9 @@
   unsigned int rtt_ms_;
   unsigned int stream_count_;
 
-  std::map<unsigned int, std::pair<int, int>> streams_ GUARDED_BY(stream_crit_);
-  std::deque<Packet> packet_queue_ GUARDED_BY(pq_crit_);
+  std::map<unsigned int, std::pair<int, int>> streams_
+      RTC_GUARDED_BY(stream_crit_);
+  std::deque<Packet> packet_queue_ RTC_GUARDED_BY(pq_crit_);
 
   int local_sender_;  // Channel Id of local sender
   int reflector_;
diff --git a/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h b/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h
index 1404fa5..cb36f61 100644
--- a/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h
+++ b/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h
@@ -145,9 +145,9 @@
   rtc::CriticalSection crit_;
   const std::unique_ptr<webrtc::EventWrapper> packet_event_;
   rtc::PlatformThread thread_;
-  std::deque<Packet> packet_queue_ GUARDED_BY(crit_);
+  std::deque<Packet> packet_queue_ RTC_GUARDED_BY(crit_);
   const int channel_;
-  std::map<uint32_t, int> channels_ GUARDED_BY(crit_);
+  std::map<uint32_t, int> channels_ RTC_GUARDED_BY(crit_);
   webrtc::VoENetwork* const voe_network_;
   webrtc::Atomic32 transmitted_packets_;
 };