From a907e01c63b83240162ec736347df5e9faacfa2d Mon Sep 17 00:00:00 2001 From: "tommi@webrtc.org" Date: Wed, 28 Jan 2015 17:33:12 +0000 Subject: [PATCH] Adding constness. Make a few member variables in the Transport class officially const so that it's clear that locking isn't needed for access. There are getters for some of these (e.g. content_name()) that don't have locking or checking, so making the variables const is at least a way to guard against regressions. Also making the clock_ member in overuse_frame_detector.h const for clarity that it doesn't require a lock for access. No code change. Review URL: https://webrtc-codereview.appspot.com/35949004 Cr-Commit-Position: refs/heads/master@{#8186} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8186 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/p2p/base/transport.h | 10 +++++----- webrtc/video_engine/overuse_frame_detector.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/webrtc/p2p/base/transport.h b/webrtc/p2p/base/transport.h index cfbd2ec68..abead7fac 100644 --- a/webrtc/p2p/base/transport.h +++ b/webrtc/p2p/base/transport.h @@ -413,11 +413,11 @@ class Transport : public rtc::MessageHandler, // Sends SignalCompleted if we are now in that state. void MaybeCompleted_w(); - rtc::Thread* signaling_thread_; - rtc::Thread* worker_thread_; - std::string content_name_; - std::string type_; - PortAllocator* allocator_; + rtc::Thread* const signaling_thread_; + rtc::Thread* const worker_thread_; + const std::string content_name_; + const std::string type_; + PortAllocator* const allocator_; bool destroyed_; TransportState readable_; TransportState writable_; diff --git a/webrtc/video_engine/overuse_frame_detector.h b/webrtc/video_engine/overuse_frame_detector.h index d96adb197..2c1cd1395 100644 --- a/webrtc/video_engine/overuse_frame_detector.h +++ b/webrtc/video_engine/overuse_frame_detector.h @@ -126,7 +126,7 @@ class OveruseFrameDetector : public Module { CpuOveruseOptions options_ GUARDED_BY(crit_); - Clock* clock_; + Clock* const clock_; int64_t next_process_time_; int64_t num_process_times_ GUARDED_BY(crit_);