Chromium Code Reviews| 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. |
| + // 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()). |
|
the sun
2016/01/24 21:34:10
Maybe, but the ctor taking a seed is still needed
tommi
2016/01/24 21:54:35
Maybe we can do both? If Random calls an overrida
stefan-webrtc
2016/01/25 10:09:32
I think what solenberg is saying is that it would
the sun
2016/01/25 11:24:57
No, tests use constant seeds. I can spot three use
tommi
2016/01/25 12:28:33
Great, I think I get it now :) I'll take a closer
|
| explicit Random(uint64_t seed); |
| // Return pseudo-random integer of the specified type. |