Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Unified Diff: webrtc/base/random.h

Issue 1623543002: Refactor RtpSender and SSRCDatabase a bit. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtp_sender.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtp_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698