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
diff --git a/webrtc/p2p/base/transport.h b/webrtc/p2p/base/transport.h
index cfbd2ec..abead7f 100644
--- a/webrtc/p2p/base/transport.h
+++ b/webrtc/p2p/base/transport.h
@@ -413,11 +413,11 @@
// 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 d96adb1..2c1cd13 100644
--- a/webrtc/video_engine/overuse_frame_detector.h
+++ b/webrtc/video_engine/overuse_frame_detector.h
@@ -126,7 +126,7 @@
CpuOveruseOptions options_ GUARDED_BY(crit_);
- Clock* clock_;
+ Clock* const clock_;
int64_t next_process_time_;
int64_t num_process_times_ GUARDED_BY(crit_);