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

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: Remove thread checker due to voe::ChannelOwner 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/base/timing.h » ('j') | webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h » ('J')
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.
+ // 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.
« no previous file with comments | « no previous file | webrtc/base/timing.h » ('j') | webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698