Index: webrtc/base/random.h |
diff --git a/webrtc/base/random.h b/webrtc/base/random.h |
index 647b84c9c947b8d11f711012c9deb5e09b151d3f..bd9f4323b22e3aa561c7fae48cb95cd957d5598e 100644 |
--- a/webrtc/base/random.h |
+++ b/webrtc/base/random.h |
@@ -21,6 +21,14 @@ namespace webrtc { |
class Random { |
public: |
+ // TODO(tommi): Change this so that the seed is initialized internally. |
the sun
2016/02/01 10:41:28
Please remove this comment. I believe the right de
tommi
2016/02/01 17:32:03
Yeah, so, I'm on the fence about that. On one sid
pbos-webrtc
2016/02/01 17:59:25
Sounds like a case for having two constructors whe
|
+ // At the moment all callers are calling clock_->TimeInMicroseconds() which |
+ // goes through a global clock object (+vtable) and eventually calls |
+ // TickTime::Now().Ticks(), which can return a very low value on Mac, which |
+ // can result in a seed of 0 after conversion to microseconds. |
+ // Instead see if we can use something from webrtc/base that works the same |
+ // way across platforms (and is itself more random than the Mac implementation |
+ // of TickTime::Now()). |
explicit Random(uint64_t seed); |
// Return pseudo-random integer of the specified type. |