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

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: Update comment and remove the one from ssrc_database.cc 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..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.
« 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