| Index: webrtc/base/random.h
|
| diff --git a/webrtc/base/random.h b/webrtc/base/random.h
|
| index 647b84c9c947b8d11f711012c9deb5e09b151d3f..cb7b9ebe4a7d90778671ae6f2eda2b5ca32fd2cb 100644
|
| --- a/webrtc/base/random.h
|
| +++ b/webrtc/base/random.h
|
| @@ -21,6 +21,17 @@ namespace webrtc {
|
|
|
| class Random {
|
| public:
|
| + // TODO(tommi): Change this so that the seed can be initialized internally,
|
| + // e.g. by offering two ways of constructing or offer a static method that
|
| + // returns a seed that's suitable for initialization.
|
| + // The problem now is that callers are calling clock_->TimeInMicroseconds()
|
| + // which calls TickTime::Now().Ticks(), which can return a very low value on
|
| + // Mac and can result in a seed of 0 after conversion to microseconds.
|
| + // Besides the quality of the random seed being poor, this also requires
|
| + // the client to take on extra dependencies to generate a seed.
|
| + // If we go for a static seed generator in Random, we can use something from
|
| + // webrtc/base and make sure that it works the same way across platforms.
|
| + // See also discussion here: https://codereview.webrtc.org/1623543002/
|
| explicit Random(uint64_t seed);
|
|
|
| // Return pseudo-random integer of the specified type.
|
|
|